EHS
ehs::File Class Reference

#include <File_UNX.h>

Inheritance diagram for ehs::File:
ehs::BaseFile ehs::BaseFile

Public Member Functions

 ~File () override
 
 File ()
 
 File (const Str_8 &filePath, const Mode mode, const Disposition disposition)
 
 File (File &&file) noexcept
 
 File (const File &file)
 
Fileoperator= (File &&file) noexcept
 
Fileoperator= (const File &file)
 
 operator const Byte * () const override
 
 operator Byte * () override
 
void Release () override
 
bool IsMapped () const override
 
UInt_64 MapSize () const override
 
void Map (const UInt_64 offset, const UInt_64 size) override
 
void Unmap () override
 
void FlushMap () override
 
UInt_64 Write (const Byte *const data, const UInt_64 size) override
 
UInt_64 Read (Byte *const buffer, const UInt_64 size) override
 
void Seek (UInt_64 index) override
 
void SeekBeginning () override
 
void SeekEnd () override
 
void Truncate (const UInt_64 size) override
 
UInt_64 Size () const override
 
bool IsValid () const override
 
 ~File () override
 
 File ()
 
 File (const Str_8 &filePath, const Mode mode, const Disposition disposition)
 
 File (File &&file) noexcept
 
 File (const File &file)
 
Fileoperator= (File &&file) noexcept
 
Fileoperator= (const File &file)
 
 operator const Byte * () const override
 
 operator Byte * () override
 
void Release () override
 
bool IsMapped () const override
 
UInt_64 MapSize () const override
 
void Map (const UInt_64 offset, const UInt_64 size) override
 
void Unmap () override
 
void FlushMap () override
 
UInt_64 Write (const Byte *const data, const UInt_64 size) override
 
UInt_64 Read (Byte *const buffer, const UInt_64 size) override
 
void Seek (UInt_64 index) override
 
void SeekBeginning () override
 
void SeekEnd () override
 
void Truncate (const UInt_64 size) override
 
UInt_64 Size () const override
 
bool IsValid () const override
 
- Public Member Functions inherited from ehs::BaseFile
virtual ~BaseFile ()=default
 Frees all native handles. More...
 
 BaseFile ()
 Default members initialization. More...
 
 BaseFile (const Str_8 &filePath, const Mode mode, const Disposition disposition)
 
 BaseFile (BaseFile &&file) noexcept
 
 BaseFile (const BaseFile &file)=default
 
BaseFileoperator= (BaseFile &&file) noexcept
 
BaseFileoperator= (const BaseFile &file)=default
 
virtual operator const Byte * () const =0
 
virtual operator Byte * ()=0
 
virtual void Release ()=0
 
virtual bool IsMapped () const =0
 
virtual UInt_64 MapSize () const =0
 
virtual void Map (const UInt_64 offset, const UInt_64 size)=0
 
virtual void Unmap ()=0
 
virtual void FlushMap ()=0
 
virtual UInt_64 Write (const Byte *const data, const UInt_64 size)=0
 
void WriteStr_32 (const Char_32 *const str, const UInt_64 size)
 
void WriteStr_32 (const Str_32 &str)
 
void WriteStr_16 (const Char_16 *const str, const UInt_64 size)
 
void WriteStr_16 (const Str_16 &str)
 
void WriteStr_8 (const Char_8 *const str, const UInt_64 size)
 
void WriteStr_8 (const Str_8 &str)
 
void WriteVector (const Vector< Byte, UInt_64 > &vec)
 
void WriteArray (const Array< Byte, UInt_64 > &arr)
 
void WriteSerializer_64 (const Serializer< UInt_64 > &ser)
 
void WriteSerializer_32 (const Serializer< UInt_32 > &ser)
 
virtual UInt_64 Read (Byte *const buffer, const UInt_64 size)=0
 
void ReadStr_32 (Char_32 *const buffer, UInt_64 &size)
 
Str_32 ReadStr_32 (const UInt_64 size)
 
void ReadStr_16 (Char_16 *const buffer, UInt_64 &size)
 
Str_16 ReadStr_16 (const UInt_64 size)
 
void ReadStr_8 (Char_8 *const buffer, UInt_64 &size)
 
Str_8 ReadStr_8 (const UInt_64 size)
 
Vector< Byte, UInt_64 > ReadVector (const UInt_64 size)
 
Array< Byte, UInt_64 > ReadArray (const UInt_64 size)
 
Serializer< UInt_64 > ReadSerializer_64 (const Endianness end, const UInt_64 size)
 
Serializer< UInt_32ReadSerializer_32 (const Endianness end, const UInt_32 size)
 
virtual void Seek (UInt_64 index)=0
 
virtual void SeekBeginning ()=0
 
virtual void SeekEnd ()=0
 
virtual void Truncate (const UInt_64 size)=0
 
virtual UInt_64 Size () const =0
 
Str_8 GetPath () const
 
Str_8 GetFullName () const
 
Str_8 GetName () const
 
Str_8 GetExtension () const
 
virtual bool IsValid () const =0
 

Static Public Member Functions

static void Rename_32 (const Str_32 &filePath, const Str_32 &newName)
 
static void Rename_16 (const Str_16 &filePath, const Str_16 &newName)
 
static void Rename_8 (const Str_8 &filePath, const Str_8 &newName)
 
static void Rename_32 (const Str_32 &filePath, const Str_32 &newName)
 
static void Rename_16 (const Str_16 &filePath, const Str_16 &newName)
 
static void Rename_8 (const Str_8 &filePath, const Str_8 &newName)
 
- Static Public Member Functions inherited from ehs::BaseFile
static void Rename_32 (const Str_32 &filePath, const Str_32 &newName)
 
static void Rename_16 (const Str_16 &filePath, const Str_16 &newName)
 
static void Rename_8 (const Str_8 &filePath, const Str_8 &newName)
 
static Str_32 ParseFullName_32 (const Str_32 &filePath)
 
static Str_16 ParseFullName_16 (const Str_16 &filePath)
 
static Str_8 ParseFullName_8 (const Str_8 &filePath)
 
static Str_32 ParseName_32 (const Str_32 &filePath)
 
static Str_16 ParseName_16 (const Str_16 &filePath)
 
static Str_8 ParseName_8 (const Str_8 &filePath)
 
static Str_32 ParseExt_32 (const Str_32 &filePath)
 
static Str_16 ParseExt_16 (const Str_16 &filePath)
 
static Str_8 ParseExt_8 (const Str_8 &filePath)
 

Additional Inherited Members

- Protected Attributes inherited from ehs::BaseFile
Str_8 path
 
Str_8 fullName
 
Str_8 name
 
Str_8 extension
 
Mode mode
 
Disposition disposition
 

Constructor & Destructor Documentation

◆ ~File() [1/2]

ehs::File::~File ( )
override

◆ File() [1/8]

ehs::File::File ( )

◆ File() [2/8]

ehs::File::File ( const Str_8 filePath,
const Mode  mode,
const Disposition  disposition 
)

◆ File() [3/8]

ehs::File::File ( File &&  file)
noexcept

◆ File() [4/8]

ehs::File::File ( const File file)

◆ ~File() [2/2]

ehs::File::~File ( )
override

◆ File() [5/8]

ehs::File::File ( )

◆ File() [6/8]

ehs::File::File ( const Str_8 filePath,
const Mode  mode,
const Disposition  disposition 
)

◆ File() [7/8]

ehs::File::File ( File &&  file)
noexcept

◆ File() [8/8]

ehs::File::File ( const File file)

Member Function Documentation

◆ FlushMap() [1/2]

void ehs::File::FlushMap ( )
overridevirtual

Implements ehs::BaseFile.

◆ FlushMap() [2/2]

void ehs::File::FlushMap ( )
overridevirtual

Implements ehs::BaseFile.

◆ IsMapped() [1/2]

bool ehs::File::IsMapped ( ) const
overridevirtual

Implements ehs::BaseFile.

◆ IsMapped() [2/2]

bool ehs::File::IsMapped ( ) const
overridevirtual

Implements ehs::BaseFile.

◆ IsValid() [1/2]

bool ehs::File::IsValid ( ) const
overridevirtual

Retrieves whether or not this object is valid.

Returns
The result.

Implements ehs::BaseFile.

◆ IsValid() [2/2]

bool ehs::File::IsValid ( ) const
overridevirtual

Retrieves whether or not this object is valid.

Returns
The result.

Implements ehs::BaseFile.

◆ Map() [1/2]

void ehs::File::Map ( const UInt_64  offset,
const UInt_64  size 
)
overridevirtual

Implements ehs::BaseFile.

◆ Map() [2/2]

void ehs::File::Map ( const UInt_64  offset,
const UInt_64  size 
)
overridevirtual

Implements ehs::BaseFile.

◆ MapSize() [1/2]

UInt_64 ehs::File::MapSize ( ) const
overridevirtual

Implements ehs::BaseFile.

◆ MapSize() [2/2]

UInt_64 ehs::File::MapSize ( ) const
overridevirtual

Implements ehs::BaseFile.

◆ operator Byte *() [1/2]

ehs::File::operator Byte * ( )
overridevirtual

Implements ehs::BaseFile.

◆ operator Byte *() [2/2]

ehs::File::operator Byte * ( )
overridevirtual

Implements ehs::BaseFile.

◆ operator const Byte *() [1/2]

ehs::File::operator const Byte * ( ) const
overridevirtual

Implements ehs::BaseFile.

◆ operator const Byte *() [2/2]

ehs::File::operator const Byte * ( ) const
overridevirtual

Implements ehs::BaseFile.

◆ operator=() [1/4]

File & ehs::File::operator= ( const File file)

◆ operator=() [2/4]

File & ehs::File::operator= ( const File file)

◆ operator=() [3/4]

File & ehs::File::operator= ( File &&  file)
noexcept

◆ operator=() [4/4]

File & ehs::File::operator= ( File &&  file)
noexcept

◆ Read() [1/2]

UInt_64 ehs::File::Read ( Byte *const  buffer,
const UInt_64  size 
)
overridevirtual

Reads data from the file as a C-style byte array.

Parameters
[out]bufferThe buffer to store the data read from the file.
[in]sizeThe size of the given buffer and how much data to read.

Implements ehs::BaseFile.

◆ Read() [2/2]

UInt_64 ehs::File::Read ( Byte *const  buffer,
const UInt_64  size 
)
overridevirtual

Reads data from the file as a C-style byte array.

Parameters
[out]bufferThe buffer to store the data read from the file.
[in]sizeThe size of the given buffer and how much data to read.

Implements ehs::BaseFile.

◆ Release() [1/2]

void ehs::File::Release ( )
overridevirtual

Uninitializes the native handle.

Parameters
[in]raiseLogWhether or not to raise a log if already uninitialized. Mostly for deconstructor.

Implements ehs::BaseFile.

◆ Release() [2/2]

void ehs::File::Release ( )
overridevirtual

Uninitializes the native handle.

Parameters
[in]raiseLogWhether or not to raise a log if already uninitialized. Mostly for deconstructor.

Implements ehs::BaseFile.

◆ Rename_16() [1/2]

void ehs::File::Rename_16 ( const Str_16 filePath,
const Str_16 newName 
)
static

◆ Rename_16() [2/2]

static void ehs::File::Rename_16 ( const Str_16 filePath,
const Str_16 newName 
)
static

◆ Rename_32() [1/2]

void ehs::File::Rename_32 ( const Str_32 filePath,
const Str_32 newName 
)
static

◆ Rename_32() [2/2]

static void ehs::File::Rename_32 ( const Str_32 filePath,
const Str_32 newName 
)
static

◆ Rename_8() [1/2]

void ehs::File::Rename_8 ( const Str_8 filePath,
const Str_8 newName 
)
static

◆ Rename_8() [2/2]

static void ehs::File::Rename_8 ( const Str_8 filePath,
const Str_8 newName 
)
static

◆ Seek() [1/2]

void ehs::File::Seek ( UInt_64  index)
overridevirtual

Implements ehs::BaseFile.

◆ Seek() [2/2]

void ehs::File::Seek ( UInt_64  index)
overridevirtual

Implements ehs::BaseFile.

◆ SeekBeginning() [1/2]

void ehs::File::SeekBeginning ( )
overridevirtual

Implements ehs::BaseFile.

◆ SeekBeginning() [2/2]

void ehs::File::SeekBeginning ( )
overridevirtual

Implements ehs::BaseFile.

◆ SeekEnd() [1/2]

void ehs::File::SeekEnd ( )
overridevirtual

Implements ehs::BaseFile.

◆ SeekEnd() [2/2]

void ehs::File::SeekEnd ( )
overridevirtual

Implements ehs::BaseFile.

◆ Size() [1/2]

UInt_64 ehs::File::Size ( ) const
overridevirtual

Retrieves the size of the file.

Returns
The result.

Implements ehs::BaseFile.

◆ Size() [2/2]

UInt_64 ehs::File::Size ( ) const
overridevirtual

Retrieves the size of the file.

Returns
The result.

Implements ehs::BaseFile.

◆ Truncate() [1/2]

void ehs::File::Truncate ( const UInt_64  size)
overridevirtual

Implements ehs::BaseFile.

◆ Truncate() [2/2]

void ehs::File::Truncate ( const UInt_64  size)
overridevirtual

Implements ehs::BaseFile.

◆ Unmap() [1/2]

void ehs::File::Unmap ( )
overridevirtual

Implements ehs::BaseFile.

◆ Unmap() [2/2]

void ehs::File::Unmap ( )
overridevirtual

Implements ehs::BaseFile.

◆ Write() [1/2]

UInt_64 ehs::File::Write ( const Byte *const  data,
const UInt_64  size 
)
overridevirtual

Writes a C-style byte array to the file.

Parameters
[in]dataThe C-style byte array to write to the file.
[in]sizeThe size of the given C-style byte array.

Implements ehs::BaseFile.

◆ Write() [2/2]

UInt_64 ehs::File::Write ( const Byte *const  data,
const UInt_64  size 
)
overridevirtual

Writes a C-style byte array to the file.

Parameters
[in]dataThe C-style byte array to write to the file.
[in]sizeThe size of the given C-style byte array.

Implements ehs::BaseFile.


The documentation for this class was generated from the following files: