Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

MimeManager Class Reference

List of all members.

Public Member Functions

void clean ()
int getMIME (int id, string &ext, string &dest, string &dest2)
int getMIME (string &ext, string &dest, string &dest2)
int getMIME (int id, char *ext, char *dest, char **dest2)
int getMIME (char *ext, char *dest, char **dest2)
u_long getNumMIMELoaded ()
MimeRecordgetRecord (string const &ext)
int isLoaded ()
int loadXML (string &filename)
int loadXML (const char *filename)
 MimeManager ()
int saveXML (string &filename)
int saveXML (const char *filename)
 ~MimeManager ()

Protected Member Functions

int addRecord (MimeRecord &record)
const char * getFilename ()
void removeAllRecords ()
void removeRecord (const string &ext)

Private Attributes

HashMap< string, MimeRecord * > * data
string * filename
int loaded
u_long numMimeTypesLoaded
ReadWriteLock rwLock

Constructor & Destructor Documentation

MimeManager::MimeManager  ) 
 

Constructor of the class.

MimeManager::~MimeManager  ) 
 

Destroy the object.


Member Function Documentation

int MimeManager::addRecord MimeRecord mr  )  [protected]
 

Add a new record. Returns zero on success.

void MimeManager::clean  ) 
 

Clean the memory allocated by the structure.

const char * MimeManager::getFilename  )  [protected]
 

Get the name of the file opened by the class.

int MimeManager::getMIME int  id,
string &  ext,
string &  dest,
string &  dest2
 

Get a MIME type by the position of the record in the list.

int MimeManager::getMIME string &  ext,
string &  dest,
string &  dest2
 

This function returns the type of action to do for handle this file type. Passing a file extension ext this function fills the strings dest and dest2 respectly with the MIME type description and if there are the path to the CGI manager.

int MimeManager::getMIME int  id,
char *  ext,
char *  dest,
char **  dest2
 

Get a MIME type by the position of the record in the list.

int MimeManager::getMIME char *  ext,
char *  dest,
char **  dest2
 

This function returns the type of action to do for handle this file type. Passing a file extension ext this function fills the strings dest and dest2 respectly with the MIME type description and if there are the path to the CGI manager.

u_long MimeManager::getNumMIMELoaded  ) 
 

Returns the number of MIME types loaded.

MimeRecord * MimeManager::getRecord string const &  ext  ) 
 

Get a pointer to an existing record passing its extension.

int MimeManager::isLoaded  ) 
 

Check if the MIME manager is loaded.

int MimeManager::loadXML string &  filename  ) 
 

int MimeManager::loadXML const char *  fn  ) 
 

Load the MIME types from a XML file. Returns the number of MIME types loaded successfully.

void MimeManager::removeAllRecords  )  [protected]
 

Remove all records from the linked list.

void MimeManager::removeRecord const string &  ext  )  [protected]
 

Remove a record by the extension of the MIME type.

int MimeManager::saveXML string &  filename  ) 
 

int MimeManager::saveXML const char *  filename  ) 
 

Save the MIME types to a XML file.


Member Data Documentation

HashMap<string, MimeRecord*>* MimeManager::data [private]
 

string* MimeManager::filename [private]
 

int MimeManager::loaded [private]
 

u_long MimeManager::numMimeTypesLoaded [private]
 

ReadWriteLock MimeManager::rwLock [private]
 


Generated on Thu May 1 12:41:03 2008 for MyServer by  doxygen 1.3.9.1