40 std::string::const_iterator c, e;
42 c = text.begin() + byteOffset;
46 return std::string(text.begin(), c).size();
51 std::string::const_iterator c, b;
53 c = text.begin() + byteOffset;
57 return std::string(b, c).size();
62 std::string::iterator begin, cur;
63 begin = text.begin() + byteOffset;
67 text = std::string(text.begin(), begin) + std::string(cur, text.end());
74 std::string::iterator cut;
78 newText = text.substr(0, byteOffset) +
" ";
82 cut = newText.begin() + byteOffset;
85 newText = std::string(newText.begin(), cut);
86 newOffset = newText.size();
88 text = newText + text.substr(byteOffset);
100 std::string::const_iterator cur, end;
103 if (charIndex < 0)
return 0;
108 for(i = 0; i < charIndex && cur != end; i++) {
112 return std::string(text.begin(), cur).size();
static int insertChar(std::string &text, int byteOffset, int ch)
Insert a character at specified byte offset.
static int nextChar(const std::string &text, int byteOffset)
Returns byte offset of the next character.
uint32_t next(octet_iterator &it, octet_iterator end)
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)
static int getOffset(const std::string &text, int charIndex)
Gets byte offset for character index.
uint32_t prior(octet_iterator &it, octet_iterator start)
static int countChars(const std::string &text, int byteOffset)
Counts characters up to byteOffset.
static int prevChar(const std::string &text, int byteOffset)
Returns byte offset of the previous character.
octet_iterator append(uint32_t cp, octet_iterator result)
The library API - functions intended to be called by the users.