filesystem_error Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at filesystem_error Class.

A base class for all exceptions that are thrown to report a low-level system overflow.

class filesystem_error    : public system_error;  

The class serves as the base class for all exceptions thrown to report an error in <filesystem> functions. It stores an object of type string, called mymesg here for the purposes of exposition. It also stores two objects of type path, called mypval1 and mypval2.

filesystem_error(const string& what_arg,
    error_code ec);

filesystem_error(const string& what_arg,  
    const path& pval1,
    error_code ec);

filesystem_error(const string& what_arg,  
    const path& pval1,
    const path& pval2,
    error_code ec);

The first constructor constructs its message from what_arg and ec. The second constructor also constructs its message from pval1, which it stores in mypval1. The third constructor also constructs its message from pval1, which it stores in mypval1, and from pval2, which it stores in mypval2.

const path& path1() const noexcept;  

The member function returns mypval1

const path& path2() const noexcept;  

The member function returns mypval2

const char *what() const noexcept;  

The member function returns a pointer to an NTBS, preferably composed from runtime_error::what(), system_error::what(), mymesg, mypval1.native_string(), and mypval2.native_string().

Header: filesystem

Namespace: std::tr2::sys

Header Files Reference
system_error Class
<filesystem>
<exception>

Show: