Public Member Functions

xl7::io::Resource Class Reference

#include <Resource.h>

Inheritance diagram for xl7::io::Resource:
xl7::io::IRom

List of all members.

Public Member Functions

 Resource (void)
 ~Resource (void)
HMODULE GetModuleHandle () const
unsigned GetNameID () const
const cl7::string_typeGetType () const
const cl7::string_typeGetName () const
bool IsOpen () const
unsigned GetSize () const
unsigned GetPointer () const
unsigned SetPointer (unsigned pointer)
bool Open (HMODULE module_handle, unsigned name_id, const cl7::string_type &type)
bool Open ()
bool Close ()
unsigned Read (void *buffer, unsigned bytes)
unsigned Seek (signed bytes, const SeekFlags from=current)

Detailed Description

The class to read data from a resource.


Constructor & Destructor Documentation

xl7::io::Resource::Resource ( void   ) 

Default constructor.

xl7::io::Resource::~Resource ( void   ) 

Destructor.


Member Function Documentation

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

Closes the resource.

Implements xl7::io::IRom.

HMODULE xl7::io::Resource::GetModuleHandle (  )  const [inline]

Returns the handle to the module whose binary file contains the resource.

const cl7::string_type& xl7::io::Resource::GetName (  )  const [inline]

Returns the name of the (open) resource.

unsigned xl7::io::Resource::GetNameID (  )  const [inline]

Returns the integer identifier of the name of the resource.

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

Returns the current byte position to read data.

Implements xl7::io::IRom.

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

Returns the size of the resource, in bytes.

Implements xl7::io::IRom.

const cl7::string_type& xl7::io::Resource::GetType (  )  const [inline]

Returns the type of the resource.

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

Checks whether the resource is open.

Implements xl7::io::IRom.

bool xl7::io::Resource::Open ( HMODULE  module_handle,
unsigned  name_id,
const cl7::string_type type 
)

Opens the resource for reading.

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

Re-opens the resource for reading. Ensure that you have already opened the resource earlier (see Open).

Implements xl7::io::IRom.

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

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

Implements xl7::io::IRom.

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

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

Implements xl7::io::IRom.

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

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

Implements xl7::io::IRom.


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