chsvlib
chsv helper source code

◆ snPrintfW()

int Chusov::String::snPrintfW ( wchar_t *restrict  pDest,
std::size_t  cchDest,
const wchar_t *restrict  pszFormat,
  ... 
)
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. A size, in wide characters, of the buffer is specified by cchDest.
[in]cchDestis a size, in wide characters, of the output buffer. If cchDest is zero, pDest may be a null pointer. At most \((cchDest - 1)\) characters of the formatted string are written to the output buffer. A zero terminator is always appended to the end of the output string.
[in]pszFormatis a pointer to a zero terminated 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.
...constitute an optional set of additional parameters to build the formatted output according to pszFormat.
Returns
On success the function returns a number of wide characters that would have been written had cchDest been sufficiently large, not counting the terminating zero. If an error occurs the function returns a negative number setting the corresponding errno code. Thus an output string has been completely written to the output buffer if and only if the function returns a nonnegative number strictly less than cchDest.

The function is a chsvlib extension providing functionality which is a wide equivalent of the snPrintfA function which, in turn, implements the behaviour of the standard C snprintf 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;
snPrintfA;
snPrintfW_s.