CppCommon  1.0.4.1
C++ Common Library
exceptions.h
Go to the documentation of this file.
1 
9 #ifndef CPPCOMMON_FILESYSTEM_EXCEPTIONS_H
10 #define CPPCOMMON_FILESYSTEM_EXCEPTIONS_H
11 
12 #include "errors/exceptions.h"
13 #include "filesystem/path.h"
14 
15 namespace CppCommon {
16 
19 {
20 public:
22 
24  const Path& path() const noexcept { return _path; }
25 
27  std::string string() const override;
28 
30 
34  { _path = path; return *this; }
36 
40  FileSystemException& Attach(const Path& src, const Path& dst)
41  { _src = src; _dst = dst; return *this; }
42 
43 protected:
50 };
51 
52 } // namespace CppCommon
53 
54 #endif // CPPCOMMON_FILESYSTEM_EXCEPTIONS_H
File system exception.
Definition: exceptions.h:19
const Path & path() const noexcept
Get exception path.
Definition: exceptions.h:24
FileSystemException & Attach(const Path &src, const Path &dst)
Attach the given source and destination paths to the exception.
Definition: exceptions.h:40
std::string string() const override
Get string from the current exception.
Definition: exceptions.cpp:13
Path _src
Filesystem exception source path.
Definition: exceptions.h:47
FileSystemException & Attach(const Path &path)
Attach the given path to the exception.
Definition: exceptions.h:33
Path _dst
Filesystem exception destination path.
Definition: exceptions.h:49
Path _path
Filesystem exception path.
Definition: exceptions.h:45
Filesystem path.
Definition: path.h:90
System exception.
Definition: exceptions.h:107
SystemException()
Create system exception based on the last system error code.
Definition: exceptions.h:110
Exceptions definition.
C++ Common project definitions.
Definition: token_bucket.h:15
Filesystem path definition.