Public Types | Public Member Functions

Tiny2D::File Class Reference

File handle. More...

#include <Tiny2D.h>

List of all members.

Public Types

enum  OpenMode { OpenMode_Read = 0, OpenMode_Write, OpenMode_COUNT }
 

File open modes.

More...

Public Member Functions

 File ()
 Constructs empty file handle.
 ~File ()
 Destructs file handle.
bool Open (const std::string &path, OpenMode openMode)
 Opens file at given path in given mode.
void Close ()
 Closes file.
int GetSize ()
 Gets opened file size (only valid after file has been successfully opened)
void Seek (int offset)
 Seeks to given offset within a file (relative to file beginning)
int GetOffset ()
 Gets current file offset.
bool Read (void *dst, int size)
 Reads 'size' number of bytes from file into 'dst' buffer; returns true on success.
bool Write (const void *src, int size)
 Writes 'size' number of bytes from 'src' buffer to file; returns true on success.

Detailed Description

File handle.


Member Enumeration Documentation

File open modes.

Enumerator:
OpenMode_Read 

File is to be opened for reading only.

OpenMode_Write 

File is to be opened for writing only.

OpenMode_COUNT 

Constructor & Destructor Documentation

Tiny2D::File::File (  )

Constructs empty file handle.

Tiny2D::File::~File (  )

Destructs file handle.


Member Function Documentation

void Tiny2D::File::Close (  )

Closes file.

int Tiny2D::File::GetOffset (  )

Gets current file offset.

int Tiny2D::File::GetSize (  )

Gets opened file size (only valid after file has been successfully opened)

bool Tiny2D::File::Open ( const std::string &  path,
OpenMode  openMode 
)

Opens file at given path in given mode.

bool Tiny2D::File::Read ( void *  dst,
int  size 
)

Reads 'size' number of bytes from file into 'dst' buffer; returns true on success.

void Tiny2D::File::Seek ( int  offset )

Seeks to given offset within a file (relative to file beginning)

bool Tiny2D::File::Write ( const void *  src,
int  size 
)

Writes 'size' number of bytes from 'src' buffer to file; returns true on success.


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