chsvlib
chsv helper source code

◆ ConstructPlatformException() [2/4]

void ConstructPlatformException ( platform_code_t  nPlatformCode,
Exception::vararg_tag_t  ,
const CharType *restrict  pszDescription,
std::va_list  ap 
)
protectednoexcept

Constructs an exception with a given platform-specific error code and a description specified with respect to the Printf format specification rules and to tag specification rules.

Template Parameters
CharTypeis a type of the description to be set which is either char or wchar_t.
Parameters
[in]nPlatformCodeis an integral platform specific error code to be bound with the exception.
[in]apis a list of variable parameters specified with respect to the format string pointed to by the pszDescription parameter according to the Printf format specification rules.
[in]pszDescriptionis a pointer to a wide string specifying a format of the description to be associated with the exception object returning the description via what and What methods. The format is specified according to the Printf format specification rules. The result of the Printf formatting is analyzed for presence of tags within any angle brackets. If <CODE>, <DESCRIPTION>, <PLATFORM_CODE> or <PLATFORM_DESCRIPTION> is found in the string, the tags are respectively replaced by a hexadecimal value of the CHSVERROR_PLATFORM_ERROR, by a description corresponding to the <CHSVERROR_PLATFORM_ERROR>, by a hexadecimal value of nPlatformCode, and by corresponding description. Since the latter is not specified, the description will be a string stating that a description for the platform code is not available. If any other tags are met, the construction fails causing the description to be set to a default string stating that the description is not available. To specify angle brackets in the resulting description use doubled brackets, i.e. "<<" to specify a left angle bracket ("<") and ">>" to specify a right one (">").