Boost.Nowide
|
This namespace includes implementations of the standard library functions and classes such that they accept UTF-8 strings on Windows. On other platforms (i.e. not on Windows) those functions and classes are just aliases of the corresponding ones from the std namespace or behave like them. More...
Classes | |
class | args |
args is a class that fixes standard main() function arguments and changes them to UTF-8 under Microsoft Windows. More... | |
class | basic_filebuf |
This forward declaration defines the basic_filebuf type. More... | |
class | basic_filebuf< char > |
This is the implementation of std::filebuf. More... | |
class | basic_fstream |
Same as std::basic_fstream<char> but accepts UTF-8 strings under Windows. More... | |
class | basic_ifstream |
Same as std::basic_ifstream<char> but accepts UTF-8 strings under Windows. More... | |
class | basic_ofstream |
Same as std::basic_ofstream<char> but accepts UTF-8 strings under Windows. More... | |
class | basic_stackstring |
A class that allows to create a temporary wide or narrow UTF strings from wide or narrow UTF source. More... | |
class | utf8_codecvt |
class | utf8_codecvt< CharType, 2 > |
Specialization for the UTF-8 <-> UTF-16 variant of the std::codecvt implementation. More... | |
class | utf8_codecvt< CharType, 4 > |
Specialization for the UTF-8 <-> UTF-32 variant of the std::codecvt implementation. More... | |
Typedefs | |
typedef basic_filebuf< char > | filebuf |
Convenience typedef. More... | |
typedef basic_ifstream< char > | ifstream |
typedef basic_ofstream< char > | ofstream |
typedef basic_fstream< char > | fstream |
typedef basic_stackstring< wchar_t, char, 256 > | wstackstring |
typedef basic_stackstring< char, wchar_t, 256 > | stackstring |
typedef basic_stackstring< wchar_t, char, 16 > | wshort_stackstring |
typedef basic_stackstring< char, wchar_t, 16 > | short_stackstring |
Functions | |
char * | narrow (char *output, size_t output_size, const wchar_t *begin, const wchar_t *end) |
char * | narrow (char *output, size_t output_size, const wchar_t *source) |
wchar_t * | widen (wchar_t *output, size_t output_size, const char *begin, const char *end) |
wchar_t * | widen (wchar_t *output, size_t output_size, const char *source) |
std::string | narrow (const wchar_t *s, size_t count) |
std::string | narrow (const wchar_t *s) |
std::string | narrow (const std::wstring &s) |
std::wstring | widen (const char *s, size_t count) |
std::wstring | widen (const char *s) |
std::wstring | widen (const std::string &s) |
FILE * | freopen (const char *file_name, const char *mode, FILE *stream) |
Same as freopen but file_name and mode are UTF-8 strings. | |
FILE * | fopen (const char *file_name, const char *mode) |
Same as fopen but file_name and mode are UTF-8 strings. | |
int | rename (const char *old_name, const char *new_name) |
Same as rename but old_name and new_name are UTF-8 strings. | |
int | remove (const char *name) |
Same as rename but name is UTF-8 string. | |
char * | getenv (const char *key) |
UTF-8 aware getenv. Returns 0 if the variable is not set. More... | |
int | system (const char *cmd) |
int | setenv (const char *key, const char *value, int overwrite) |
Set environment variable key to value. More... | |
int | unsetenv (const char *key) |
Remove environment variable key. More... | |
int | putenv (char *string) |
Adds or changes an environment variable, string must be in format KEY=VALUE. More... | |
std::locale | nowide_filesystem () |
BOOST_STATIC_ASSERT (sizeof(std::mbstate_t) >=2) | |
void | dummy_exported_function () |
Variables | |
detail::winconsole_istream | cin |
Same as std::cin, but uses UTF-8. More... | |
detail::winconsole_ostream | cout |
Same as std::cout, but uses UTF-8. More... | |
detail::winconsole_ostream | cerr |
Same as std::cerr, but uses UTF-8. More... | |
detail::winconsole_ostream | clog |
Same as std::clog, but uses UTF-8. More... | |
This namespace includes implementations of the standard library functions and classes such that they accept UTF-8 strings on Windows. On other platforms (i.e. not on Windows) those functions and classes are just aliases of the corresponding ones from the std namespace or behave like them.
typedef basic_filebuf< char > boost::nowide::filebuf |
Convenience typedef.
Same as std::filebuf but accepts UTF-8 strings under Windows
typedef basic_fstream<char> boost::nowide::fstream |
Same as std::fstream but accepts UTF-8 strings under Windows and *::filesystem::path on all systems
typedef basic_ifstream<char> boost::nowide::ifstream |
Same as std::ifstream but accepts UTF-8 strings under Windows and *::filesystem::path on all systems
typedef basic_ofstream<char> boost::nowide::ofstream |
Same as std::ofstream but accepts UTF-8 strings under Windows and *::filesystem::path on all systems
typedef basic_stackstring<char, wchar_t, 16> boost::nowide::short_stackstring |
Convenience typedef
typedef basic_stackstring<char, wchar_t, 256> boost::nowide::stackstring |
Convenience typedef
typedef basic_stackstring<wchar_t, char, 16> boost::nowide::wshort_stackstring |
Convenience typedef
typedef basic_stackstring<wchar_t, char, 256> boost::nowide::wstackstring |
Convenience typedef
void boost::nowide::dummy_exported_function | ( | ) |
Avoid empty compilation unit warnings
char* boost::nowide::getenv | ( | const char * | key | ) |
UTF-8 aware getenv. Returns 0 if the variable is not set.
This function is not thread safe or reenterable as defined by the standard library
|
inline |
Convert wide string (UTF-16/32) in range [begin,end) to NULL terminated narrow string (UTF-8) stored in output of size output_size (including NULL)
If there is not enough room NULL is returned, else output is returned. Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER
|
inline |
Convert NULL terminated wide string (UTF-16/32) to NULL terminated narrow string (UTF-8) stored in output of size output_size (including NULL)
If there is not enough room NULL is returned, else output is returned. Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER
|
inline |
Convert wide string (UTF-16/32) to narrow string (UTF-8).
s | Input string |
count | Number of characters to convert Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER |
|
inline |
Convert wide string (UTF-16/32) to narrow string (UTF-8).
s | NULL terminated input string Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER |
|
inline |
Convert wide string (UTF-16/32) to narrow string (UTF-8).
s | Input string Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER |
|
inline |
Install utf8_codecvt facet into boost::filesystem::path such all char strings are interpreted as utf-8 strings
int boost::nowide::putenv | ( | char * | string | ) |
Adds or changes an environment variable, string must be in format KEY=VALUE.
string MAY become part of the environment, hence changes to the value MAY change the environment. For portability it is hence recommended NOT to change it. string is UTF-8 on Windows
int boost::nowide::setenv | ( | const char * | key, |
const char * | value, | ||
int | overwrite | ||
) |
Set environment variable key to value.
if overwrite is not 0, that the old value is always overwritten, otherwise, if the variable exists it remains unchanged
key and value are UTF-8 on Windows
int boost::nowide::system | ( | const char * | cmd | ) |
Same as std::system but cmd is UTF-8.
int boost::nowide::unsetenv | ( | const char * | key | ) |
Remove environment variable key.
key is UTF-8 on Windows
|
inline |
Convert narrow string (UTF-8) in range [begin,end) to NULL terminated wide string (UTF-16/32) stored in output of size output_size (including NULL)
If there is not enough room NULL is returned, else output is returned. Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER
|
inline |
Convert NULL terminated narrow string (UTF-8) to NULL terminated wide string (UTF-16/32) most output_size (including NULL)
If there is not enough room NULL is returned, else output is returned. Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER
|
inline |
Convert narrow string (UTF-8) to wide string (UTF-16/32).
s | Input string |
count | Number of characters to convert Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER |
|
inline |
Convert narrow string (UTF-8) to wide string (UTF-16/32).
s | NULL terminated input string Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER |
|
inline |
Convert narrow string (UTF-8) to wide string (UTF-16/32).
s | Input string Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER |
detail::winconsole_ostream boost::nowide::cerr |
Same as std::cerr, but uses UTF-8.
Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio
detail::winconsole_istream boost::nowide::cin |
Same as std::cin, but uses UTF-8.
Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio
detail::winconsole_ostream boost::nowide::clog |
Same as std::clog, but uses UTF-8.
Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio
detail::winconsole_ostream boost::nowide::cout |
Same as std::cout, but uses UTF-8.
Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio