chsvlib
chsv helper source code

◆ vsPrintfW()

int Chusov::String::vsPrintfW ( wchar_t *restrict  pDest,
std::size_t  cchDest,
const wchar_t *restrict  pszFormat,
va_list  ap 
)
noexcept

Loads the data from the given locations, converts it to wide string equivalents and writes the results to a string buffer.

Parameters
[out]pDestis a pointer to the output buffer where the converted string is to be written to.
[in]cchDestis a size of the output buffer, in wide characters, including the terminating zero. No more than that many wide characters are written to the buffer including the terminating zero which is always appended.
[in]pszFormatis a pointer to a zero terminated wide string defining how to interpret data, passed as additional parameters, during the construction of the output. See PrintfW for the definition of the format lexemes.
[in]apis a variable argument list containing data used to construct the output string according to the format.
Returns
On success the function returns a number of wide characters written to the buffer not counting the terminating zero. Thus if the resulting string is fully written to the buffer, the function returns a nonnegative value which is strictly less than cchDest. On the opposite if the buffer is of size that is enough to hold only a part of the string, cchDest is returned. If an error occurs the function returns a negative value.

The function implements the behaviour of the standard C vswprintf function with full accordance to ISO/IEC 9899:1999 (aka C99) and ISO/IEC 9899:2011 (aka C11) with some standard-compatible extensions specific to the chsvlib library. See PrintfW for the details.

See also
PrintfW;
vsPrintfA;
vsPrintfW_s.