blob: 513aae0392bc88c0b90391787e027a4630cc5147 (
plain) (
blame)
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
68
69
70
71
72
|
#ifndef __TYPES_H
#define __TYPES_H
#include <string>
#include <list>
#include <set>
#include <boost/format.hpp>
namespace nix {
/* Inherit some names from other namespaces for convenience. */
using std::string;
using std::list;
using std::set;
using std::vector;
using boost::format;
class Error : public std::exception
{
protected:
string err;
public:
Error(const format & f);
~Error() throw () { };
const char * what() const throw () { return err.c_str(); }
const string & msg() const throw () { return err; }
Error & addPrefix(const format & f);
};
class SysError : public Error
{
public:
int errNo;
SysError(const format & f);
};
#define MakeError(newClass, superClass) \
class newClass : public superClass \
{ \
public: \
newClass(const format & f) : superClass(f) { }; \
};
typedef list<string> Strings;
typedef set<string> StringSet;
/* Paths are just strings. */
typedef string Path;
typedef list<Path> Paths;
typedef set<Path> PathSet;
typedef enum {
lvlError,
lvlInfo,
lvlTalkative,
lvlChatty,
lvlDebug,
lvlVomit
} Verbosity;
}
#endif /* !__TYPES_H */
|