TF++, Miscellaneous classes and modules in C++:
fs.h
Go to the documentation of this file.
1 
35 // include guard
36 #ifndef TF_FS_H_VERSION
37 
38 #define TF_FS_H_VERSION \
39  "TF_FS_H V1.0 "
40 
41 #include<string>
42 #include<tfxx/error.h>
43 
62 namespace tfxx {
63 
64  namespace error {
65 
73  {
74  public:
78  FSException(const char* message,
79  const char* file,
80  const int& line,
81  const int& en);
83  virtual ~FSException() { }
85  virtual void report() const;
87  bool iserrno(const int& en) const { return (en==Merrno); }
88  private:
90  void fs_report() const;
92  int Merrno;
93  }; // class exception
94 
95  } // namespace error
96 
103  namespace fs {
104 
105  /*----------------------------------------------------------------------*/
106  // functions
107 
113  std::string dirname(const std::string& path);
114 
120  void mkdir(const std::string& path);
121 
127  void mkdirp(const std::string& path);
128 
129  } // namespace fs
130 
131 } // namespace tfxx
132 
133 #endif // TF_FS_H_VERSION (includeguard)
134 
135 /* ----- END OF fs.h ----- */
bool iserrno(const int &en) const
true, if exception reports error en
Definition: fs.h:87
std::string dirname(const std::string &path)
return path with its last non-slash component removed
Definition: dirname.cc:45
virtual ~FSException()
provide explicit virtual destructor
Definition: fs.h:83
exception class for file system utilities
Definition: fs.h:72
virtual void report() const
Screen report.
Definition: exception.cc:56
FSException(const char *message, const char *file, const int &line, const int &en)
Create with message, failed assertion, and code position.
Definition: exception.cc:46
void fs_report() const
my report
Definition: exception.cc:62
tfxx::error::Exception TBase
base class
Definition: fs.h:76
Base class for exceptions.
Definition: error.h:78
void mkdirp(const std::string &path)
create a directory with all parents
Definition: mkdirp.cc:44
void mkdir(const std::string &path)
create a directory
Definition: mkdir.cc:45
Namespace containing all code of library libtfxx.
int Merrno
error number
Definition: fs.h:92