Boost C++ Libraries

PrevUpHomeNext

Class filesystem_error

boost::filesystem::filesystem_error — Exception type used to report file system errors from library functions.

Synopsis

// In header: <boost/filesystem/exception.hpp>


class filesystem_error : public system_error {
public:

  // public member functions
  filesystem_error(const char *, system::error_code);
  filesystem_error(std::string const &, system::error_code);
  filesystem_error(const char *, path const &, system::error_code);
  filesystem_error(std::string const &, path const &, system::error_code);
  filesystem_error(const char *, path const &, path const &, 
                   system::error_code);
  filesystem_error(std::string const &, path const &, path const &, 
                   system::error_code);
  filesystem_error(filesystem_error const &);
  filesystem_error & operator=(filesystem_error const &);
  ~filesystem_error() noexcept;
  path const & path1() const noexcept;
  path const & path2() const noexcept;
  const char * what() const noexcept;
};

Description

filesystem_error public member functions

  1. filesystem_error(const char * what_arg, system::error_code ec);
    Constructs the exception.

    Parameters:

    what_arg

    The explanatory string.

    ec

    The error code.

    Postconditions:

    Expression Value
    runtime_error::what() A string containing what_arg.c_str()
    code() ec
    path1().empty() true
    path2().empty() true

  2. filesystem_error(std::string const & what_arg, system::error_code ec);
    Constructs the exception.

    Parameters:

    what_arg

    The explanatory string.

    ec

    The error code.

    Postconditions:

    Expression Value
    runtime_error::what() A string containing what_arg.c_str()
    code() ec
    path1().empty() true
    path2().empty() true

  3. filesystem_error(const char * what_arg, path const & path1_arg, 
                     system::error_code ec);
    Constructs the exception.

    Parameters:

    what_arg

    The explanatory string.

    path1_arg

    The first path.

    ec

    The error code.

    Postconditions:

    Expression Value
    runtime_error::what() A string containing what_arg.c_str()
    code() ec
    path1() Reference to stored copy of p1
    path2().empty() true

  4. filesystem_error(std::string const & what_arg, path const & path1_arg, 
                     system::error_code ec);
    Constructs the exception.

    Parameters:

    what_arg

    The explanatory string.

    path1_arg

    The first path.

    ec

    The error code.

    Postconditions:

    Expression Value
    runtime_error::what() A string containing what_arg.c_str()
    code() ec
    path1() Reference to stored copy of p1
    path2().empty() true

  5. filesystem_error(const char * what_arg, path const & path1_arg, 
                     path const & path2_arg, system::error_code ec);
    Constructs the exception.

    Parameters:

    what_arg

    The explanatory string.

    path1_arg

    The first path.

    path2_arg

    The second path.

    ec

    The error code.

    Postconditions:

    Expression Value
    runtime_error::what() A string containing what_arg.c_str()
    code() ec
    path1() Reference to stored copy of p1
    path2() Reference to stored copy of p2

  6. filesystem_error(std::string const & what_arg, path const & path1_arg, 
                     path const & path2_arg, system::error_code ec);
    Constructs the exception.

    Parameters:

    what_arg

    The explanatory string.

    path1_arg

    The first path.

    path2_arg

    The second path.

    ec

    The error code.

    Postconditions:

    Expression Value
    runtime_error::what() A string containing what_arg.c_str()
    code() ec
    path1() Reference to stored copy of p1
    path2() Reference to stored copy of p2

  7. filesystem_error(filesystem_error const & that);
    Copy constructor.

    Parameters:

    that

    Exception object to copy from.

  8. filesystem_error & operator=(filesystem_error const & that);
    Copy assignment operator.

    Parameters:

    that

    Exception object to copy from.

    Returns:

    *this.

  9. ~filesystem_error() noexcept;
    Destructor.
  10. path const & path1() const noexcept;

    Returns:

    Reference to copy of p1 stored by the constructor, or, if none, an empty path.

  11. path const & path2() const noexcept;

    Returns:

    Reference to copy of p2 stored by the constructor, or, if none, an empty path.

  12. const char * what() const noexcept;

    Returns:

    A string containing runtime_error::what(). The exact format is unspecified. The implementation may (but is not required to) include path1.native_string() if not empty, path2.native_string() if not empty, and system_error::what() strings in the returned string.


PrevUpHomeNext