1 // boost/filesystem/exception.hpp ------------------------------------------//
3 // Copyright © 2002 Beman Dawes
4 // Copyright © 2001 Dietmar Kühl
6 // Use, modification, and distribution is subject to the Boost Software
7 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
8 // at http://www.boost.org/LICENSE_1_0.txt)
10 // See library home page at http://www.boost.org/libs/filesystem
12 //----------------------------------------------------------------------------//
14 #ifndef BOOST_FILESYSTEM_EXCEPTION_HPP
15 #define BOOST_FILESYSTEM_EXCEPTION_HPP
17 #include <boost/filesystem/config.hpp>
18 #include <boost/filesystem/path.hpp>
22 #include <boost/shared_ptr.hpp>
24 #include <boost/config/abi_prefix.hpp> // must be the last header
26 //----------------------------------------------------------------------------//
34 BOOST_FILESYSTEM_DECL int system_error_code(); // artifact of POSIX and WINDOWS error reporting
40 system_error, // system generated error; if possible, is translated
41 // to one of the more specific errors below.
42 other_error, // library generated error
43 security_error, // includes access rights, permissions failures
49 busy_error, // implies trying again might succeed
59 class BOOST_FILESYSTEM_DECL filesystem_error : public std::exception
64 const std::string & who,
65 const std::string & message ); // assumed to be error_code::other_error
68 const std::string & who,
70 const std::string & message ); // assumed to be error_code::other_error
73 const std::string & who,
78 const std::string & who,
83 ~filesystem_error() throw();
85 virtual const char * what() const 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()
96 shared_ptr<m_imp> m_imp_ptr;
101 } // namespace filesystem
104 #include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
105 #endif // BOOST_FILESYSTEM_EXCEPTION_HPP