#include <utf8_iterator.hpp>
Public Member Functions | |
UTF8Iterator (const std::string &text_) | |
bool | done () const |
UTF8Iterator & | operator++ () |
uint32_t | operator * () const |
Public Attributes | |
const std::string & | text |
std::string::size_type | pos |
uint32_t | chr |
Definition at line 24 of file utf8_iterator.hpp.
UTF8Iterator::UTF8Iterator | ( | const std::string & | text_ | ) |
Definition at line 90 of file utf8_iterator.cpp.
References chr, decode_utf8(), log_debug, pos, and text.
00090 : 00091 text(text_), 00092 pos(0), 00093 chr() 00094 { 00095 try { 00096 chr = decode_utf8(text, pos); 00097 } catch (std::exception) { 00098 log_debug << "Malformed utf-8 sequence beginning with " << *((uint32_t*)(text.c_str() + pos)) << " found " << std::endl; 00099 chr = 0; 00100 } 00101 }
bool UTF8Iterator::done | ( | ) | const |
UTF8Iterator & UTF8Iterator::operator++ | ( | ) |
Definition at line 110 of file utf8_iterator.cpp.
References chr, decode_utf8(), log_debug, pos, and text.
00110 { 00111 try { 00112 chr = decode_utf8(text, pos); 00113 } catch (std::exception) { 00114 log_debug << "Malformed utf-8 sequence beginning with " << *((uint32_t*)(text.c_str() + pos)) << " found " << std::endl; 00115 chr = 0; 00116 ++pos; 00117 } 00118 00119 return *this; 00120 }
uint32_t UTF8Iterator::operator * | ( | ) | const |
const std::string& UTF8Iterator::text |
Definition at line 27 of file utf8_iterator.hpp.
Referenced by done(), operator++(), and UTF8Iterator().
std::string::size_type UTF8Iterator::pos |
Definition at line 28 of file utf8_iterator.hpp.
Referenced by done(), operator++(), and UTF8Iterator().
uint32_t UTF8Iterator::chr |
Definition at line 29 of file utf8_iterator.hpp.
Referenced by operator *(), operator++(), and UTF8Iterator().