diff options
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r-- | src/libutil/util.hh | 59 |
1 files changed, 5 insertions, 54 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 125ba2695..b4a61ae04 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -1,58 +1,15 @@ #ifndef __UTIL_H #define __UTIL_H -#include <string> -#include <list> -#include <set> -#include <sstream> +#include "types.hh" #include <sys/types.h> #include <dirent.h> #include <unistd.h> #include <signal.h> -#include <boost/format.hpp> -using namespace std; -using namespace boost; - - -class Error : public 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: - SysError(const format & f); -}; - -#define MakeError(newClass, superClass) \ - class newClass : public superClass \ - { \ - public: \ - newClass(const format & f) : superClass(f) { }; \ - }; - -MakeError(UsageError, Error) - - -typedef list<string> Strings; -typedef set<string> StringSet; - - -/* Paths are just strings. */ -typedef string Path; -typedef list<Path> Paths; -typedef set<Path> PathSet; +namespace nix { /* Return an environment variable. */ @@ -138,15 +95,6 @@ typedef enum { ltFlat /* no nesting */ } LogType; -typedef enum { - lvlError, - lvlInfo, - lvlTalkative, - lvlChatty, - lvlDebug, - lvlVomit -} Verbosity; - extern LogType logType; extern Verbosity verbosity; /* suppress msgs > this */ @@ -307,5 +255,8 @@ struct SwitchToOriginalUser ~SwitchToOriginalUser(); }; + +} + #endif /* !__UTIL_H */ |