qxLib
Classes | Functions
string_converters.inl File Reference

Go to the source code of this file.

Classes

struct  qx::details::char_array_helper< char_t, array >
 

Functions

void qx::to_wstring (wstring &out, cstring_view stringView, const std::locale &locale=get_locale())
 convert cstring to wstring More...
 
wstring qx::to_wstring (cstring_view stringView, const std::locale &locale=get_locale())
 convert cstring to wstring More...
 
void qx::to_wstring (wstring &out, wstring_view stringView, const std::locale &locale=get_locale())
 Convert wstring to wstring. More...
 
wstring_view qx::to_wstring (wstring_view stringView, const std::locale &locale=get_locale())
 Convert wstring to wstring (stub) More...
 
void qx::to_cstring (cstring &out, wstring_view stringView, const std::locale &locale=get_locale())
 Convert wstring to cstring. More...
 
cstring qx::to_cstring (wstring_view stringView, const std::locale &locale=get_locale())
 Convert wstring to cstring. More...
 
void qx::to_cstring (cstring &out, cstring_view stringView, const std::locale &locale=get_locale())
 Convert string to string. More...
 
cstring_view qx::to_cstring (cstring_view stringView, const std::locale &locale=get_locale())
 Convert string to string (stub) More...
 
void qx::to_string (string &out, cstring_view stringView, const std::locale &locale=get_locale())
 Convert a char string to common string type. More...
 
string qx::to_string (cstring_view stringView, const std::locale &locale=get_locale())
 Convert a char string to common string type. More...
 
void qx::to_string (string &out, wstring_view stringView, const std::locale &locale=get_locale())
 Convert a wchar_t string to common string type. More...
 
string qx::to_string (wstring_view stringView, const std::locale &locale=get_locale())
 Convert a wchar_t string to common string type. More...
 
void qx::utf8_to_string (string &out, cstring_view pszUtf8)
 Convert const char* representing UTF8 to wstring. More...
 
string qx::utf8_to_string (cstring_view pszUtf8)
 Convert const char* representing UTF8 to wstring. More...
 
void qx::string_to_uft8 (cstring &out, string_view svText)
 Convert the engine string representation to UTF-8 bytes. More...
 
cstring qx::string_to_uft8 (string_view svText)
 Convert the engine string representation to UTF-8 bytes. More...
 
template<class char_t , string_literal sLiteral>
constexpr basic_string_view< char_t > qx::convert_string_literal ()
 Convert a constexpr string literal to the wider or equal char type string view. More...
 

Detailed Description

Author
Khrapov
Date
11.01.2026

Definition in file string_converters.inl.

Function Documentation

◆ convert_string_literal()

template<class char_t , string_literal sLiteral>
constexpr basic_string_view< char_t > qx::convert_string_literal ( )
constexpr

Convert a constexpr string literal to the wider or equal char type string view.

Template Parameters
char_t- target string view type
sLiteral- constexpr string literal
Returns
- constexpr string view of a wider or equal char type

Definition at line 257 of file string_converters.inl.

◆ string_to_uft8() [1/2]

void qx::string_to_uft8 ( cstring &  out,
string_view  svText 
)
inline

Convert the engine string representation to UTF-8 bytes.

Parameters
out- destination UTF-8 string; cleared for empty or unrepresentable input
svText- source string, with embedded nulls preserved

Definition at line 200 of file string_converters.inl.

◆ string_to_uft8() [2/2]

cstring qx::string_to_uft8 ( string_view  svText)
inline

Convert the engine string representation to UTF-8 bytes.

Parameters
svText- source string, with embedded nulls preserved
Returns
- UTF-8 bytes, or an empty string for empty or unrepresentable input

Definition at line 228 of file string_converters.inl.

◆ to_cstring() [1/4]

void qx::to_cstring ( cstring &  out,
cstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert string to string.

Parameters
out- output char string
stringView- char string view
locale- locale to use

Definition at line 104 of file string_converters.inl.

◆ to_cstring() [2/4]

void qx::to_cstring ( cstring &  out,
wstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert wstring to cstring.

'?' is a default character

Parameters
out- output char string
stringView- wchar_t string view
locale- locale to use

Definition at line 65 of file string_converters.inl.

◆ to_cstring() [3/4]

cstring_view qx::to_cstring ( cstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert string to string (stub)

Parameters
stringView- char string view
locale- locale to use
Returns
- char string

Definition at line 109 of file string_converters.inl.

◆ to_cstring() [4/4]

cstring qx::to_cstring ( wstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert wstring to cstring.

'?' is a default character

Parameters
stringView- wchar_t string view
locale- locale to use
Returns
- char string

Definition at line 97 of file string_converters.inl.

◆ to_string() [1/4]

string qx::to_string ( cstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert a char string to common string type.

Parameters
stringView- char string
locale- locale to use
Returns
- common string

Definition at line 125 of file string_converters.inl.

◆ to_string() [2/4]

void qx::to_string ( string &  out,
cstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert a char string to common string type.

Parameters
out- output common string
stringView- char string
locale- locale to use

Definition at line 114 of file string_converters.inl.

◆ to_string() [3/4]

void qx::to_string ( string &  out,
wstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert a wchar_t string to common string type.

Parameters
out- output common string
stringView- wchar_t string
locale- locale to use

Definition at line 136 of file string_converters.inl.

◆ to_string() [4/4]

string qx::to_string ( wstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert a wchar_t string to common string type.

Parameters
stringView- wchar_t string
locale- locale to use
Returns
- common string

Definition at line 147 of file string_converters.inl.

◆ to_wstring() [1/4]

wstring qx::to_wstring ( cstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

convert cstring to wstring

Parameters
stringView- char string view
locale- locale to use
Returns
- wchar_t string

Definition at line 48 of file string_converters.inl.

◆ to_wstring() [2/4]

void qx::to_wstring ( wstring &  out,
cstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

convert cstring to wstring

Parameters
out- output wchar_t string
stringView- char string view
locale- locale to use

Definition at line 15 of file string_converters.inl.

◆ to_wstring() [3/4]

void qx::to_wstring ( wstring &  out,
wstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert wstring to wstring.

Parameters
out- output wchar_t string
stringView- wchar_t string view
locale- locale to use

Definition at line 55 of file string_converters.inl.

◆ to_wstring() [4/4]

wstring_view qx::to_wstring ( wstring_view  stringView,
const std::locale &  locale = get_locale() 
)
inline

Convert wstring to wstring (stub)

Parameters
stringView- wchar_t string view
locale- locale to use
Returns
- wchar_t string

Definition at line 60 of file string_converters.inl.

◆ utf8_to_string() [1/2]

string qx::utf8_to_string ( cstring_view  pszUtf8)
inline

Convert const char* representing UTF8 to wstring.

Parameters
pszUtf8- UTF8 string
Returns
- wchar_t string

Definition at line 193 of file string_converters.inl.

◆ utf8_to_string() [2/2]

void qx::utf8_to_string ( string &  out,
cstring_view  pszUtf8 
)
inline

Convert const char* representing UTF8 to wstring.

Parameters
out- output wchar_t string
pszUtf8- UTF8 string

Definition at line 158 of file string_converters.inl.