chsvlib
chsv helper source code

◆ vsnPrintf_s()

int Chusov::String::vsnPrintf_s ( CHAR_TYPE *restrict  pDest,
rsize_t  cchDest,
const CHAR_TYPE *restrict  pszFormat,
va_list  ap 
)
noexcept

Resolves to vsnPrintfA_s or to vsnPrintfW_s depending on the template parameter.

Template Parameters
CHAR_TYPEis a template parameter specifying a type of strings the template specialization is to work with. That is CHAR_TYPE=char for multibyte strings in the current locale or CHAR_TYPE=wchar_t for wide strings. The corresponding functions, wrapped over by the template specializations, are vsnPrintfA_s and vsnPrintfW_s.
Parameters
[out]pDestis a pointer to the output buffer where the converted string is to be written to.
[in]cchDestis a size, in characters, of the output buffer.
[in]pszFormatis a pointer to a zero terminated string defining how to interpret data, passed as additional parameters, during the construction of the output.
[in]apis a variable argument list containing data used to construct an output string according to the format.
Returns
On success the function returns a number of characters that would have been written had cchDest been sufficiently large, not counting the terminating zero. If an error or a runtime constraint violation occurs the function returns a negative number setting the corresponding errno code.

See vsnPrintfA_s and vsnPrintfW_s for the details.