OpenGUI::Resource Class Reference

#include <OpenGUI_Resource.h>

Inheritance diagram for OpenGUI::Resource:

OpenGUI::Resource_CStr List of all members.

Detailed Description

The generic resource container.

This version simply maintains a byte array of dynamic memory. If you need something fancier, just subclass this.


Public Member Functions

 Resource ()
 constructor
virtual ~Resource ()
 virtual destructor
virtual void setData (unsigned char *newData, size_t newSize)
 Sets this object's stored data to the given memory.
unsigned char * getData ()
 Returns a pointer to the held data, or 0 if there is no stored data.
virtual void setSize (size_t size)
 Sets the size of the data buffer. The current contents will be lost.
size_t getSize ()
 Returns the size of the held data in bytes.
void release ()
 frees the data held


Constructor & Destructor Documentation

OpenGUI::Resource::Resource (  )  [inline]

constructor

virtual OpenGUI::Resource::~Resource (  )  [inline, virtual]

virtual destructor


Member Function Documentation

unsigned char* OpenGUI::Resource::getData (  )  [inline]

Returns a pointer to the held data, or 0 if there is no stored data.

size_t OpenGUI::Resource::getSize (  )  [inline]

Returns the size of the held data in bytes.

void OpenGUI::Resource::release (  )  [inline]

frees the data held

virtual void OpenGUI::Resource::setData ( unsigned char *  newData,
size_t  newSize 
) [inline, virtual]

Sets this object's stored data to the given memory.

Parameters:
newData pointer to the data to store
newSize the size of the data given in bytes
Note:
The Resource objects takes ownership of the given memory so you no longer need to worry about freeing the buffer. (Read: Do not free the memory you pass to this function, or you will cause a crash when this object is destroyed. If you don't have the ability to ensure this buffer is never deallocated, make a copy of it and provide that instead.)

Reimplemented in OpenGUI::Resource_CStr.

virtual void OpenGUI::Resource::setSize ( size_t  size  )  [inline, virtual]

Sets the size of the data buffer. The current contents will be lost.

Reimplemented in OpenGUI::Resource_CStr.


The documentation for this class was generated from the following file:
Copyright © 2006 OpenGUI | OpenGUI.SF.net
Generated: Fri Jan 5 23:05:26 2007