Utility class implementing the IFile interface. More...

#include "murl_util_file.h"

Inheritance diagram for Murl::Util::File:

Public Member Functions

 File (const String &name, IEnums::FileAccessMode accessMode)
 Constructor taking the file name and access mode. More...
 
 ~File () override
 The destructor. More...
 
UInt64 GetPosition () override
 Implementation of IFile::GetPosition(). More...
 
void SetPosition (UInt64 position) override
 Implementation of IFile::SetPosition(). More...
 
UInt64 GetSize () override
 Implementation of IFile::GetSize(). More...
 
UInt64 Read (void *data, UInt64 byteSize) override
 Implementation of IFile::Read(void* data, UInt64 byteSize). More...
 
UInt64 Write (const void *data, UInt64 byteSize) override
 Implementation of IFile::Write(const void* data, UInt64 byteSize). More...
 
UInt64 Read (Data &data) override
 Implementation of IFile::Read(Data& data). More...
 
UInt64 Write (const ConstData &data) override
 Implementation of IFile::Write(const ConstData& data). More...
 
virtual Bool Open ()
 Open the file. More...
 
virtual Bool Close ()
 Close the file. More...
 
- Public Member Functions inherited from Murl::NonCopyable
 NonCopyable ()=default
 The default constructor.
 

Protected Attributes

String mName
 The file name storage.
 
IEnums::FileAccessMode mAccessMode
 The access mode storage.
 
System::File mFile
 The system file object.
 

Detailed Description

Utility class implementing the IFile interface.

Constructor & Destructor Documentation

◆ File()

Murl::Util::File::File ( const String name,
IEnums::FileAccessMode  accessMode 
)

Constructor taking the file name and access mode.

Parameters
nameThe file name.
accessModeThe access mode for opening the file.

◆ ~File()

Murl::Util::File::~File ( )
override

The destructor.

Close the file if open.

Member Function Documentation

◆ GetPosition()

UInt64 Murl::Util::File::GetPosition ( )
overridevirtual

Implementation of IFile::GetPosition().

Returns
The position of the file pointer in bytes.

Implements Murl::IFile.

◆ SetPosition()

void Murl::Util::File::SetPosition ( UInt64  position)
overridevirtual

Implementation of IFile::SetPosition().

Parameters
positionThe position of the file pointer in bytes.

Implements Murl::IFile.

◆ GetSize()

UInt64 Murl::Util::File::GetSize ( )
overridevirtual

Implementation of IFile::GetSize().

Returns
The size of the file in bytes.

Implements Murl::IFile.

◆ Read() [1/2]

UInt64 Murl::Util::File::Read ( void *  data,
UInt64  byteSize 
)
overridevirtual

Implementation of IFile::Read(void* data, UInt64 byteSize).

Parameters
dataThe memory pointer to read the file into.
byteSizeThe number of bytes to read.
Returns
The number of bytes read into the memory.

Implements Murl::IFile.

◆ Write() [1/2]

UInt64 Murl::Util::File::Write ( const void *  data,
UInt64  byteSize 
)
overridevirtual

Implementation of IFile::Write(const void* data, UInt64 byteSize).

Parameters
dataThe memory pointer to write into the file.
byteSizeThe number of bytes to write.
Returns
The number of bytes written into the file.

Implements Murl::IFile.

◆ Read() [2/2]

UInt64 Murl::Util::File::Read ( Data data)
overridevirtual

Implementation of IFile::Read(Data& data).

Parameters
dataThe data object to read the file into.
Returns
The number of bytes read into the data object.

Implements Murl::IFile.

◆ Write() [2/2]

UInt64 Murl::Util::File::Write ( const ConstData data)
overridevirtual

Implementation of IFile::Write(const ConstData& data).

Parameters
dataThe data object to write into the file.
Returns
The number of bytes written into the file.

Implements Murl::IFile.

◆ Open()

virtual Bool Murl::Util::File::Open ( )
virtual

Open the file.

Open with the name and access mode specified by the constructor.

Returns
true if successful.

◆ Close()

virtual Bool Murl::Util::File::Close ( )
virtual

Close the file.

Returns
true if successful.

The documentation for this class was generated from the following file:
  • murl_util_file.h


Copyright © 2011-2024 Spraylight GmbH.