]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/file.h
Add no-throw destructors to exception classes that were lacking one
[libs/core.git] / source / io / file.h
index 4f8e5ddf8612b559f82ce5bfc7c2623ba5860cc9..90a1041ccda6520db5386b724f43fe6e936bfe85 100644 (file)
@@ -15,12 +15,14 @@ class file_not_found: public std::runtime_error
 {
 public:
        file_not_found(const std::string &fn): std::runtime_error(fn) { }
+       ~file_not_found() throw() { }
 };
 
 class file_already_exists: public std::runtime_error
 {
 public:
        file_already_exists(const std::string &fn): std::runtime_error(fn) { }
+       ~file_already_exists() throw() { }
 };
 
 
@@ -37,7 +39,9 @@ public:
                C_NONE = 0,
                C_CREATE = 1,
                C_TRUNCATE = 2,
-               C_EXCLUSIVE = 4
+               C_OVERWRITE = C_CREATE+C_TRUNCATE,
+               C_EXCLUSIVE = 4,
+               C_NEW = C_CREATE+C_EXCLUSIVE
        };
 
 private:
@@ -47,7 +51,7 @@ public:
        /** Creates a new file object and opens it.  If the create flag is set and
        write access is requested and the file does exist, it is created.  Otherwise
        a missing file is an error. */
-       File(const std::string &, Mode = M_READ, CreateMode = CreateMode(C_CREATE+C_TRUNCATE));
+       File(const std::string &, Mode = M_READ, CreateMode = C_OVERWRITE);
        virtual ~File();
 
        void set_block(bool);