chsvlib
chsv helper source code

◆ PlatformException() [3/9]

PlatformException ( platform_code_t  nPlatformCode,
Exception::vararg_tag_t  ,
const CharType *restrict  pszDescription,
std::va_list  ap 
)
noexcept

Constructs an exception object associated with the specified error code, which is specific to the platform as defined by the pltfrm_code_t class template parameter, and a user-defined description.

Template Parameters
CharTypeis a type of the description to be set which is either char or wchar_t.
Parameters
[in]nPlatformCodeis a numeric value of the platform error code to be associated with the created exception.
[in]apis a variable argument list used during creation of the description as specified by the pszDescription parameter according to the rules defined for the Chusov::String::Printf function. If pszDescription is NULL or points to an empty string, the parameter is ignored.
[in]pszDescriptionis an optional wide-string defining the format of the description to be associated with the error code. At first, the formatting is performed according to the rules defined for the Chusov::String::Printf function. The result of this operation is also processed to replace the tags in angle brackets with the corresponding text, as specified for the PlatformException class template.
If the parameter is NULL or points to an empty string, the generated description is of the "Underlying platform error \<PLATFORM_CODE\>" format.

In the description string the following tags are allowed:

Tag Replacement
<CODE>1 A numeric value of the CHSVERROR_PLATFORM_ERROR chsvlib error code.
<DESCRIPTION>1 A string specifying the description for the CHSVERROR_PLATFORM_ERROR chsvlib error code.
<PLATFORM_CODE> A wide string representation of the platform specific error code.
<PLATFORM_DESCRIPTION>2 A description for the given platform-specific error code.

1 Defined by the ExceptionWithGenericCode class template.
2 This constructor does not support specifying a function object which maps the platform-specific error code to the corresponding description. Therefore, the <PLATFORM_DESCRIPTION> tag (if any) is replaced by an unspecified string stating that the description is absent.