chsvlib
chsv helper source code

Functions and classes for transcoding of strings. More...

Collaboration diagram for Text encoding:

Classes

class  u8_ch_data
 Holds attributes, including Unicode code point, of a one multi-byte UTF-8 character with the read_u8_char_data function. More...
 
struct  u8_array_from_ucp< ucp >
 A class template which for a given Unicode code point statically defines a constant array holding the corresponding UTF-8 code. More...
 
struct  ucp_literal_type< N >
 Implements a string literal of Unicode 11.0 code points. More...
 
struct  from_chars_result< CharType >
 A type of the return value of the from_chars family of functions. More...
 

Macros

#define UTF8_MAX_LEN   4
 A number of bytes occupied by the longest UTF-8 code point.
 
#define INVALID_UNICODE_CODE_POINT   ((RESOLVE_NAMESPACE(Chusov::String) ucp_t) -1)
 A special invalid Unicode 11.0 code point.
 
#define UCP_LITERAL(str)   unspecified
 Resolves to a constexpr zero-terminated array of ucp_t elements given a classic char-based C string literal. More...
 

Typedefs

typedef unsigned int ucp_t
 An type of a Unicode code point. It is an unsigned integral type capable for storing at least 4 bytes.
 
typedef std::basic_string< ucp_t, std::char_traits< ucp_t >, std::allocator< ucp_t > > ucp_string
 Implements a C++ string object with characters of type ucp_t encoding Unicode 11.0 code points. More...
 
typedef std::basic_string< ucp_t, ci_char_traits< ucp_t > > ci_ucp_string
 Implements a C++ case-independent string object with characters of type ucp_t encoding Unicode 11.0 code points. More...
 
typedef std::basic_string_view< ucp_t, std::char_traits< ucp_t > > ucp_string_view
 Implements a C++ string view object with characters of type ucp_t encoding Unicode 11.0 code points. More...
 
typedef std::basic_string_view< ucp_t, ci_char_traits< ucp_t > > ci_ucp_string_view
 Implements a case-independent C++ string view object with characters of type ucp_t encoding Unicode 11.0 code points. More...
 

Functions

std::size_t ByteLengthMBS (const char *pszString, std::size_t cchInput) noexcept
 Returns a number of bytes occupied by the cchInput multibyte symbols of a string. More...
 
std::size_t CharacterLengthMBS (const char *pszString, std::size_t cbInput) noexcept
 Returns a number of multibyte symbols that are specified by the cbInput bytes of the pszString encoded as defined by the current locale. More...
 
std::size_t ConvertWideToMBS (char *restrict pStringMB, std::size_t cbStringMB, const wchar_t *restrict pStringW, std::size_t *pcchStringW) noexcept
 Converts a wide string to a multibyte equivalent and returns a number of bytes occupied by the converted multibyte string using the current locale. More...
 
std::size_t ConvertMBSToWide (wchar_t *restrict pStringW, std::size_t cchStringW, const char *restrict pStringMB, std::size_t cbStringMB) noexcept
 Converts a multibyte string to its wide equivalent and returns a number of successfully converted characters using the current locale. More...
 
std::size_t ByteLengthUTF8 (const char *pUtf, std::size_t cchUtf) noexcept
 Returns a number of bytes occupied by the specified number of multibyte symbols of the string specified in the UTF-8 format. More...
 
std::size_t CharacterLengthUTF8 (const char *pszUtf, std::size_t cbUtf) noexcept
 Returns a number of multibyte symbols that are composed from the specified number of bytes of a string encoded in the UTF-8 format. More...
 
std::size_t ConvertUCSToUTF8 (char *restrict pUtf, std::size_t cbUtf, const wchar_t *restrict pUcs, std::size_t *pcchUcs) noexcept
 Converts a wide UCS2/UCS-4 string to its multibyte UTF-8 equivalent and returns a number of bytes occupied by the converted multibyte string independently on the current C locale. More...
 
std::size_t ConvertUTF8ToUCS (wchar_t *restrict pStringW, std::size_t cchStringW, const char *restrict pStringMB, std::size_t cbStringMB) noexcept
 Converts a multibyte UTF-8 string into its wide UCS-2 (or UCS-4) equivalent and returns a number of successfully converted characters independently on the current C locale. More...
 
constexpr ucp_t operator""_ucp (char ch) noexcept
 A unicode code point literal denotion. More...
 
std::size_t ucpsLen (const ucp_t *pszStr) noexcept
 Returns a size, in code points, of a zero terminated string of Unicode code points excluding the terminating zero. Implements the behaviour of the standard strlen function of the string.h header for the type ucp_t. More...
 
std::size_t ucpsnLen_s (const ucp_t *pszStr, std::size_t cchStr) noexcept
 Returns a size, in code points, of a string excluding the terminating zero, if any. The function behaves identically to the strnlen_s function of the ISO/IEC TR 24731-1 standard but is implemented for the type ucp_t. More...
 
ucp_tucpsCpy (ucp_t *restrict pDest, const ucp_t *restrict pszSrc) noexcept
 Performs a copying of a zero-terminated string of Unicode code points from a source buffer to a destination one. Behaves identically to the standard strcpy function but implemented for the type ucp_t. More...
 
errno_t ucpsCpy_s (ucp_t *restrict pDest, rsize_t cchDest, const ucp_t *restrict pszSrc) noexcept
 Copies a zero-terminated source string of Unicode code points, including a terminating null code, to a destination buffer of a specified size. More...
 
int ucpsCmp (const ucp_t *pszStr1, const ucp_t *pszStr2) noexcept
 Lexicographically compares two strings of Unicode code points. More...
 
int ucpsnCmp (const ucp_t *pszStr1, const ucp_t *pszStr2, std::size_t count) noexcept
 Lexicographically compares two strings of Unicode code points with explicitly defined maximum number of characters to read and compare. More...
 
long ucpstol (const ucp_t *restrict str, ucp_t **restrict str_end, int base) noexcept
 Converts a number withing a string to the type "long". More...
 
long long ucpstoll (const ucp_t *restrict str, ucp_t **restrict str_end, int base) noexcept
 Converts a number withing a string to the type "long long". More...
 
unsigned long ucpstoul (const ucp_t *restrict str, ucp_t **restrict str_end, int base) noexcept
 Converts a number withing a string to the type "unsigned long". More...
 
unsigned long long ucpstoull (const ucp_t *restrict str, ucp_t **restrict str_end, int base) noexcept
 Converts a number withing a string to the type "unsigned long long". More...
 
float ucpstof (const ucp_t *restrict str, ucp_t **restrict str_end) noexcept
 Converts a floating point number withing a string to the type "float". More...
 
double ucpstod (const ucp_t *restrict str, ucp_t **restrict str_end) noexcept
 Converts a floating point number withing a string to the type "double". More...
 
long double ucpstold (const ucp_t *restrict str, ucp_t **restrict str_end) noexcept
 Converts a floating point number withing a string to the type "long double". More...
 
int u8len (const char *pUtf, std::size_t cbUtf) noexcept
 Determines a number of bytes contained in a UTF-8 character. More...
 
bool u8check (const char *pUtf8, std::size_t cbUtf8) noexcept
 Verifies validity of a given UTF-8 code according to the Unicode 11.0 standard. More...
 
bool u8check_cp (ucp_t ucp) noexcept
 Verifies that the given Unicode code point is representable in UTF-8 format as specified by the Unicode 11.0 standard. More...
 
int ucptou8 (char *pUtf, ucp_t ucp) noexcept
 Determines the number of bytes needed to represent a Unicode 11.0 code point as a multibyte UTF-8 code and optionally performs the conversion and stores the resulting UTF-8 code in the specified buffer. More...
 
int u8toucp (ucp_t *restrict pUcp, const char *restrict pUtf, std::size_t cbUtf) noexcept
 Inspects at most the given number of bytes of a buffer to determine how many bytes must be read from it in order to successfully perform a conversion of one UTF-8 code to a single Unicode code point and optionally writes the resulting code point into a provided buffer. More...
 
std::size_t u8stoucps (ucp_t *restrict pUcp, const char *restrict pUtf, std::size_t cchChars) noexcept
 Converts a sequence of UTF-8 characters into a sequence of corresponding Unicode 11.0 code points and writes at most the specified number of codes of the resulting sequence to a buffer. More...
 
std::size_t ucpstou8s (char *restrict pUtf, const ucp_t *restrict pUcp, std::size_t cbUtf) noexcept
 Converts a sequence of Unicode 11.0 code points to a sequence of UTF-8 multibyte characters, and writes these characters into a buffer. More...
 
errno_t ucptou8_s (int *restrict pStatus, char *restrict pUtf, rsize_t cbUtf, ucp_t ucp) noexcept
 Securely converts a given Unicode 11.0 code point to its UTF-8 representation. More...
 
errno_t u8toucp_s (int *restrict pStatus, ucp_t *restrict pUcp, const char *restrict pUtf, rsize_t cbUtf) noexcept
 Securely converts one multibyte UTF-8 code to a Unicode 11.0 code point. More...
 
errno_t u8stoucps_s (std::size_t *restrict pcchConverted, ucp_t *restrict pUcp, rsize_t cchUcpMax, const char *restrict pszUtf, rsize_t cchUtf) noexcept
 Converts the specified sequence of UTF-8 characters into a sequence of corresponding unicode code points and, if the specified output buffer is given by a non-NULL pointer, stores at most the specified number of wide characters into the buffer terminating the output string by the zero code. More...
 
errno_t ucpstou8s_s (std::size_t *restrict pcbUtf, char *restrict pUtf, rsize_t cbUtfMax, const ucp_t *restrict pUcp, rsize_t cbMaxConvert) noexcept
 Converts the specified sequence of Unicode 11.0 code points into a sequence of corresponding UTF-8 multibyte characters, and, if the specified output buffer is given by a non-NULL pointer, stores the specified number of bytes, constituting the converted UTF-8 multibyte string, to the output buffer terminating it with a null character. More...
 
int u8towc (wchar_t *restrict pUcs, const char *restrict pUtf, std::size_t cbUtf) noexcept
 Inspects at most the given number of bytes of a buffer to determine how many bytes must be read from it in order to successfully perform a conversion of one UTF-8 code to a single wide character in UCS format and optionally writes the resulting wide character into a provided buffer. More...
 
int wctou8 (char *pUtf, wchar_t chUcs) noexcept
 Determines the number of bytes needed to represent a wide character, expected to be in UCS format, in the UTF-8 format. Optionally, the function stores the representation in a buffer provided by the caller. More...
 
std::size_t u8stowcs (wchar_t *restrict pUcs, const char *restrict pUtf, std::size_t cchChars) noexcept
 Converts the specified sequence of UTF-8 characters into a sequence of corresponding wide characters in the UCS format and writes at most the specified number of wide characters to a buffer. More...
 
std::size_t wcstou8s (char *restrict pUtf, const wchar_t *restrict pUcs, std::size_t cbUtf) noexcept
 Converts a sequence of wide characters, assumed to be in the UCS format, to a sequence of UTF-8 multibyte characters, and writes these characters into a buffer. More...
 
errno_t wctou8_s (int *restrict pStatus, char *restrict pUtf, rsize_t cbUtf, wchar_t chUcs) noexcept
 Securely converts a given wide character, assumed to be encoded in the UCS format, to its UTF-8 representation. More...
 
errno_t u8towc_s (int *restrict pStatus, wchar_t *restrict pUcs, const char *restrict pUtf, rsize_t cbUtf) noexcept
 Securely converts one multibyte UTF-8 code to a wide character assumed to be specified in the UCS format. More...
 
errno_t u8stowcs_s (std::size_t *restrict pcchConverted, wchar_t *restrict pUcs, rsize_t cchUcsMax, const char *restrict pszUtf, rsize_t cchUtf) noexcept
 Converts the specified sequence of UTF-8 characters into a sequence of corresponding UCS-2 (or UCS-4) wide characters and, if the specified output buffer is given by a non-NULL pointer, stores at most the specified number of wide characters into the specified array terminating the output string by a null wide character. More...
 
errno_t wcstou8s_s (std::size_t *restrict pcbUtf, char *restrict pUtf, rsize_t cbUtfMax, const wchar_t *restrict pUcs, rsize_t cbMaxConvert) noexcept
 Converts the specified sequence of UCS-encoded wide characters into a sequence of corresponding UTF-8 multibyte characters, and, if the specified output buffer is given by a non-NULL pointer, stores the specified number of bytes, constituting the converted UTF-8 multibyte string, to the output buffer terminating it with a null character. More...
 
ucp_t ucp_tolower (ucp_t ch) noexcept
 Returns a lowercase form of a given Unicode character. More...
 
ucp_t ucp_toupper (ucp_t ch) noexcept
 Returns an uppercase form of a given Unicode character. More...
 
int ucp_isascii (ucp_t ch) noexcept
 Returns a flag indicating whether the given character belongs to the ANSI ASCII code space. More...
 
int ucp_isblank_ascii (ucp_t ch) noexcept
 Checks whether a given character is a space or a horizontal tab. More...
 
int ucp_isspace_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a whitespace character in the ASCII code space. More...
 
int ucp_iscntrl_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a control character in the ASCII code space. More...
 
int ucp_isalpha_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is an alphabetic character in the ASCII code space. More...
 
int ucp_islower_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a lowercase alphabetic character in the ASCII code space. More...
 
int ucp_isupper_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is an uppercase alphabetic character in the ASCII code space. More...
 
int ucp_isdigit_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a digit character in the ASCII code space. More...
 
int ucp_isxdigit_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a hexadecimal digit in the ASCII code space. More...
 
int ucp_ispunct_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a punctuational character in the ASCII code space. More...
 
int ucp_isalnum_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is an alphanumeric character in the ASCII code space. More...
 
int ucp_isgraph_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character belongs to the ASCII code space and has a nonempty graphical representation, i.e. any printable character except for whitespace characters. More...
 
int ucp_isprint_ascii (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is an ASCII code that can be displayed on a graphical output device, i.e. space or any alphanumeric or punctuational character. More...
 
int ucp_isspace (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a whitespace character in the Unicode code space. More...
 
int ucp_iscntrl (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a control code in the Unicode code space. More...
 
int ucp_isalpha (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is an alphabetic character in the Unicode code space. More...
 
int ucp_islower (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a lowercase alphabetic character in the Unicode code space. More...
 
int ucp_isupper (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is an uppercase alphabetic character in the Unicode code space. More...
 
int ucp_isdigit (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a digit character in the Unicode code space. More...
 
int ucp_ispunct (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is a punctuation character in the Unicode code space. More...
 
int ucp_isalnum (ucp_t ch) noexcept
 Returns a flag that indicates whether a given character is an alphanumeric character in the Unicode code space. More...
 
int ucp_isgraph (ucp_t ch) noexcept
 Returns a flag that indicates whether a given Unicode character has a nonempty graphical representation, i.e. any printable character except for whitespace characters. More...
 
int ucp_isprint (ucp_t ch) noexcept
 Returns a flag that indicates whether a given Unicode character can be displayed on an output device. More...
 
constexpr bool u8_check (const char *pStr, std::size_t cbStr) noexcept
 Verifies the validity of a UTF-8 code and its byte size. More...
 
constexpr bool ucp_check (ucp_t ucp) noexcept
 Verifies the validity of a Unicode 11.0 code point. More...
 
template<bool throw_on_failure = true, class InputIteratorBegin , class InputIteratorEnd >
constexpr u8_ch_data read_u8_char_data (InputIteratorBegin begin, InputIteratorEnd end)
 Reads a UTF-8 character addressed by a pair of input iterators and returns a u8_ch_data object with information about it. . More...
 
template<bool throw_on_failure = true, class InputIterator >
CONSTEXPR_CPP14 u8_ch_data read_u8_char_data (InputIterator itSymbol, std::size_t cbSymbol=UTF8_MAX_LEN)
 Reads a UTF-8 character addressed by an input iterator and returns a u8_ch_data object with information about it. . More...
 
template<bool throw_on_failure = true, std::size_t N>
constexpr u8_ch_data read_u8_char_data (const char(&pSymbol)[N]) noexcept(!throw_on_failure)
 Reads a UTF-8 character specified by an array of byte characters and constructs a u8_ch_data object with information about it. More...
 
template<bool throw_on_failure = true, class InputIteratorBegin , class InputIteratorEnd >
constexpr std::pair< u8_ch_data, InputIterator > read_u8_char_data_and_advance (InputIteratorBegin begin, InputIteratorEnd end)
 Reads a UTF-8 character addressed by a pair of input iterators, advances the first one and returns a pair of a u8_ch_data object with information about the character together with the copy of the iterator advances as a result of the reading. . More...
 
template<bool throw_on_failure = true, class InputIterator >
constexpr std::pair< u8_ch_data, InputIterator > read_u8_char_data_and_advance (InputIterator itSymbol, std::size_t cbSymbol=UTF8_MAX_LEN)
 Reads a UTF-8 character addressed by an input iterator, advances it and returns a pair of a u8_ch_data object with information about the character together with the copy of the iterator after the reading. . More...
 
template<bool do_full_checks = true, bool throw_on_failure = true, class InputIterator >
constexpr std::size_t u8blen (InputIterator itSymbol, std::size_t cbSymbol=UTF8_MAX_LEN) noexcept(!throw_on_failure)
 Returns a byte length of a UTF-8 character addressed by an iterator. More...
 
template<bool do_full_checks = true, bool throw_on_failure = true, std::size_t N>
constexpr std::size_t u8blen (const char(&pSymbol)[N]) noexcept(!throw_on_failure)
 Returns a byte size of a UTF-8 character in the specified array of bytes. More...
 
template<bool do_full_checks = true, bool throw_on_failure = true>
constexpr std::size_t u8blen (ucp_t ucp) noexcept(!throw_on_failure)
 Returns the byte size of a UTF-8 representation of a given Unicode code point. More...
 
template<bool do_full_checks = true, bool throw_on_failure = true, class InputIterator >
constexpr ucp_t u8_to_ucp (InputIterator itSymbol, std::size_t cbSymbol=UTF8_MAX_LEN) noexcept(!throw_on_failure)
 Converts a UTF-8 code referenced by an iterator to a Unicode 11.0 code point. More...
 
template<bool do_full_checks = true, bool throw_on_failure = true, std::size_t N>
constexpr ucp_t u8_to_ucp (const char(&pSymbol)[N]) noexcept(!throw_on_failure)
 Converts a UTF-8 code read from an array of bytes to a Unicode 11.0 code point. More...
 
template<bool do_full_checks = true, bool throw_on_failure = true, class InputIterator >
constexpr std::pair< ucp_t, InputIterator > u8_to_ucp_advance (InputIterator itSymbol, std::size_t cbSymbol=UTF8_MAX_LEN) noexcept(!throw_on_failure)
 Converts a UTF-8 code referenced by an iterator to a Unicode 11.0 code point and returns it together with a copy of the iterator in the state immediately following the acquisition of the UTF-8 code. More...
 
template<bool do_full_checks = true, bool throw_on_failure = true, class OutputIterator >
constexpr OutputIterator ucp_to_u8 (OutputIterator it, ucp_t ucp) noexcept(!throw_on_failure)
 Converts a given Unicode 11.0 code point to a sequence of bytes representing the corresponding UTF-8 multi-byte character and writes the bytes to a given output iterator. More...
 
template<class CharTraits = std::char_traits<ucp_t>, class Allocator = std::allocator<ucp_t>, class InputIterator >
std::basic_string< ucp_t, CharTraits, Allocator > u8_decode_string (InputIterator it, std::size_t cbAvail)
 Produces a C++ string of Unicode 11.0 code points from bytes of UTF-8 encoded characters. More...
 
template<class CharTraits = std::char_traits<ucp_t>, class Allocator = std::allocator<ucp_t>, class CPtr >
std::basic_string< ucp_t, CharTraits, Allocator > u8_decode_string (CPtr &&pszUtf8)
 Produces a C++ string of Unicode 11.0 code points from bytes of a UTF-8 encoded zero-terminated string. More...
 
template<class CharTraits = std::char_traits<ucp_t>, class Allocator = std::allocator<ucp_t>, std::size_t N>
std::basic_string< ucp_t, CharTraits, Allocator > u8_decode_string (const char(&pUtf8)[N])
 Produces a C++ string of Unicode 11.0 code points from an array of bytes encoding a UTF-8 string. . More...
 
template<class CharTraitsTo = std::char_traits<ucp_t>, class AllocatorTo = std::allocator<ucp_t>, class Container >
std::basic_string< ucp_t, CharTraitsTo, AllocatorTo > u8_decode_string (const Container &str)
 Produces a C++ string of Unicode 11.0 code points from bytes of a C++ container with a UTF-8 encoded string. . More...
 
template<class CharTraitsTo , class AllocatorTo , class BasicStringType >
std::basic_string< ucp_t, CharTraitsTo, AllocatorTo > u8_decode_string (const BasicStringType &str)
 Produces a C++ string of Unicode 11.0 code points from a C++ UTF-8 encoded string with custom char-traits and allocator classes. . More...
 
template<class CharTraitsTo , class BasicStringType >
std::basic_string< ucp_t, CharTraitsTo, ReboundAllocator > u8_decode_string (const BasicStringType &str)
 Produces a C++ string of Unicode 11.0 code points from a C++ UTF-8 encoded string with a custom char-traits class. . More...
 
template<class BasicStringType >
std::basic_string< ucp_t, ReboundCharTraits, ReboundAllocator > u8_decode_string (const BasicStringType &str)
 Produces a C++ string of Unicode 11.0 code points from a C++ UTF-8 encoded string. . More...
 
template<class CharTraits = std::char_traits<char>, class Allocator = std::allocator<char>, class InputIterator >
std::basic_string< char, CharTraits, Allocator > u8_encode_string (InputIterator it, std::size_t count)
 Converts a given string of Unicode code points to its UTF-8 representation and returns the latter as a C++ string object. More...
 
template<class CharTraits = std::char_traits<char>, class Allocator = std::allocator<char>, class CPtr >
std::basic_string< char, CharTraits, Allocator > u8_encode_string (CPtr &&pszUcp)
 Converts a given zero-terminated string of Unicode code points to its UTF-8 representation and returns the latter as a C++ string object. More...
 
template<class CharTraits = std::char_traits<char>, class Allocator = std::allocator<char>, std::size_t N>
std::basic_string< char, CharTraits, Allocator > u8_encode_string (const ucp_t(&pUcp)[N])
 Converts a given array with a string of Unicode code points to the corresponding UTF-8 representation and returns the latter as a C++ string object. . More...
 
template<class CharTraitsTo = std::char_traits<char>, class AllocatorTo = std::allocator<char>, class Container >
std::basic_string< char, CharTraitsTo, AllocatorTo > u8_encode_string (const Container &str)
 Converts a given container with a sequence of Unicode code points to the corresponding UTF-8 representation and returns the latter as a C++ string object. . More...
 
template<class CharTraitsTo , class AllocatorTo , class BasicStringType >
std::basic_string< char, CharTraitsTo, AllocatorTo > u8_encode_string (const BasicStringType &str)
 Converts a given C++ string of Unicode code points to the corresponding UTF-8 representation as another C++ string object with custom char-traits policy and an allocator. . More...
 
template<class CharTraitsTo , class BasicStringType >
std::basic_string< char, CharTraitsTo, ReboundAllocator > u8_encode_string (const BasicStringType &str)
 Converts a given C++ string of Unicode code points to the corresponding UTF-8 representation as another C++ string object with a custom char-traits policy. . More...
 
template<class BasicStringType >
std::basic_string< char, ReboundCharTraits, ReboundAllocator > u8_encode_string (const BasicStringType &str)
 Converts a given C++ string of Unicode code points to the corresponding UTF-8 representation. . More...
 
ucp_string to_ucp_string (int value)
 Converts the specified numerical value to a Unicode string of the ucp_string type. More...
 
ucp_string to_ucp_string (long value)
 Converts the specified numerical value to a Unicode string of the ucp_string type. More...
 
ucp_string to_ucp_string (long long value)
 Converts the specified numerical value to a Unicode string of the ucp_string type. More...
 
ucp_string to_ucp_string (unsigned value)
 Converts the specified numerical value to a Unicode string of the ucp_string type. More...
 
ucp_string to_ucp_string (unsigned long value)
 Converts the specified numerical value to a Unicode string of the ucp_string type. More...
 
ucp_string to_ucp_string (unsigned long long value)
 Converts the specified numerical value to a Unicode string of the ucp_string type. More...
 
ucp_string to_ucp_string (double value)
 Converts the specified numerical value to a Unicode string of the ucp_string type. More...
 
ucp_string to_ucp_string (long double value)
 Converts the specified numerical value to a Unicode string of the ucp_string type. More...
 
ucp_string to_ucp_string (float value)
 Converts the specified numerical value to a Unicode string of the ucp_string type. More...
 
int stoi (const ucp_string &str, std::size_t *restrict pos=nullptr, int base=10)
 Converts a UCP string to int. More...
 
long stol (const ucp_string &str, std::size_t *restrict pos=nullptr, int base=10)
 Converts a UCP string to long. More...
 
long long stoll (const ucp_string &str, std::size_t *restrict pos=nullptr, int base=10)
 Converts a UCP string to long long. More...
 
unsigned long stoul (const ucp_string &str, std::size_t *restrict pos=nullptr, int base=10)
 Converts a UCP string to unsigned long. More...
 
unsigned long long stoull (const ucp_string &str, std::size_t *restrict pos=nullptr, int base=10)
 Converts a UCP string to unsigned long long. More...
 
template<class T >
from_string (const ucp_t *pszValue)
 A set of templates providing an interface to convert an argument specifying a C or C++ string to a value of a specified type. More...
 
template<class T >
from_string (const ucp_t *pszValue, int base=10)
 A set of templates providing an interface to convert an argument specifying a C or C++ string to a value of a specified type. This template is available (i.e. participates in overload resolution) when the type is integral. More...
 
template<class T , class CharT , class TraitsT , class AllocT >
from_string (const std::basic_string< CharT, TraitsT, AllocT > &strValue)
 A set of templates providing an interface to convert an argument specifying a C or C++ string to a value of a specified type. . More...
 
template<class T , class CharT , class TraitsT , class AllocT >
from_string (std::basic_string< CharT, TraitsT, AllocT > &&strValue)
 A set of templates providing an interface to convert an argument specifying a C or C++ string to a value of a specified type. . More...
 
template<class T , class CharT , class TraitsT , class AllocT >
from_string (const std::basic_string< CharT, TraitsT, AllocT > &strValue, int base=10)
 A set of templates providing an interface to convert an argument specifying a C or C++ string to a value of a specified type. This template is available (i.e. participates in overload resolution) when the type is integral. . More...
 

from_chars

A set of overloads and ancilliary components which implement C++17 std::from_chars using C++14 means.

enum class  chars_format { scientific = 1 , fixed = 2 , general , hex }
 An enumeration used to specify fromatting of the from_chars floating-point conversion function. More...
 
template<class CharType , class IntegralType >
from_chars_result< CharType > from_chars (const CharType *first, const CharType *last, IntegralType &value, int base=10) noexcept
 Converts a string representation of an integral value to the specified integral representation. More...
 
template<class CharType , class FloatingPointType >
from_chars_result< CharType > from_chars (const CharType *first, const CharType *last, FloatingPointType &value, chars_format fmt=chars_format::general) noexcept
 Converts a string representation of a floating-point value to the specified numeric representation. . More...
 

Detailed Description

Functions and classes for transcoding of strings.