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
11namespace Scintilla::Internal {
12
13class CaseFolder {
14public:
15 virtual ~CaseFolder();
16 virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) = 0;
17};
18
19class CaseFolderTable : public CaseFolder {
20protected:
21 char mapping[256];
22public:
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
29class ICaseConverter;
30
31class CaseFolderUnicode : public CaseFolderTable {
32 ICaseConverter *converter;
33public:
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