diff options
author | 2016-07-09 00:13:18 +0200 | |
---|---|---|
committer | 2016-07-09 00:13:18 +0200 | |
commit | 011dbbe713a3faa07538c9c2130befdf7871e389 (patch) | |
tree | 4dd7150d527d6b6d6c2c7dd42e4b449953c305ec /src/lib/netlist/plib/palloc.h | |
parent | 3f58aa4548327df4a6223ed7bf84e614c2cb12e7 (diff) |
Moved two macros, added more RAII and improved exceptions. Fixed some
bugs in parser code. (nw)
Diffstat (limited to 'src/lib/netlist/plib/palloc.h')
-rw-r--r-- | src/lib/netlist/plib/palloc.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h index 5b734785145..cd21be0c91e 100644 --- a/src/lib/netlist/plib/palloc.h +++ b/src/lib/netlist/plib/palloc.h @@ -17,6 +17,7 @@ #include "pstring.h" namespace plib { + //============================================================ // exception base //============================================================ @@ -24,7 +25,7 @@ namespace plib { class pexception : public std::exception { public: - explicit pexception(const pstring text); + pexception(const pstring text); pexception(const pexception &e) : std::exception(e) { m_text = e.m_text; } virtual ~pexception() noexcept {} @@ -35,6 +36,42 @@ private: pstring m_text; }; +class file_e : public plib::pexception +{ +public: + explicit file_e(const pstring fmt, const pstring &filename); +}; + +class file_open_e : public file_e +{ +public: + explicit file_open_e(const pstring &filename); +}; + +class file_read_e : public file_e +{ +public: + explicit file_read_e(const pstring &filename); +}; + +class file_write_e : public file_e +{ +public: + explicit file_write_e(const pstring &filename); +}; + +class null_argument_e : public plib::pexception +{ +public: + explicit null_argument_e(const pstring &argument); +}; + +class out_of_mem_e : public plib::pexception +{ +public: + explicit out_of_mem_e(const pstring &location); +}; + //============================================================ // Memory allocation //============================================================ |