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,
71
error_code ec = other_error );
74
const std::string & who,
79
const std::string & who,
84
~filesystem_error() throw();
86
virtual const char * what() const throw();
88
int native_error() const { return m_sys_err; }
89
// Note: a value of 0 implies a library (rather than system) error
90
error_code error() const { return m_err; }
91
const std::string & who() const; // name of who throwing exception
92
const path & path1() const; // argument 1 to who; may be empty()
93
const path & path2() const; // argument 2 to who; may be empty()
97
shared_ptr<m_imp> m_imp_ptr;
102
} // namespace filesystem
105
#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
106
#endif // BOOST_FILESYSTEM_EXCEPTION_HPP
1
// boost/filesystem/exception.hpp ----------------------------------------------------//
3
// Copyright Beman Dawes 2010
5
// Distributed under the Boost Software License, Version 1.0.
6
// See http://www.boost.org/LICENSE_1_0.txt
8
// Library home page: http://www.boost.org/libs/filesystem
10
//--------------------------------------------------------------------------------------//
12
#ifndef BOOST_FILESYSTEM_EXCEPTIONX_HPP
13
#define BOOST_FILESYSTEM_EXCEPTIONX_HPP
15
# if defined(BOOST_FILESYSTEM_VERSION) \
16
&& BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
17
# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
20
# if !defined(BOOST_FILESYSTEM_VERSION)
21
# define BOOST_FILESYSTEM_VERSION 2
24
#if BOOST_FILESYSTEM_VERSION == 2
25
# include <boost/filesystem/v2/exception.hpp>
28
# include <boost/filesystem/v3/exception.hpp>
32
#endif // BOOST_FILESYSTEM_EXCEPTIONX_HPP