geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

CharacterCategory.h
Go to the documentation of this file.
1// Scintilla source code edit control
2/** @file CharacterCategory.h
3 ** Returns the Unicode general category of a character.
4 **/
5// Copyright 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 CHARACTERCATEGORY_H
9#define CHARACTERCATEGORY_H
10
11namespace Scintilla {
12
21};
22
24
25// Common definitions of allowable characters in identifiers from UAX #31.
26bool IsIdStart(int character);
27bool IsIdContinue(int character);
28bool IsXidStart(int character);
29bool IsXidContinue(int character);
30
32private:
33 std::vector<unsigned char> dense;
34public:
36 CharacterCategory CategoryFor(int character) const {
37 if (static_cast<size_t>(character) < dense.size()) {
38 return static_cast<CharacterCategory>(dense[character]);
39 } else {
40 // binary search through ranges
42 }
43 }
44 int Size() const noexcept;
45 void Optimize(int countCharacters);
46};
47
48}
49
50#endif
void Optimize(int countCharacters)
CharacterCategory CategoryFor(int character) const
std::vector< unsigned char > dense
Styling buffer using one element for each run rather than using a filled buffer.
Definition: Converter.h:9
bool IsXidStart(int character)
bool IsIdContinue(int character)
bool IsIdStart(int character)
CharacterCategory CategoriseCharacter(int character)
bool IsXidContinue(int character)