C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Functions
utility::conversions Namespace Reference

Functions for Unicode string conversions. More...

Functions

_ASYNCRTIMP std::string __cdecl utf16_to_utf8 (const utf16string &w)
 Converts a UTF-16 string to a UTF-8 string. More...
 
_ASYNCRTIMP utf16string __cdecl utf8_to_utf16 (const std::string &s)
 Converts a UTF-8 string to a UTF-16 More...
 
_ASYNCRTIMP utf16string __cdecl usascii_to_utf16 (const std::string &s)
 Converts a ASCII (us-ascii) string to a UTF-16 string. More...
 
_ASYNCRTIMP utf16string __cdecl latin1_to_utf16 (const std::string &s)
 Converts a Latin1 (iso-8859-1) string to a UTF-16 string. More...
 
_ASYNCRTIMP utf8string __cdecl latin1_to_utf8 (const std::string &s)
 Converts a Latin1 (iso-8859-1) string to a UTF-8 string. More...
 
_ASYNCRTIMP utility::string_t __cdecl to_string_t (std::string &&s)
 Converts to a platform dependent Unicode string type. More...
 
_ASYNCRTIMP utility::string_t __cdecl to_string_t (utf16string &&s)
 Converts to a platform dependent Unicode string type. More...
 
_ASYNCRTIMP utility::string_t __cdecl to_string_t (const std::string &s)
 Converts to a platform dependent Unicode string type. More...
 
_ASYNCRTIMP utility::string_t __cdecl to_string_t (const utf16string &s)
 Converts to a platform dependent Unicode string type. More...
 
_ASYNCRTIMP utf16string __cdecl to_utf16string (const std::string &value)
 Converts to a UTF-16 from string. More...
 
_ASYNCRTIMP utf16string __cdecl to_utf16string (utf16string value)
 Converts to a UTF-16 from string. More...
 
_ASYNCRTIMP std::string __cdecl to_utf8string (std::string value)
 Converts to a UTF-8 string. More...
 
_ASYNCRTIMP std::string __cdecl to_utf8string (const utf16string &value)
 Converts to a UTF-8 string. More...
 
_ASYNCRTIMP utility::string_t __cdecl to_base64 (const std::vector< unsigned char > &data)
 Encode the given byte array into a base64 string More...
 
_ASYNCRTIMP utility::string_t __cdecl to_base64 (uint64_t data)
 Encode the given 8-byte integer into a base64 string More...
 
_ASYNCRTIMP std::vector< unsigned char > __cdecl from_base64 (const utility::string_t &str)
 Decode the given base64 string to a byte array More...
 
template<typename Source >
utility::string_t print_string (const Source &val, const std::locale &loc)
 
template<typename Source >
utility::string_t print_string (const Source &val)
 
template<typename Target >
Target scan_string (const utility::string_t &str, const std::locale &loc)
 
template<typename Target >
Target scan_string (const utility::string_t &str)
 

Detailed Description

Functions for Unicode string conversions.

Function Documentation

_ASYNCRTIMP std::vector<unsigned char> __cdecl utility::conversions::from_base64 ( const utility::string_t &  str)

Decode the given base64 string to a byte array

_ASYNCRTIMP utf16string __cdecl utility::conversions::latin1_to_utf16 ( const std::string &  s)

Converts a Latin1 (iso-8859-1) string to a UTF-16 string.

Parameters
sA single byte character UTF-8 string.
Returns
A two byte character UTF-16 string.
_ASYNCRTIMP utf8string __cdecl utility::conversions::latin1_to_utf8 ( const std::string &  s)

Converts a Latin1 (iso-8859-1) string to a UTF-8 string.

Parameters
sA single byte character UTF-8 string.
Returns
A single byte character UTF-8 string.
_ASYNCRTIMP utility::string_t __cdecl utility::conversions::to_base64 ( const std::vector< unsigned char > &  data)

Encode the given byte array into a base64 string

_ASYNCRTIMP utility::string_t __cdecl utility::conversions::to_base64 ( uint64_t  data)

Encode the given 8-byte integer into a base64 string

_ASYNCRTIMP utility::string_t __cdecl utility::conversions::to_string_t ( std::string &&  s)

Converts to a platform dependent Unicode string type.

Parameters
sA single byte character UTF-8 string.
Returns
A platform dependent string type.
_ASYNCRTIMP utility::string_t __cdecl utility::conversions::to_string_t ( utf16string &&  s)

Converts to a platform dependent Unicode string type.

Parameters
sA two byte character UTF-16 string.
Returns
A platform dependent string type.
_ASYNCRTIMP utility::string_t __cdecl utility::conversions::to_string_t ( const std::string &  s)

Converts to a platform dependent Unicode string type.

Parameters
sA single byte character UTF-8 string.
Returns
A platform dependent string type.
_ASYNCRTIMP utility::string_t __cdecl utility::conversions::to_string_t ( const utf16string &  s)

Converts to a platform dependent Unicode string type.

Parameters
sA two byte character UTF-16 string.
Returns
A platform dependent string type.
_ASYNCRTIMP utf16string __cdecl utility::conversions::to_utf16string ( const std::string &  value)

Converts to a UTF-16 from string.

Parameters
valueA single byte character UTF-8 string.
Returns
A two byte character UTF-16 string.
_ASYNCRTIMP utf16string __cdecl utility::conversions::to_utf16string ( utf16string  value)

Converts to a UTF-16 from string.

Parameters
valueA two byte character UTF-16 string.
Returns
A two byte character UTF-16 string.
_ASYNCRTIMP std::string __cdecl utility::conversions::to_utf8string ( std::string  value)

Converts to a UTF-8 string.

Parameters
valueA single byte character UTF-8 string.
Returns
A single byte character UTF-8 string.
_ASYNCRTIMP std::string __cdecl utility::conversions::to_utf8string ( const utf16string &  value)

Converts to a UTF-8 string.

Parameters
valueA two byte character UTF-16 string.
Returns
A single byte character UTF-8 string.
_ASYNCRTIMP utf16string __cdecl utility::conversions::usascii_to_utf16 ( const std::string &  s)

Converts a ASCII (us-ascii) string to a UTF-16 string.

Parameters
sA single byte character us-ascii string.
Returns
A two byte character UTF-16 string.
_ASYNCRTIMP std::string __cdecl utility::conversions::utf16_to_utf8 ( const utf16string &  w)

Converts a UTF-16 string to a UTF-8 string.

Parameters
wA two byte character UTF-16 string.
Returns
A single byte character UTF-8 string.
_ASYNCRTIMP utf16string __cdecl utility::conversions::utf8_to_utf16 ( const std::string &  s)

Converts a UTF-8 string to a UTF-16

Parameters
sA single byte character UTF-8 string.
Returns
A two byte character UTF-16 string.