1 | // Scintilla source code edit control |
2 | /** @file CaseFolder.h |
3 | ** Classes for case folding. |
4 | **/ |
5 | // Copyright 1998-2013 by Neil Hodgson <neilh@scintilla.org> |
6 | // The License.txt file describes the conditions under which this software may be distributed. |
7 | |
8 | #ifndef CASEFOLDER_H |
9 | #define CASEFOLDER_H |
10 | |
11 | namespace Scintilla::Internal { |
12 | |
13 | class CaseFolder { |
14 | public: |
15 | virtual ~CaseFolder(); |
16 | virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) = 0; |
17 | }; |
18 | |
19 | class CaseFolderTable : public CaseFolder { |
20 | protected: |
21 | char mapping[256]; |
22 | public: |
23 | CaseFolderTable() noexcept; |
24 | size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override; |
25 | void SetTranslation(char ch, char chTranslation) noexcept; |
26 | void StandardASCII() noexcept; |
27 | }; |
28 | |
29 | class ICaseConverter; |
30 | |
31 | class CaseFolderUnicode : public CaseFolderTable { |
32 | ICaseConverter *converter; |
33 | public: |
34 | CaseFolderUnicode(); |
35 | size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override; |
36 | }; |
37 | |
38 | } |
39 | |
40 | #endif |
41 | |