C++ Library Extensions 2022.12.09
To help learn modern C++ programming
cpg_conversion.hpp File Reference
#include <string>
#include <iostream>
#include <clocale>
#include <cstring>
#include <type_traits>
#include <windows.h>
Include dependency graph for cpg_conversion.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

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

Macros

#define TBB_SUPPRESS_DEPRECATED_MESSAGES   1
 
#define NOMINMAX
 

Functions

void cpg::conversion::load_default_locale (bool ShowLocaleName=false)
 Load system default locale for string conversion. More...
 
std::string cpg::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 cpg::conversion::string_to_wstring (const std::string &str, unsigned int codepage=CP_UTF8)
 Converts std::string to std::wstring using codepage. More...
 
std::string cpg::conversion::utf16_to_utf8 (const std::wstring &utf16str)
 Converts UTF16 std::wstring to UTF8 std::string. More...
 
std::wstring cpg::conversion::utf8_to_utf16 (const std::string &utf8str)
 Converts UTF8 std::string to UTF16 std::wstring. More...
 
std::string cpg::conversion::utf16_to_utf8 (const wchar_t *utf16str)
 Converts UTF16 (const wchar_t*) to UTF8 (std::string) More...
 
std::wstring cpg::conversion::utf8_to_utf16 (const char *utf8str)
 Converts UTF8 string (const char*) to UTF16 (std::wstring) More...
 
char cpg::conversion::utf16_to_utf8 (const wchar_t utf16_char)
 Converts UTF16 wchar_t to UFT8 char. More...
 
wchar_t cpg::conversion::utf8_to_utf16 (const char utf8_char)
 Converts UTF8 char to UTF16 char. More...
 
std::wstring cpg::conversion::windows_codepage_to_utf16 (const std::string &codepage_string)
 Converts Windows codepage std::string to utf16 std::wstring. More...
 
std::string cpg::conversion::utf16_to_windows_codepage (const std::wstring &utf16_string)
 Converts UTF16 std::wstring to Windows codepage std::string. More...
 
std::wstring cpg::conversion::windows_codepage_to_utf16 (const char *codepage_string)
 Converts Windows codepage const char* to UTF16 std::wstring. More...
 
std::string cpg::conversion::utf16_to_windows_codepage (const wchar_t *utf16_string)
 Converts UTF16 const wchar_t* to Windows codepage std::string. More...
 
std::string cpg::conversion::windows_codepage_to_utf8 (const std::string &codepage_string)
 Converts Windows codepage std::string to UTF8 std::string. More...
 
std::string cpg::conversion::windows_codepage_to_utf8 (const char *codepage_string)
 Converts Windows codepage const char* to UTF8 std::string. More...
 
std::string cpg::conversion::utf8_to_windows_codepage (const std::string &utf8_string)
 Converts UTF8 std::string to Windows codepage string. More...
 
std::string cpg::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) cpg::conversion::source_to_target (const std::basic_string< SourceCharType > &str)
 Converts from source to target. More...
 
std::string cpg::conversion::smart_encode (const char *arg)
 
std::string cpg::conversion::smart_encode (const wchar_t *arg)
 

Macro Definition Documentation

◆ NOMINMAX

#define NOMINMAX

Definition at line 20 of file cpg_conversion.hpp.

◆ TBB_SUPPRESS_DEPRECATED_MESSAGES

#define TBB_SUPPRESS_DEPRECATED_MESSAGES   1

Definition at line 16 of file cpg_conversion.hpp.