diff options
Diffstat (limited to 'lexlib/SubStyles.h')
-rw-r--r-- | lexlib/SubStyles.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lexlib/SubStyles.h b/lexlib/SubStyles.h index f5b15e9cf..07b0f1507 100644 --- a/lexlib/SubStyles.h +++ b/lexlib/SubStyles.h @@ -37,6 +37,10 @@ public: return firstStyle; } + int Last() const { + return firstStyle + lenStyles - 1; + } + int Length() const { return lenStyles; } @@ -153,6 +157,24 @@ public: return secondaryDistance; } + int FirstAllocated() const { + int start = 257; + for (std::vector<WordClassifier>::const_iterator it = classifiers.begin(); it != classifiers.end(); ++it) { + if (start > it->Start()) + start = it->Start(); + } + return (start < 256) ? start : -1; + } + + int LastAllocated() const { + int last = -1; + for (std::vector<WordClassifier>::const_iterator it = classifiers.begin(); it != classifiers.end(); ++it) { + if (last < it->Last()) + last = it->Last(); + } + return last; + } + void SetIdentifiers(int style, const char *identifiers) { int block = BlockFromStyle(style); if (block >= 0) |