CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
File.hpp
Go to the documentation of this file.
1 namespace CYB {
3  namespace API {
5  class File : public Interop::Allocatable, public Stream {
6  public:
8  enum class Method : byte {
9  ANY,
10  EXIST,
11  CREATE,
12  TRUNCATE,
13  };
14 
35  public:
43  virtual unsigned long long Size(void) const = 0;
45  virtual unsigned long long CursorPosition(void) const noexcept = 0;
46 
53  virtual const Path& GetPath(void) const noexcept = 0;
54 
61  virtual Method OpenMethod(void) const noexcept = 0;
62  };
63  };
64 };
66 CYB_SET_ALLOCATABLE_ID(File);
67 //! @endcond
unsigned char byte
It's a byte, 8 bits, etc...
Definition: Types.hpp:4
Method
The method of handling Files that already exist.
Definition: File.hpp:8
The File must not exist. It will be created.
Contains the basic File interface. Does not perform locking of any kind, be aware of possible race co...
Definition: File.hpp:5
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: Path.hpp:9
The File may or may not exist. It will be created if it doesn't. OpenMethod will be set to EXIST or C...
virtual const Path & GetPath(void) const noexcept=0
Get the Path indicating the current File.
The interface for streaming reads and writes.
Definition: Stream.hpp:7
virtual unsigned long long CursorPosition(void) const noexcept=0
Get the current position of the read/write cursor in the Stream. Equivalent of Seek(0, SeekLocation::CURSOR)
Any existing File will be overwritten and an empty file will be created.
Defines the base class for allocatable engine objects.
Definition: Allocatable.hpp:7
The File must exist.
Template for defining the types of parameters for engine object constructors with multiple arguments...
Definition: Constructor.hpp:11
virtual Method OpenMethod(void) const noexcept=0
Gets the opening method of the File. Will never be Method::ANY.
virtual unsigned long long Size(void) const =0
Get the current size of the File.