CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CYBFile.hpp
Go to the documentation of this file.
1 namespace CYB {
3  namespace Platform {
4  namespace System {
6  class File : private Implementation::File, public API::File {
7  public:
11  private:
17  void Close(void) const noexcept;
18  public:
28  static void Touch(System::Path&& APath);
38  static unsigned long long Size(const System::Path& APath);
39 
55  File(const API::Path& APath, const Mode AMode, const Method AMethod);
70  File(CYB::Platform::System::Path&& APath, const CYB::API::File::Mode AMode, const CYB::API::File::Method AMethod);
72  File(const File&) = delete;
74  File(File&& AMove) noexcept = default;
76  File& operator=(File&& AMove) noexcept;
78  ~File() final override;
79 
81  void Capabilities(Mode& AMode, bool& ASeek) const noexcept final override;
82 
84  unsigned long long Size(void) const final override;
86  unsigned long long CursorPosition(void) const noexcept final override;
88  unsigned long long Seek(const long long AOffset, const SeekLocation ALocation) const final override;
89 
91  unsigned long long Read(void* const ABuffer, const unsigned long long AMaxAmount) const final override;
93  unsigned long long Write(const void* const ABuffer, const unsigned long long AAmount) final override;
94 
96  const API::Path& GetPath(void) const noexcept final override;
98  Method OpenMethod(void) const noexcept final override;
99  };
100  };
101  };
102 };
static void Touch(System::Path &&APath)
Equivalent to the statement File(APath, Mode::WRITE, Method::ANY);. Opens/creates a File and updates ...
Definition: CYBFile.cpp:44
unsigned long long Read(void *const ABuffer, const unsigned long long AMaxAmount) const finaloverride
Read data from a Stream at the current cursor position and advance the cursor by that amount...
Method
The method of handling Files that already exist.
Definition: File.hpp:8
System::Path FPath
The Path indicating this File.
Definition: CYBFile.hpp:8
Method OpenMethod(void) const noexceptfinaloverride
Gets the opening method of the File. Will never be Method::ANY.
Definition: CYBFile.cpp:65
Mode
The available operations for the Stream. Bitset.
Definition: Stream.hpp:10
unsigned long long Size(void) const finaloverride
Get the current size of the File.
Contains the basic File interface. Does not perform locking of any kind, be aware of possible race co...
Definition: CYBFile.hpp:6
SeekLocation
The location to begin a seek operation at.
Definition: Stream.hpp:16
void Close(void) const noexcept
Closes the file's handle if it is valid.
Contains the basic File interface. Does not perform locking of any kind, be aware of possible race co...
Definition: File.hpp:5
Method FOpenMethod
The method used to open the file.
Definition: CYBFile.hpp:10
const API::Path & GetPath(void) const noexceptfinaloverride
Get the Path indicating the current File.
Definition: CYBFile.cpp:61
unsigned long long CursorPosition(void) const noexceptfinaloverride
Get the current position of the read/write cursor in the Stream. Equivalent of Seek(0, SeekLocation::CURSOR)
Definition: CYBFile.cpp:57
unsigned long long Seek(const long long AOffset, const SeekLocation ALocation) const finaloverride
Set the cursor position in the Stream.
Used for manipulating Paths. Paths will always exist either as a file or directory. Paths are '/' delimited when forming though may not be while retrieving. File names ".." will ascend a directory and '.' represents a no-op.
Definition: CYBPath.hpp:10
Strong typing for Platform::Identifier.
Mode FOpenMode
The method used to open the file.
Definition: CYBFile.hpp:9
unsigned long long Write(const void *const ABuffer, const unsigned long long AAmount) finaloverride
Write data to the Stream at the current cursor position and advance the cursor by that amount...
void Capabilities(Mode &AMode, bool &ASeek) const noexceptfinaloverride
Get the capabilities of the stream.
Definition: CYBFile.cpp:52