Share via


wstring_convert::from_bytes

Converts a byte string to a wide string.

wide_string from_bytes(char _Byte);
wide_string from_bytes(const char* _Ptr);
wide_string from_bytes(const byte_string& _Bstr);
wide_string from_bytes(const char* _First, const char* _Last);

Parameters

Parameter

Description

_Byte

The single-element byte sequence to be converted.

_Ptr

The C-style, null-terminated sequence of characters to be converted.

_Bstr

The byte_string to be converted.

_First

The first character in a range of characters to be converted.

_Last

The last character in a range of characters to be converted.

Return Value

A wide string object resulting from the conversion.

Remarks

If the conversion state object was not constructed with an explicit value, it is set to its default value (the initial conversion state) before the conversion begins. Otherwise it is left unchanged.

The number of input elements successfully converted is stored in the conversion count object. If no conversion error occurs, the member function returns the converted wide string. Otherwise, if the object was constructed with an initializer for the wide-string error message, the member function returns the wide-string error message object. Otherwise, the member function throws an object of class range_error.

Requirements

Header: <cvt/wstring>

Namespace: stdext::cvt

See Also

Reference

wstring_convert Class