From 832cf15cbbcf7a0db8f04009366742ef0fadf99c Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Thu, 19 Feb 2015 19:17:44 +1100 Subject: Add methods for converting between byte positions and UTF-16 code point positions. This is needed on Cocoa where the IME wants to be able to index into the document with UTF-16 counts to match Cocoa's own use of UTF-16. --- src/Document.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Document.h') diff --git a/src/Document.h b/src/Document.h index e808bb37f..5e66dc2b6 100644 --- a/src/Document.h +++ b/src/Document.h @@ -279,6 +279,7 @@ public: 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; + int GetRelativePositionUTF16(int positionStart, int characterOffset) const; int SCI_METHOD GetCharacterAndWidth(int position, int *pWidth) const; int SCI_METHOD CodePage() const; bool SCI_METHOD IsDBCSLeadByte(char ch) const; @@ -322,6 +323,7 @@ public: int GetLineIndentPosition(int line) const; int GetColumn(int position); int CountCharacters(int startPos, int endPos) const; + int CountUTF16(int startPos, int endPos) const; int FindColumn(int line, int column); void Indent(bool forwards, int lineBottom, int lineTop); static std::string TransformLineEnds(const char *s, size_t len, int eolModeWanted); -- cgit v1.2.3