DIDataResource Struct Reference
[Core]

#include <Interfaces.h>

Inherits 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 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).


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

Generated on Sun Aug 31 17:46:28 2008 for Digital Spaces by  doxygen 1.5.6