Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
nana::utf Namespace Reference

Functions

const char * char_ptr (const char *text, unsigned pos)
 return a pointer to the code unit of the character at pos More...
 
const char * char_ptr (const std::string &text_utf8, unsigned pos)
 return a pointer to the code unit of the character at pos - reuse ^ ? More...
 
wchar_t char_at (const char *text_utf8, unsigned pos, unsigned *len)
 return a code point (max 16 bits?) and the len in code units of the character at pos More...
 
wchar_t char_at (const ::std::string &text_utf8, unsigned pos, unsigned *len)
 return a code point (max 16 bits?) and the len in code units of the character at pos More...
 
const char * char_ptr (const ::std::string &text_utf8, unsigned pos)
 

Function Documentation

wchar_t nana::utf::char_at ( const char *  text_utf8,
unsigned  pos,
unsigned *  len 
)

return a code point (max 16 bits?) and the len in code units of the character at pos

Get the unicode character by a specified character index.

Parameters
text_utf8A string encoded as UTF-8.
posThe unicode character index.
lenA unsigned pointer to receive the number of bytes it takes in UTF-8 encoded. If len is a nullptr, it is ignored.
Returns
A unicode character. '\0' if pos is out of range.
wchar_t nana::utf::char_at ( const ::std::string text_utf8,
unsigned  pos,
unsigned *  len 
)

return a code point (max 16 bits?) and the len in code units of the character at pos

const char* nana::utf::char_ptr ( const ::std::string text_utf8,
unsigned  pos 
)
const char * nana::utf::char_ptr ( const char *  text_utf8,
unsigned  pos 
)

return a pointer to the code unit of the character at pos

Attempt to get a pointer to a character of UTF-8 string by a specified character index.

Parameters
text_utf8A string encoded as UTF-8.
posThe unicode character index.
Returns
A pointer to the unicode character. It returns a null if pos is out of range.
const char* nana::utf::char_ptr ( const std::string text_utf8,
unsigned  pos 
)

return a pointer to the code unit of the character at pos - reuse ^ ?