DigitalSpaces::DIDataResource Struct Reference
[Core]

#include <Interfaces.h>

Inherits DigitalSpaces::DIObjectBase.


Detailed Description

An interface that abstracts any source of data, such as a local file or an online URL.

See also:
DIDataResourceManager

Public Member Functions

unsigned int GetCharacters (char *buffer, unsigned int buffersize)
 Retreive up to buffersize of characters into the target buffer.
unsigned long GetResourceSize ()
 Returns the size (in bytes) of the data resource.
unsigned long GetPosition ()
 Returns the current position (in bytes) that GetCharacters will return data from.
bool SeekResource (unsigned long position)
 Alters the current position (in bytes) that GetCharacters will return data from.

Member Function Documentation

unsigned int DigitalSpaces::DIDataResource::GetCharacters ( char *  buffer,
unsigned int  buffersize 
)

Retreive up to buffersize of characters into the target buffer.

Depending on the implementation and the state of the current resource, the number returned from GetCharacters may not be the full size of the buffer. However it will return at least 1 character. If 0 is returned, there is no longer any data available at all. Implementations of this interface that are streaming the data resource should halt until at least one character is available, as returning 0 will indicate no more data is available.

Parameters:
[out] buffer A contiguous buffer of memory
buffersize The size of the buffer available at buffer.
Returns:
The number of characters put into the buffer. If this returns 0, then an error occured (such as end of file).

unsigned long DigitalSpaces::DIDataResource::GetResourceSize (  ) 

Returns the size (in bytes) of the data resource.

unsigned long DigitalSpaces::DIDataResource::GetPosition (  ) 

Returns the current position (in bytes) that GetCharacters will return data from.

This will be between 0 and the resource size, as returned by GetResourceSize.

bool DigitalSpaces::DIDataResource::SeekResource ( unsigned long  position  ) 

Alters the current position (in bytes) that GetCharacters will return data from.

Parameters:
position The position in the resource to return data from. This is an absolute address, specifically, is is the 0 based index, and not relative to the current position at all.
Returns:
True if the specified position was valid, false otherwise.


The documentation for this struct was generated from the following file:

Generated on Fri Aug 22 18:12:10 2008 for Digital Spaces by  doxygen 1.5.6