diff options
author | Neil <nyamatongwe@gmail.com> | 2020-07-16 19:46:17 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2020-07-16 19:46:17 +1000 |
commit | eee3518ff6d00cbc477f69ffeb75a08024f45c75 (patch) | |
tree | 00aa8225a539247173ded9687cc4f7bad843f995 | |
parent | 335f4af10b617f51eb64ed4b15267e13cf587afa (diff) | |
download | scintilla-mirror-eee3518ff6d00cbc477f69ffeb75a08024f45c75.tar.gz |
Backport: Make EncodingType an enum class.
Backport of changeset 8414:b093ae84d34a.
-rw-r--r-- | lexlib/LexAccessor.h | 10 | ||||
-rw-r--r-- | lexlib/StyleContext.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index f8c180e14..19fc186d0 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -10,7 +10,7 @@ namespace Scintilla { -enum EncodingType { enc8bit, encUnicode, encDBCS }; +enum class EncodingType { eightBit, unicode, dbcs }; class LexAccessor { private: @@ -51,7 +51,7 @@ public: explicit LexAccessor(IDocument *pAccess_) : pAccess(pAccess_), startPos(extremePosition), endPos(0), codePage(pAccess->CodePage()), - encodingType(enc8bit), + encodingType(EncodingType::eightBit), lenDoc(pAccess->Length()), validLen(0), startSeg(0), startPosStyling(0), @@ -61,14 +61,14 @@ public: styleBuf[0] = 0; switch (codePage) { case 65001: - encodingType = encUnicode; + encodingType = EncodingType::unicode; break; case 932: case 936: case 949: case 950: case 1361: - encodingType = encDBCS; + encodingType = EncodingType::dbcs; } } char operator[](Sci_Position position) { @@ -97,7 +97,7 @@ public: bool IsLeadByte(char ch) const { return pAccess->IsDBCSLeadByte(ch); } - EncodingType Encoding() const { + EncodingType Encoding() const noexcept { return encodingType; } bool Match(Sci_Position pos, const char *s) { diff --git a/lexlib/StyleContext.h b/lexlib/StyleContext.h index 320a96652..e84f001f7 100644 --- a/lexlib/StyleContext.h +++ b/lexlib/StyleContext.h @@ -72,7 +72,7 @@ public: width(0), chNext(0), widthNext(1) { - if (styler.Encoding() != enc8bit) { + if (styler.Encoding() != EncodingType::eightBit) { multiByteAccess = styler.MultiByteAccess(); } styler.StartAt(startPos /*, chMask*/); |