1 // Scintilla source code edit control 2 /** @file CaseFolder.h 3 ** Classes for case folding. 4 **/ 5 // Copyright 1998-2013 by Neil Hodgson <[email protected]> 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 { 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 ~CaseFolderTable() override; 25 size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override; 26 void SetTranslation(char ch, char chTranslation) noexcept; 27 void StandardASCII() noexcept; 28 }; 29 30 class ICaseConverter; 31 32 class CaseFolderUnicode : public CaseFolderTable { 33 ICaseConverter *converter; 34 public: 35 CaseFolderUnicode(); 36 size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override; 37 }; 38 39 } 40 41 #endif 42