Public Member Functions | Static Public Member Functions

CdcRetrieveFile Class Reference

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>

List of all members.

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.

Detailed Description

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.

Author:
Erez Bibi
Version:
1.1

Definition at line 49 of file DcRetrieveFile.h.


Constructor & Destructor Documentation

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.

Parameters:
uThe URL, as a string
hThe host that is trying to get the file.
incTrue 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.


Member Function Documentation

CdcBuffer CdcRetrieveFile::GetData (  ) throw (CdcException)

This function reads a file, and builds a buffer (CdcBuffer) that contains the data in the file.

Returns:
(CdcBuffer) The buffer that holds the file data.
Exceptions:
(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.

Returns:
(CdcFileAttrib) Shallow copy of the file attributes object. This is a read only 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.


The documentation for this class was generated from the following files: