Update Scintilla to version 3.4.4
[TortoiseGit.git] / ext / scintilla / src / CaseConvert.h
blob4015e428fe0b32f998709103c112fbad050c5f11
1 // Scintilla source code edit control
2 // Encoding: UTF-8
3 /** @file CaseConvert.h
4 ** Performs Unicode case conversions.
5 ** Does not handle locale-sensitive case conversion.
6 **/
7 // Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
8 // The License.txt file describes the conditions under which this software may be distributed.
10 #ifndef CASECONVERT_H
11 #define CASECONVERT_H
13 #ifdef SCI_NAMESPACE
14 namespace Scintilla {
15 #endif
17 enum CaseConversion {
18 CaseConversionFold,
19 CaseConversionUpper,
20 CaseConversionLower
23 class ICaseConverter {
24 public:
25 virtual size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed) = 0;
28 ICaseConverter *ConverterFor(enum CaseConversion conversion);
30 // Returns a UTF-8 string. Empty when no conversion
31 const char *CaseConvert(int character, enum CaseConversion conversion);
33 // When performing CaseConvertString, the converted value may be up to 3 times longer than the input.
34 // Ligatures are often decomposed into multiple characters and long cases include:
35 // ΐ "\xce\x90" folds to ΐ "\xce\xb9\xcc\x88\xcc\x81"
36 const int maxExpansionCaseConversion=3;
38 // Converts a mixed case string using a particular conversion.
39 // Result may be a different length to input and the length is the return value.
40 // If there is not enough space then 0 is returned.
41 size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed, enum CaseConversion conversion);
43 #ifdef SCI_NAMESPACE
45 #endif
47 #endif