Public Member Functions

xl7::io::VirtualFile Class Reference

#include <VirtualFile.h>

Inheritance diagram for xl7::io::VirtualFile:
xl7::io::IFile xl7::io::IRom

List of all members.

Public Member Functions

 VirtualFile (void)
 ~VirtualFile (void)
bool IsOpen () const
OpenFlags GetOpenFlags () const
unsigned GetSize () const
bool SetSize (unsigned size)
unsigned GetPointer () const
unsigned SetPointer (unsigned pointer)
bool Init (File &file)
bool Init (File &file, const OpenFlags flags)
bool Init (BufferedFile &buffered_file)
bool Init (BufferedFile &buffered_file, const OpenFlags flags)
bool Init (void *buffer, unsigned bytes)
bool Init (void *buffer, unsigned bytes, const OpenFlags flags)
bool Open ()
bool Open (const OpenFlags flags)
bool Close ()
unsigned Read (void *buffer, unsigned bytes)
unsigned Write (const void *buffer, unsigned bytes)
unsigned Seek (signed bytes, const SeekFlags from=current)

Detailed Description

The class to create, read, and write data from or into (virtual) files in memory.


Constructor & Destructor Documentation

xl7::io::VirtualFile::VirtualFile ( void   ) 

Default constructor.

xl7::io::VirtualFile::~VirtualFile ( void   ) 

Destructor.


Member Function Documentation

bool xl7::io::VirtualFile::Close (  )  [virtual]

Closes the file.

Implements xl7::io::IRom.

OpenFlags xl7::io::VirtualFile::GetOpenFlags (  )  const [inline, virtual]

Returns the flags the file was opened with.

Implements xl7::io::IFile.

unsigned xl7::io::VirtualFile::GetPointer (  )  const [inline, virtual]

Returns the current byte position to read or write data.

Implements xl7::io::IRom.

unsigned xl7::io::VirtualFile::GetSize (  )  const [virtual]

Returns the size of the file, in bytes.

Implements xl7::io::IRom.

bool xl7::io::VirtualFile::Init ( File file,
const OpenFlags  flags 
)

Initializes and opens the virtual file for reading or writing. Therefore, the data of the given file in the file system is read into the memory buffer (unless flags contains the write flag but not the append flag).

bool xl7::io::VirtualFile::Init ( BufferedFile buffered_file  ) 

Initializes and opens the virtual file for reading. Therefore, the data of the given buffered file is read into the memory buffer.

bool xl7::io::VirtualFile::Init ( BufferedFile buffered_file,
const OpenFlags  flags 
)

Initializes and opens the virtual file for reading or writing. Therefore, the data of the given buffered file is read into the memory buffer (unless flags contains the write flag but not the append flag).

bool xl7::io::VirtualFile::Init ( void *  buffer,
unsigned  bytes 
)

Initializes and opens the virtual file for reading. Therefore, the data of the given buffer is read into the own memory buffer.

bool xl7::io::VirtualFile::Init ( void *  buffer,
unsigned  bytes,
const OpenFlags  flags 
)

Initializes and opens the virtual file for reading or writing. Therefore, the data of the given buffer is read into the own memory buffer (unless flags contains the write flag but not the append flag).

bool xl7::io::VirtualFile::Init ( File file  ) 

Initializes and opens the virtual file for reading. Therefore, the data of the given file in the file system is read into the memory buffer.

Initializes and opens the virtual file for reading. Therefore, the data of the given file in the file system is read into the memory buffer (unless flags contains the write flag but not the append flag).

bool xl7::io::VirtualFile::IsOpen (  )  const [inline, virtual]

Checks whether the file is open.

Implements xl7::io::IRom.

bool xl7::io::VirtualFile::Open ( const OpenFlags  flags  ) 

Opens the virtual file for reading or writing.

bool xl7::io::VirtualFile::Open (  )  [virtual]

Opens the virtual file for reading.

Implements xl7::io::IRom.

unsigned xl7::io::VirtualFile::Read ( void *  buffer,
unsigned  bytes 
) [virtual]

Reads data from the file and returns the number of bytes read.

Implements xl7::io::IRom.

unsigned xl7::io::VirtualFile::Seek ( signed  bytes,
const SeekFlags  from = current 
) [virtual]

Resets the current byte position to read or write data by moving the pointer by the specified bytes. The function returns the new position.

Implements xl7::io::IRom.

unsigned xl7::io::VirtualFile::SetPointer ( unsigned  pointer  )  [virtual]

Resets the current byte position to read or write data. The function returns the new position.

Resets the current position to read or write data. The function returns the new position.

Implements xl7::io::IRom.

bool xl7::io::VirtualFile::SetSize ( unsigned  size  )  [virtual]

Sets the size of the file, in bytes. Truncates or appends the difference in bytes.

Implements xl7::io::IFile.

unsigned xl7::io::VirtualFile::Write ( const void *  buffer,
unsigned  bytes 
) [virtual]

Writes data to the file and returns the number of bytes written.

Implements xl7::io::IFile.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines