1 // Scintilla source code edit control
3 /** @file CaseConvert.h
4 ** Performs Unicode case conversions.
5 ** Does not handle locale-sensitive case conversion.
7 // Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
8 // The License.txt file describes the conditions under which this software may be distributed.
23 class ICaseConverter
{
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
);