Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
IoIntfCspReader Struct Reference

Detailed Description

The IoIntfCspReader, which implements the abstract CspReader interface, makes it possible to open a "CSP dat" file via a IoIntf.

#include <IoIntfCspReader.h>

Inheritance diagram for IoIntfCspReader:

Public Member Functions

 IoIntfCspReader ()
 Uninitialized storage; initialize before use or destruction. More...
 
 IoIntfCspReader (IoIntf *io, const char *pathName)
 The IoIntfCspReader constructor opens the CSP data file for reading. More...
 
 ~IoIntfCspReader ()
 Close an open file, ignoring the close status. More...
 
int close ()
 Close and consume the file handle, even if closing fails. 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...
 

Constructor & Destructor Documentation

◆ IoIntfCspReader() [1/2]

IoIntfCspReader::IoIntfCspReader ( )

Uninitialized storage; initialize before use or destruction.

◆ IoIntfCspReader() [2/2]

IoIntfCspReader::IoIntfCspReader ( IoIntf *  io,
const char *  pathName 
)

The IoIntfCspReader constructor opens the CSP data file for reading.

Parameters
ioBorrowed seekable I/O interface, valid until this reader closes.
pathNameRequired NUL-terminated path within io to the data file generated by httpLink; used during construction only. Check inherited CspReader::isValid before use. A stat/open failure leaves the reader invalid. Debug builds call baFatalE if the initial magic number cannot be read or does not match the CSP data format.

◆ ~IoIntfCspReader()

IoIntfCspReader::~IoIntfCspReader ( )

Close an open file, ignoring the close status.

Stop all users of this reader before destruction.

Member Function Documentation

◆ close()

int IoIntfCspReader::close ( )

Close and consume the file handle, even if closing fails.

Stop all reads first. The inherited isValid flag is not cleared; never use it to decide whether reading after close is safe.

Returns
Zero on success, the underlying negative close error, or -1 if the file is not open.