|
Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
|
Example code that shows you how to write a CspReader driver object.
The Web-Server uses the CspReader driver object when requesting data from the "dat" file generated by CspLink.
This example code uses the file system for reading the "dat" file. The constructor opens the "dat" file and method "diskRead" uses the Posix function fseek for setting the file pointer to the requested offset position and function fread for reading the actual data.
#include <FileCspReader.h>

Public Member Functions | |
| FileCspReader (const char *pathName) | |
| The FileCspReader constructor opens the "dat" file for reading. More... | |
Public Member Functions inherited from CspReader | |
| bool | isValid () |
| int | read (void *data, U32 offset, U32 size, bool blockStart) |
| Invoke the installed CspReader_Read callback synchronously. More... | |
| void | setIsValid () |
| Mark the implementation initialized after opening/checking its data. More... | |
| FileCspReader::FileCspReader | ( | const char * | pathName | ) |
The FileCspReader constructor opens the "dat" file for reading.
You must call CspReader::isValid, which informs you if the constructor successfully opened the "data" file for reading.
| pathName | is the path and name to the "data" file. |