mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
The partial upgrade approach failed - Scintilla 5.5.8 src/ files have tight coupling with win32/ that cannot be separated due to changes in PLATFORM_ASSERT and other shared macros. Scintilla stays at 5.5.7. Lexilla 5.4.6 upgrade remains intact.
33 lines
1017 B
C++
33 lines
1017 B
C++
// Scintilla source code edit control
|
|
/** @file CharClassify.h
|
|
** Character classifications used by Document and RESearch.
|
|
**/
|
|
// Copyright 2006-2009 by Neil Hodgson <neilh@scintilla.org>
|
|
// The License.txt file describes the conditions under which this software may be distributed.
|
|
|
|
#ifndef CHARCLASSIFY_H
|
|
#define CHARCLASSIFY_H
|
|
|
|
namespace Scintilla::Internal {
|
|
|
|
enum class CharacterClass : unsigned char { space, newLine, word, punctuation };
|
|
|
|
class CharClassify {
|
|
public:
|
|
CharClassify() noexcept;
|
|
|
|
void SetDefaultCharClasses(bool includeWordClass) noexcept;
|
|
void SetCharClasses(const unsigned char *chars, CharacterClass newCharClass) noexcept;
|
|
int GetCharsOfClass(CharacterClass characterClass, unsigned char *buffer) const noexcept;
|
|
CharacterClass GetClass(unsigned char ch) const noexcept { return charClass[ch];}
|
|
bool IsWord(unsigned char ch) const noexcept { return charClass[ch] == CharacterClass::word;}
|
|
|
|
private:
|
|
static constexpr int maxChar=256;
|
|
CharacterClass charClass[maxChar];
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|