C++ Library Extensions 2022.12.09
To help learn modern C++ programming
tpf_conversion.hpp File Reference

String conversions are implemented. More...

#include <string>
#include <iostream>
#include <clocale>
#include <cstring>
#include <type_traits>
#include <windows.h>
Include dependency graph for tpf_conversion.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  tpf
 Includes subnamespace conversion.
 
namespace  tpf::conversion
 String conversions are implemented.
 

Macros

#define TBB_SUPPRESS_DEPRECATED_MESSAGES   1
 
#define NOMINMAX
 

Functions

void tpf::conversion::load_default_locale (bool ShowLocaleName=false)
 Load system default locale for string conversion. More...
 
std::string tpf::conversion::wstring_to_string (const std::wstring &wstr, unsigned int codepage=CP_UTF8)
 Converts from std::wstring to std::string with codepage. More...
 
std::wstring tpf::conversion::string_to_wstring (const std::string &str, unsigned int codepage=CP_UTF8)
 Converts std::string to std::wstring using codepage. More...
 
std::string tpf::conversion::utf16_to_utf8 (const std::wstring &utf16str)
 Converts UTF16 std::wstring to UTF8 std::string. More...
 
std::wstring tpf::conversion::utf8_to_utf16 (const std::string &utf8str)
 Converts UTF8 std::string to UTF16 std::wstring. More...
 
std::string tpf::conversion::utf16_to_utf8 (const wchar_t *utf16str)
 Converts UTF16 (const wchar_t*) to UTF8 (std::string) More...
 
std::wstring tpf::conversion::utf8_to_utf16 (const char *utf8str)
 Converts UTF8 string (const char*) to UTF16 (std::wstring) More...
 
char tpf::conversion::utf16_to_utf8 (const wchar_t utf16_char)
 Converts UTF16 wchar_t to UFT8 char. More...
 
wchar_t tpf::conversion::utf8_to_utf16 (const char utf8_char)
 Converts UTF8 char to UTF16 char. More...
 
std::wstring tpf::conversion::windows_codepage_to_utf16 (const std::string &codepage_string)
 Converts Windows codepage std::string to utf16 std::wstring. More...
 
std::string tpf::conversion::utf16_to_windows_codepage (const std::wstring &utf16_string)
 Converts UTF16 std::wstring to Windows codepage std::string. More...
 
std::wstring tpf::conversion::windows_codepage_to_utf16 (const char *codepage_string)
 Converts Windows codepage const char* to UTF16 std::wstring. More...
 
std::string tpf::conversion::utf16_to_windows_codepage (const wchar_t *utf16_string)
 Converts UTF16 const wchar_t* to Windows codepage std::string. More...
 
std::string tpf::conversion::windows_codepage_to_utf8 (const std::string &codepage_string)
 Converts Windows codepage std::string to UTF8 std::string. More...
 
std::string tpf::conversion::windows_codepage_to_utf8 (const char *codepage_string)
 Converts Windows codepage const char* to UTF8 std::string. More...
 
std::string tpf::conversion::utf8_to_windows_codepage (const std::string &utf8_string)
 Converts UTF8 std::string to Windows codepage string. More...
 
std::string tpf::conversion::utf8_to_windows_codepage (const char *utf8_string)
 Converts UTF8 const char* to Windows codepage std::string. More...
 
template<typename TargetCharType , typename SourceCharType >
decltype(auto) tpf::conversion::source_to_target (const std::basic_string< SourceCharType > &str)
 Converts from source to target. More...
 
std::string tpf::conversion::smart_encode (const char *arg)
 
std::string tpf::conversion::smart_encode (const wchar_t *arg)
 

Detailed Description

String conversions are implemented.

Author
Thomas Kim (Thoma.nosp@m.sKim.nosp@m.@Talk.nosp@m.Play.nosp@m.Fun.c.nosp@m.om)
Version
0.1
Date
2019-04-13

Definition in file tpf_conversion.hpp.

Macro Definition Documentation

◆ NOMINMAX

#define NOMINMAX

Definition at line 20 of file tpf_conversion.hpp.

◆ TBB_SUPPRESS_DEPRECATED_MESSAGES

#define TBB_SUPPRESS_DEPRECATED_MESSAGES   1

Definition at line 16 of file tpf_conversion.hpp.