#ifndef __TYPES_H #define __TYPES_H #include #include #include #include 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 Strings; typedef set StringSet; /* Paths are just strings. */ typedef string Path; typedef list Paths; typedef set PathSet; typedef enum { lvlError, lvlInfo, lvlTalkative, lvlChatty, lvlDebug, lvlVomit } Verbosity; } #endif /* !__TYPES_H */