]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/except.h
Make sure all files have the correct header
[libs/core.git] / source / core / except.h
index fc6fcc6c69921f48205fea5434a9b8da5cb05671..bf7c526c378695d353098ef694311ff8231226cc 100644 (file)
@@ -19,6 +19,11 @@ Base class for all Msp exceptions.
 */
 class Exception: public std::exception
 {
+private:
+       std::string wot;
+       std::string wer;
+       Debug::Backtrace bt;
+
 public:
        Exception(const std::string &);
        ~Exception() throw() { }
@@ -27,11 +32,6 @@ public:
        Exception &at(const std::string &) throw();
        const char *where() const throw() { return wer.c_str(); }
        const Debug::Backtrace &get_backtrace() const throw() { return bt; }
-private:
-       std::string wot;
-       std::string wer;
-       Debug::Backtrace bt;
-
 };
 
 /**
@@ -48,13 +48,15 @@ Thrown when a lookup from a map fails.
 */
 class KeyError: public Exception
 {
+private:
+       std::string key;
+
 public:
        KeyError(const std::string &w_): Exception(w_) { }
        KeyError(const std::string &w_, const std::string &k);
-       const std::string &get_key() const { return key; }
        ~KeyError() throw() { }
-private:
-       std::string key;
+
+       const std::string &get_key() const { return key; }
 };
 
 /**
@@ -71,11 +73,12 @@ Thrown when the application is invoked with wrong parameters.
 */
 class UsageError: public Exception
 {
+private:
+       bool brief;
+
 public:
        UsageError(const std::string &r, bool b=true): Exception(r), brief(b) { }
        bool get_brief() const { return brief; }
-private:
-       bool brief;
 };
 
 /**
@@ -83,12 +86,14 @@ Thrown when a system call fails.
 */
 class SystemError: public Exception
 {
+private:
+       int err;
+
 public:
        SystemError(const std::string &, int);
        int get_error_code() const { return err; }
-private:
-       int err;
 
+private:
        static std::string build_what(const std::string &, int);
 };