chsvlib
chsv helper source code

◆ vsPrintf()

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

Resolves to vsPrintfA or to vsPrintfW 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 vsPrintfA and vsPrintfW. For the first case the function performs some additional checks equivalent to the ones performed by the vsPrintfW function.
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 characters, including the terminating zero. No more than that many characters are written to the buffer including the terminating zero which is always appended.
[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 the output string according to the format.
Returns
On success the function returns a number of characters written to the buffer not counting the terminating zero. If an error occurs the function returns a negative value.

See vsPrintfA and vsPrintfW for the details.