This class gets a URL string, and a Host string in it's Constructor, and retrieve the proper file for this request. More...
#include <DcRetrieveFile.h>
Public Member Functions | |
CdcRetrieveFile (const CdcString &u, const CdcString &h, bool inc=false) | |
Constructor - finds the file that should be returned by this URL, and gets it's system parameters. | |
virtual | ~CdcRetrieveFile () |
Destructor - Close file. | |
CdcFileAttrib | GetFileAttrib () const |
Return a copy of the file attributes object. | |
CdcBuffer | GetData () throw (CdcException) |
This function reads a file, and builds a buffer (CdcBuffer) that contains the data in the file. | |
Static Public Member Functions | |
static void | Init () |
Init is just for the File Cacher. |
This class gets a URL string, and a Host string in it's Constructor, and retrieve the proper file for this request.
Each host's files are in a different folder.
The user can get the data as a CdcBuffer by calling CdcRetrieveFile::GetData. The class opens the file just in this function.
To avoid exceptions, before asking for the file, the user should call CdcRetrieveFile::IsFileFound.
Definition at line 49 of file DcRetrieveFile.h.
CdcRetrieveFile::CdcRetrieveFile | ( | const CdcString & | u, |
const CdcString & | h, | ||
bool | inc = false |
||
) | [inline] |
Constructor - finds the file that should be returned by this URL, and gets it's system parameters.
It also finds the file type.
u | The URL, as a string |
h | The host that is trying to get the file. |
inc | True if this is an include file. |
Definition at line 70 of file DcRetrieveFile.h.
virtual CdcRetrieveFile::~CdcRetrieveFile | ( | ) | [inline, virtual] |
Destructor - Close file.
Definition at line 76 of file DcRetrieveFile.h.
CdcBuffer CdcRetrieveFile::GetData | ( | ) | throw (CdcException) |
This function reads a file, and builds a buffer (CdcBuffer) that contains the data in the file.
(CdcException) | FILE NOT FOUND if it cannot find the file under the root directory of the host. |
Definition at line 30 of file DcRetrieveFile.cpp.
CdcFileAttrib CdcRetrieveFile::GetFileAttrib | ( | ) | const [inline] |
Return a copy of the file attributes object.
Definition at line 85 of file DcRetrieveFile.h.
static void CdcRetrieveFile::Init | ( | ) | [inline, static] |
Init is just for the File Cacher.
Definition at line 100 of file DcRetrieveFile.h.