diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-19 10:46:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-19 10:46:32 +0200 |
commit | 50e741126a0840179b86cf2302905e30dad6f75f (patch) | |
tree | bb12606ed4fbe5f7034a41c6b0ed00c26dfd0271 /cutl/fs/path.hxx | |
parent | 95cb46279d8bc2b8c5fa611bef50f138ebd20056 (diff) |
Add path string to the invalid_path exception
Diffstat (limited to 'cutl/fs/path.hxx')
-rw-r--r-- | cutl/fs/path.hxx | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/cutl/fs/path.hxx b/cutl/fs/path.hxx index f310d55..139a3cc 100644 --- a/cutl/fs/path.hxx +++ b/cutl/fs/path.hxx @@ -15,17 +15,44 @@ namespace cutl { namespace fs { - struct invalid_path: exception + template <typename C> + class basic_path; + + template <typename C> + class invalid_basic_path; + + typedef basic_path<char> path; + typedef invalid_basic_path<char> invalid_path; + + typedef basic_path<wchar_t> wpath; + typedef invalid_basic_path<wchar_t> invalid_wpath; + + // + // + struct invalid_path_base: exception { virtual char const* what () const throw (); }; template <typename C> - class basic_path; + struct invalid_basic_path: invalid_path_base + { + typedef std::basic_string<C> string_type; - typedef basic_path<char> path; - typedef basic_path<wchar_t> wpath; + invalid_basic_path (C const* p): path_ (p) {} + invalid_basic_path (string_type const& p): path_ (p) {} + ~invalid_basic_path () throw () {} + + string_type const& + path () const + { + return path_; + } + + private: + string_type path_; + }; template <typename C> class basic_path |