38 std::string::const_iterator c, e;
40 c = text.begin() + byteOffset;
44 return std::string(text.begin(), c).size();
49 std::string::const_iterator c, b;
51 c = text.begin() + byteOffset;
55 return std::string(b, c).size();
60 std::string::iterator begin, cur;
61 begin = text.begin() + byteOffset;
65 text = std::string(text.begin(), begin) + std::string(cur, text.end());
72 std::string::iterator cut;
76 newText = text.substr(0, byteOffset) +
" ";
80 cut = newText.begin() + byteOffset;
83 newText = std::string(newText.begin(), cut);
84 newOffset = newText.size();
86 text = newText + text.substr(byteOffset);
98 if (charIndex < 0)
return 0;
100 std::string::const_iterator cur, end;
104 for(
int i = 0; i < charIndex && cur != end; i++) {
108 return std::string(text.begin(), cur).size();
uint32_t next(octet_iterator &it, octet_iterator end)
static int getOffset(const std::string &text, int charIndex)
Gets byte offset for character index.
static int eraseChar(std::string &text, int byteOffset)
Erase character at specified byte offset.
std::iterator_traits< octet_iterator >::difference_type distance(octet_iterator first, octet_iterator last)
uint32_t prior(octet_iterator &it, octet_iterator start)
static int prevChar(const std::string &text, int byteOffset)
Returns byte offset of the previous character.
static int nextChar(const std::string &text, int byteOffset)
Returns byte offset of the next character.
static int countChars(const std::string &text, int byteOffset)
Counts characters up to byteOffset.
static int insertChar(std::string &text, int byteOffset, int ch)
Insert a character at specified byte offset.
octet_iterator append(uint32_t cp, octet_iterator result)