tbx  0.7.3
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
tbx::res::ResFile Class Reference

Load and give read only access to a resource file. More...

#include <resfile.h>

Classes

class  const_iterator
 Constant iterator of objects in this resource file. More...
 

Public Member Functions

bool load (const std::string &fname)
 Load a resource file.
 
bool contains (std::string name) const
 Returns true if the file contains the named object.
 
ResObject object (std::string name) const
 Get resource object with given name. More...
 
const_iterator begin () const
 Get constant iterator to first object. More...
 
const_iterator end () const
 Get constant iterator to end object. More...
 
const_iterator cbegin () const
 Get constant iterator to first object. More...
 
const_iterator cend () const
 Get constant iterator to end object. More...
 
const_iterator find (std::string name) const
 Find name in resource.
 

Protected Member Functions

int first_offset () const
 Return offset to first object in file.
 
int end_offset () const
 Offset of object after last object.
 
void next_object (int &offset) const
 Move to next object.
 
ResObject at_offset (int offset) const
 Return object at given offset.
 

Friends

class const_iterator
 

Detailed Description

Load and give read only access to a resource file.

ResObjects returned from this object are only valid as long as the ResFile object is in memory.

Member Function Documentation

const_iterator tbx::res::ResFile::begin ( ) const
inline

Get constant iterator to first object.

Returns
constant iterator to first object
const_iterator tbx::res::ResFile::cbegin ( ) const
inline

Get constant iterator to first object.

Returns
constant iterator to first object
const_iterator tbx::res::ResFile::cend ( ) const
inline

Get constant iterator to end object.

Returns
constant iterator to object after the last object
const_iterator tbx::res::ResFile::end ( ) const
inline

Get constant iterator to end object.

Returns
constant iterator to object after the last object
ResObject tbx::res::ResFile::object ( std::string  name) const

Get resource object with given name.

Exceptions
ResObjectNotFoundif object does not exist

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