Fix StrError, move Format*ErrorMessage to the implementation.

This commit is contained in:
Victor Zverovich
2014-04-30 11:20:41 -07:00
parent a1a84df7a4
commit 99e6112fda
3 changed files with 84 additions and 81 deletions

View File

@@ -490,20 +490,15 @@ class UTF16ToUTF8 {
#endif
// Portable thread-safe version of strerror.
// Returns a pointer to a string describing the error code. This can be
// either a pointer to a string stored in buffer, or a pointer to some
// static immutable string. Sets errno to one of the following values:
// Sets buffer to point to a string describing the error code.
// This can be either a pointer to a string stored in buffer,
// or a pointer to some static immutable string.
// Returns one of the following values:
// 0 - success
// ERANGE - buffer is not large enough to store the error message
// other - failure
// Buffer should be at least of size 1.
char *StrError(int error_code, char *buffer, std::size_t buffer_size);
// Formats a standard C library error message writing the output to out.
void FormatCErrorMessage(Writer &out, int error_code, StringRef message);
// Formats a system error message writing the output to out.
void FormatSystemErrorMessage(Writer &out, int error_code, StringRef message);
int StrError(int error_code, char *&buffer, std::size_t buffer_size);
} // namespace internal