C++ Library containing a lot of needful things: Stack Trace, Command Line Parser, Resource Handling, Configuration Files, Unix Command Execution, Directories, Regular Expressions, Tokenizer, Function Trace, Standard Extensions.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
994 B

/** @file
$Id$
$Date$
$Author$
@copy © Marc Wäckerlin
@license LGPL, see file <a href="license.html">COPYING</a>
$Log$
Revision 1.2 2005/02/18 15:53:07 marc
I'm so stupid, there's strerror for mapping errno to a string...
Revision 1.1 2005/02/08 12:30:22 marc
new in release 1.8.0
1 2 3 4 5 6 7 8
5678901234567890123456789012345678901234567890123456789012345678901234567890
*/
#include <mrw/errno.hpp>
#include <mrw/string.hpp>
#include <errno.h>
#include <string.h>
mrw::Errno::Errno() throw(): _errno(errno) {}
mrw::Errno::operator std::string() const throw(std::bad_exception) {
char error[1024];
return strerror_r(_errno, error, 1024) ? error : std::string("errno=")+_errno;
}
std::string mrw::Errno::string() const throw(std::bad_exception) {
char error[1024];
return strerror_r(_errno, error, 1024) ? error : std::string("errno=")+_errno;
}