Document ThrowSystemError and ThrowWinError.

This commit is contained in:
Victor Zverovich 2014-05-14 07:05:09 -07:00
parent a59dc93764
commit 3303708e94
2 changed files with 17 additions and 6 deletions

View File

@ -50,6 +50,13 @@ Write API
.. _formatstrings: .. _formatstrings:
System Error Reporting
----------------------
.. doxygenfunction:: fmt::ThrowSystemError
.. doxygenfunction:: fmt::ThrowWinError
Format String Syntax Format String Syntax
-------------------- --------------------

View File

@ -1590,9 +1590,9 @@ class SystemErrorSink {
/** /**
\rst \rst
Formats a message and throws SystemError with the description of the form Formats a message and throws SystemError with the description of the form
"<message>: <system-message>", where <message> is the formatted message and "<message>: <system-message>", where *<message>* is the formatted message
<system-message> is the system message corresponding to the error code. and *<system-message>* is the system message corresponding to the error code.
error_code is a system error code as given by errno. *error_code* is a system error code as given by ``errno``.
\endrst \endrst
*/ */
inline Formatter<SystemErrorSink> ThrowSystemError( inline Formatter<SystemErrorSink> ThrowSystemError(
@ -1622,10 +1622,14 @@ class WinErrorSink {
}; };
/** /**
\rst
Formats a message and throws SystemError with the description of the form Formats a message and throws SystemError with the description of the form
"<message>: <system-message>", where <message> is the formatted message and "<message>: <system-message>", where *<message>* is the formatted message
<system-message> is the system message corresponding to the error code. and *<system-message>* is the system message corresponding to the error code.
error_code is a Windows error code as given by GetLastError. *error_code* is a Windows error code as given by ``GetLastError``.
This function is only available on Windows.
\endrst
*/ */
inline Formatter<WinErrorSink> ThrowWinError(int error_code, StringRef format) { inline Formatter<WinErrorSink> ThrowWinError(int error_code, StringRef format) {
Formatter<WinErrorSink> f(format, WinErrorSink(error_code)); Formatter<WinErrorSink> f(format, WinErrorSink(error_code));