Dataflow Runtime API  3.0.3.0
Public Member Functions | List of all members
imt::base::os::winec7::OSFile Class Reference

Encapsulates a file. More...

#include <Imt.Base.OS.WinEC7/OSFile.h>

Public Member Functions

 OSFile (const std::wstring &fileName)
 Constructor. More...
 
virtual ~OSFile (void)
 Destructor. More...
 
const std::wstring & getName (void) const
 Gets the name of the file. More...
 
bool create (void) const
 Creates a file. More...
 
bool removeFile (void) const
 Deletes a file. More...
 
bool exists (void) const
 Checks if a file exists. More...
 
uint32_t size (void) const
 Returns the file size. More...
 
bool read (uint8_t buffer[], const uint32_t bufferSize, const uint32_t readOffset) const
 Reads data from the OSFile into buffer. More...
 
bool write (const uint8_t buffer[], const uint32_t bufferSize)
 Writes data from the buffer into the OSFile, overwriting any existing data. More...
 

Detailed Description

Encapsulates a file.

Constructor & Destructor Documentation

◆ OSFile()

imt::base::os::winec7::OSFile::OSFile ( const std::wstring &  fileName)
explicit

Constructor.

◆ ~OSFile()

virtual imt::base::os::winec7::OSFile::~OSFile ( void  )
virtual

Destructor.

Member Function Documentation

◆ create()

bool imt::base::os::winec7::OSFile::create ( void  ) const

Creates a file.

Returns
true on success, false if failed.

◆ exists()

bool imt::base::os::winec7::OSFile::exists ( void  ) const

Checks if a file exists.

Returns
true if exists, false otherwise

◆ getName()

const std::wstring& imt::base::os::winec7::OSFile::getName ( void  ) const

Gets the name of the file.

Returns
the file name passed to the constructor

◆ read()

bool imt::base::os::winec7::OSFile::read ( uint8_t  buffer[],
const uint32_t  bufferSize,
const uint32_t  readOffset 
) const

Reads data from the OSFile into buffer.

Parameters
buffer[]read buffer
bufferSizeread buffer size
readOffsetis incremented on a successful read
Returns
whether or not the operation was successful

◆ removeFile()

bool imt::base::os::winec7::OSFile::removeFile ( void  ) const

Deletes a file.

Returns
true on success, false if failed.

◆ size()

uint32_t imt::base::os::winec7::OSFile::size ( void  ) const

Returns the file size.

Returns
file size

◆ write()

bool imt::base::os::winec7::OSFile::write ( const uint8_t  buffer[],
const uint32_t  bufferSize 
)

Writes data from the buffer into the OSFile, overwriting any existing data.

Parameters
buffer[]write buffer
bufferSizewrite buffer size
Returns
whether or not the operation was successful

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