]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/CharClassify.h
Fix setting initial wxSpinCtrl value outside 0..100 range in wxMSW.
[wxWidgets.git] / src / stc / scintilla / src / CharClassify.h
1 // Scintilla source code edit control
2 /** @file CharClassify.h
3 ** Character classifications used by Document and RESearch.
4 **/
5 // Copyright 2006-2009 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
7
8 #ifndef CHARCLASSIFY_H
9 #define CHARCLASSIFY_H
10
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
14
15 class CharClassify {
16 public:
17 CharClassify();
18
19 enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation };
20 void SetDefaultCharClasses(bool includeWordClass);
21 void SetCharClasses(const unsigned char *chars, cc newCharClass);
22 int GetCharsOfClass(cc charClass, unsigned char *buffer);
23 cc GetClass(unsigned char ch) const { return static_cast<cc>(charClass[ch]);}
24 bool IsWord(unsigned char ch) const { return static_cast<cc>(charClass[ch]) == ccWord;}
25
26 private:
27 enum { maxChar=256 };
28 unsigned char charClass[maxChar]; // not type cc to save space
29 };
30
31 #ifdef SCI_NAMESPACE
32 }
33 #endif
34
35 #endif