Repository navigation
Expand file tree
/
Copy pathexception.cpp
More file actions
67 lines (60 loc) · 2.84 KB
/
Copy pathexception.cpp
File metadata and controls
67 lines (60 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdexcept>
#include "exception.hh"
using std::ostream;
using std::string;
const string& error_code::macro(int errnum)
{
static const string macro[] = {
"SUCCESS",
"EPERM", "ENOENT", "ESRCH", "EINTR",
"EIO", "ENXIO", "E2BIG", "ENOEXEC",
"EBADF", "ECHILD", "EAGAIN", "ENOMEM",
"EACCES", "EFAULT", "ENOTBLK", "EBUSY",
"EEXIST", "EXDEV", "ENODEV", "ENOTDIR",
"EISDIR", "EINVAL", "ENFILE", "EMFILE",
"ENOTTY", "ETXTBSY", "EFBIG", "ENOSPC",
"ESPIPE", "EROFS", "EMLINK", "EPIPE",
"EDOM", "ERANGE", "EDEADLK", "ENAMETOOLONG",
"ENOLCK", "ENOSYS", "ENOTEMPTY", "ELOOP",
"?", "ENOMSG", "EIDRM", "ECHRNG",
"EL2NSYNC", "EL3HLT", "EL3RST", "ELNRNG",
"EUNATCH", "ENOCSI", "EL2HLT", "EBADE",
"EBADR", "EXFULL", "ENOANO", "EBADRQC",
"EBADSLT", "?", "EBFONT", "ENOSTR",
"ENODATA", "ETIME", "ENOSR", "ENONET",
"ENOPKG", "EREMOTE", "ENOLINK", "EADV",
"ESRMNT", "ECOMM", "EPROTO", "EMULTIHOP",
"EDOTDOT", "EBADMSG", "EOVERFLOW", "ENOTUNIQ",
"EBADFD", "EREMCHG", "ELIBACC", "ELIBBAD",
"ELIBSCN", "ELIBMAX", "ELIBEXEC", "EILSEQ",
"ERESTART", "ESTRPIPE", "EUSERS", "ENOTSOCK",
"EDESTADDRREQ", "EMSGSIZE", "EPROTOTYPE", "ENOPROTOOPT",
"EPROTONOSUPPORT", "ESOCKTNOSUPPORT", "EOPNOTSUPP", "EPFNOSUPPORT",
"EAFNOSUPPORT", "EADDRINUSE", "EADDRNOTAVAIL", "ENETDOWN",
"ENETUNREACH", "ENETRESET", "ECONNABORTED", "ECONNRESET",
"ENOBUFS", "EISCONN", "ENOTCONN", "ESHUTDOWN",
"ETOOMANYREFS", "ETIMEDOUT", "ECONNREFUSED", "EHOSTDOWN",
"EHOSTUNREACH", "EALREADY", "EINPROGRESS", "ESTALE",
"EUCLEAN", "ENOTNAM", "ENAVAIL", "EISNAM",
"EREMOTEIO", "EDQUOT", "ENOMEDIUM", "EMEDIUMTYPE",
"ECANCELED", "ENOKEY", "EKEYEXPIRED", "EKEYREVOKED",
"EKEYREJECTED", "EOWNERDEAD", "ENOTRECOVERABLE" };
return macro[errnum];
}
error_code::error_code(int errnum) : errnum(errnum) {}
error_code::operator int (void) const
{
return errnum;
}
error_code::operator const string& (void) const
{
return macro(errnum);
}
ostream& operator << (ostream& stream, const error_code& error)
{
return stream << error.macro(error.errnum);
}
const string& error_code::macro(void) const
{
return error_code::macro(errnum);
}