1 // boost/filesystem/exception.hpp ------------------------------------------//
3 // < ----------------------------------------------------------------------- >
4 // < Copyright © 2002 Beman Dawes >
5 // < Copyright © 2001 Dietmar Kühl, All Rights Reserved >
7 // < Permission to use, copy, modify, distribute and sell this >
8 // < software for any purpose is hereby granted without fee, provided >
9 // < that the above copyright notice appears in all copies and that >
10 // < both that copyright notice and this permission notice appear in >
11 // < supporting documentation. The authors make no representations about >
12 // < the suitability of this software for any purpose. It is provided >
13 // < "as is" without express or implied warranty. >
14 // < ----------------------------------------------------------------------- >
16 // See http://www.boost.org/libs/filesystem for documentation.
18 //----------------------------------------------------------------------------//
20 #ifndef BOOST_FILESYSTEM_EXCEPTION_HPP
21 #define BOOST_FILESYSTEM_EXCEPTION_HPP
23 #include <boost/filesystem/path.hpp>
28 //----------------------------------------------------------------------------//
36 int system_error_code(); // artifact of POSIX and WINDOWS error reporting
42 system_error, // system generated error; if possible, is translated
43 // to one of the more specific errors below.
44 other_error, // library generated error
45 security_error, // includes access rights, permissions failures
51 busy_error, // implies trying again might succeed
61 class filesystem_error : public std::runtime_error
66 const std::string & who,
67 const std::string & message ); // assumed to be error_code::other_error
70 const std::string & who,
72 const std::string & message ); // assumed to be error_code::other_error
75 const std::string & who,
80 const std::string & who,
85 ~filesystem_error() throw();
87 int native_error() const { return m_sys_err; }
88 // Note: a value of 0 implies a library (rather than system) error
89 error_code error() const { return m_err; }
90 const std::string & who() const; // name of who throwing exception
91 const path & path1() const; // argument 1 to who; may be empty()
92 const path & path2() const; // argument 2 to who; may be empty()
102 } // namespace filesystem
105 #endif // BOOST_FILESYSTEM_EXCEPTION_HPP