diff options
author | Neil <nyamatongwe@gmail.com> | 2014-10-02 18:17:13 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-10-02 18:17:13 +1000 |
commit | 2603f1e2074b0f880886b533ffc47ecef4fd33f7 (patch) | |
tree | 53bfaff1eca31d0768f43d0c496c81b551230a2d /src/Document.h | |
parent | 8c42cc95ae3fbfdb8d4b7e8893c2fee283efe1a6 (diff) | |
download | scintilla-mirror-2603f1e2074b0f880886b533ffc47ecef4fd33f7.tar.gz |
Allow using C++11 <regex> for searches as a provisional feature.
Diffstat (limited to 'src/Document.h')
-rw-r--r-- | src/Document.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Document.h b/src/Document.h index e84be14e4..477b4dc60 100644 --- a/src/Document.h +++ b/src/Document.h @@ -188,6 +188,10 @@ public: } }; +struct RegexError : public std::runtime_error { + RegexError() : std::runtime_error("regex failure") {} +}; + /** */ class Document : PerLine, public IDocumentWithLineEnd, public ILoader { @@ -271,7 +275,7 @@ public: bool IsCrLf(int pos) const; int LenChar(int pos); bool InGoodUTF8(int pos, int &start, int &end) const; - int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true); + int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true) const; int NextPosition(int pos, int moveDir) const; bool NextCharacter(int &pos, int moveDir) const; // Returns true if pos changed int SCI_METHOD GetRelativePosition(int positionStart, int characterOffset) const; @@ -345,6 +349,7 @@ public: void DeleteAllMarks(int markerNum); int LineFromHandle(int markerHandle); int SCI_METHOD LineStart(int line) const; + bool IsLineStartPosition(int position) const; int SCI_METHOD LineEnd(int line) const; int LineEndPosition(int position) const; bool IsLineEndPosition(int position) const; @@ -364,6 +369,16 @@ public: int NextWordEnd(int pos, int delta); int SCI_METHOD Length() const { return cb.Length(); } void Allocate(int newSize) { cb.Allocate(newSize); } + + struct CharacterExtracted { + unsigned int character; + unsigned int widthBytes; + CharacterExtracted(unsigned int character_, unsigned int widthBytes_) : + character(character_), widthBytes(widthBytes_) { + } + }; + CharacterExtracted ExtractCharacter(int position) const; + bool MatchesWordOptions(bool word, bool wordStart, int pos, int length) const; bool HasCaseFolder(void) const; void SetCaseFolder(CaseFolder *pcf_); |