chsvlib
chsv helper source code

◆ PlatformException() [8/9]

PlatformException ( platform_code_t  nPlatformCode,
std::nullptr_t  ,
std::basic_string< CharType, traits_t, alloc_t >  strDescription 
)
noexcept

Constructs an exception object from a specified platform-specific error code, and a description format string. This is an overload of a constructor that receives a reference to a callable object specifying a mapping from a system error code to system defined description of the error. This form is supplied to provide an opportunity to specify a nullptr value as a callable object to discard calling the user defined callback.

Template Parameters
CharTypeis a type of a symbol of an std::basic_string object specifying the description.
traits_tis a type of wide char traits class used by the std::basic_string template instantiation specifying type of an input format string.
alloc_tis an allocator object used by the std::basic_string template instantiation describing a type of the format string.
Parameters
[in]nPlatformCodeis a platform-specific error code bound with the constructed exception object.
[in]strDescriptionis a C++ std::basic_string wide string object specifying the description. Compared to most other constructors of the class the current one does not perform the Printf formatting. However, the tag formatting will be performed causing the constructor to treat angle brackets specially and particularly replace the <CODE> and <DESCRIPTION> tags of the input with a hexadecimal representation of CHSVERROR_PLATFORM_ERROR and a corresponding description (see error handling for the details). Likewise, the <PLATFORM_CODE> and <PLATFORM_DESCRIPTION> will be replaced by a hexadecimal representation of nPlatformCode and by a message that is supposed to be produced by the system. Since this constructor overload does not provide way to pass an externally defined routine mapping the code to the string message, the substring replacing the <PLATFORM_DESCRIPTION> tag will say that the description will not have been specified.