14#ifndef ZYPP_TUI_OUTPUT_UTF8_H_
15#define ZYPP_TUI_OUTPUT_UTF8_H_
44 const std::string &
str()
const {
return _str; }
52 static bool isCJK = []()->
bool {
53 const char *
lang = ::getenv(
"LANG" );
63 const char *
s =
_str.c_str();
66 if ( *
s ==
'\033' && *(
s+1) ==
'[' )
69 while (
slen > 0 && *
s !=
'm' )
95 if ( ansi == 1 &&
ch ==
'[' )
100 else if ( ansi >= 2 )
104 {
ret -= ansi; ansi = 0; }
111 else if (
ch ==
'\033' )
132 {
return( (
ch & 0xC0) == 0x80 ); }
150 while ( *
chp ==
'\033' && *(
chp+1) ==
'[' )
154 while ( *
chp && *
chp !=
'm' )
173 inline string operator+(
const string & lhs,
const string & rhs )
176 inline string operator+(
const string & lhs,
const std::string & rhs )
179 inline string operator+(
const std::string & lhs,
const string & rhs )
182 inline string operator+(
const string & lhs,
const char * rhs )
185 inline string operator+(
const char * lhs,
const string & rhs )
190 {
return str <<
obj.str(); }
std::ostream & operator<<(std::ostream &str, const string &obj)
Stream output.
size_type upos(size_type pos_r, size_type start_r=0) const
Return start of codepoint pos_r starting at position start_r.
bool isContinuationByte(char ch) const
Test for continuation byte '10xxxxxx'.
const char * c_str() const
static const size_type npos
string substr(size_type pos_r=0, size_type len_r=npos) const
utf8 substring
const std::string & str() const
size_type size() const
utf8 size
std::string::size_type size_type
string operator+(const string &lhs, const string &rhs)
concatenation
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
String related utilities and Regular expression matching.
string operator+(const string &lhs, const std::string &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...