NRE_File.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include <iostream>
13  #include <fstream>
14 
15  #include <Header/NRE_Utility.hpp>
16 
21  namespace NRE {
26  namespace IO {
27 
32  class File {
33  private: //Fields
34  Utility::String path;
36  public: // Methods
37  //## Constructor ##//
41  File() = default;
46  File(Utility::String const& p);
51  File(char const p[]);
52 
53  //## Copy-Constructor ##//
58  File(File const& f) = default;
59 
60  //## Move-Constructor ##//
65  File(File && f) = default;
66 
67  //## Deconstructor ##//
71  ~File() = default;
72 
73  //## Getter ##//
77  Utility::String const& getPath() const;
78 
79  //## Setter ##//
84  void setPath(Utility::String const& p);
85 
86  //## Methods ##//
91  bool exist() const;
92 
93  //## Assignment Operator ##//
99  File& operator =(File const& f) = default;
105  File& operator =(File && f) = default;
106 
107  //## Arithmetic Operator ##//
113  Utility::String operator +(Utility::String const& s) const;
118  File operator +(File const& f) const;
119 
120  //## Stream Operator ##//
125  Utility::String const& toString() const;
126 
127  };
128 
135  std::ostream& operator <<(std::ostream& stream, File const& o);
136  }
137  }
138 
139  #include "NRE_File.tpp"
Manage a file path and ensure that&#39;s the file exist before accessing it.
Definition: NRE_File.hpp:32
IO&#39;s API.
Utility::String operator+(Utility::String const &s) const
File()=default
Utility::String const & getPath() const
void setPath(Utility::String const &p)
~File()=default
Utility::String const & toString() const
bool exist() const
The NearlyRealEngine&#39;s global namespace.
File & operator=(File const &f)=default