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

Document Class Reference

#include <Document.h>

Collaboration diagram for Document:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Document ()
 Document (string doc_url, string routine)
 ~Document ()
string getDocumentUrl ()
string getDocumentFile ()
string getDocumentConversion ()
string getConversionLocation ()
string getFileLocation ()
void setFileLocation (string file_location)
void setConversionLocation (string conversion_location)

Private Member Functions

void setDocumentFile ()
void setDocumentConversion (string conversion_request)

Private Attributes

string url
string file
string conversion
string conLocation
string fileLocation

Constructor & Destructor Documentation

Document::Document  ) 
 

Definition at line 38 of file Document.cpp.

References conLocation, file, fileLocation, and url.

00039 {
00040     url = "0";
00041     file = "0";
00042     conLocation = "0";
00043     fileLocation = "0";
00044 }

Document::Document string  doc_url,
string  routine
 

Definition at line 58 of file Document.cpp.

References conLocation, fileLocation, setDocumentConversion(), setDocumentFile(), and url.

00059 {
00060     // setting url and file now.
00061     url = doc_url;
00062     setDocumentFile();
00063     setDocumentConversion(routine);
00064 
00065     // prepare fileLocation and conLocation for latter assignment.
00066     fileLocation = "0";
00067     conLocation = "0";
00068 }

Here is the call graph for this function:

Document::~Document  ) 
 

Definition at line 78 of file Document.cpp.

00079 {
00080     // cout << "Destroying Docuemnt object. << endl;
00081 }


Member Function Documentation

string Document::getConversionLocation  ) 
 

Definition at line 155 of file Document.cpp.

References conLocation.

Referenced by main(), and DocConversionTestSuite::testGetDocumentConLocation().

00156 {
00157     if (conLocation == "0")
00158     {
00159         cout << "Error: conLocation has not been initialized yet?" << endl;
00160         // return the NULL value for user.
00161         return conLocation;
00162     }
00163     else
00164     {
00165         // conLocation is initialized, return.
00166         return conLocation;
00167     }
00168 }

string Document::getDocumentConversion  ) 
 

Definition at line 132 of file Document.cpp.

References conversion.

Referenced by Broker::convertDocument(), main(), Server::requestConversion(), and DocConversionTestSuite::testGetDocumentConversion().

00133 {
00134     if (conversion == "0")
00135     {
00136         cout << "Error: conversion has not been initialized yet?" << endl;
00137         // return the NULL value for user.
00138         return conversion;
00139     }
00140     else
00141     {
00142         // conversion is initialized, return.
00143         return conversion;
00144     }
00145 }

string Document::getDocumentFile  ) 
 

Definition at line 108 of file Document.cpp.

References file, and url.

Referenced by Server::getFile(), main(), Server::requestConversion(), and DocConversionTestSuite::testGetDocumentFile().

00109 {
00110     if (file == "0")
00111     {
00112         cout << "Error: file not initialized yet?" << endl;
00113         // returning url instead to provide at least some sort of
00114         // file to the caller.
00115         return url;
00116     }
00117     else
00118     {
00119         // file is really only a file name.
00120         return file;
00121     }
00122 }

string Document::getDocumentUrl  ) 
 

Definition at line 91 of file Document.cpp.

References url.

Referenced by Server::getFile(), and DocConversionTestSuite::testGetDocumentUrl().

00092 {
00093     return url;
00094 }

string Document::getFileLocation  ) 
 

Definition at line 178 of file Document.cpp.

References fileLocation.

Referenced by Server::requestConversion(), and DocConversionTestSuite::testGetDocumentFileLocation().

00179 {
00180     return fileLocation;
00181 }

void Document::setConversionLocation string  conversion_location  ) 
 

Definition at line 233 of file Document.cpp.

References conLocation.

Referenced by Server::requestConversion(), and DocConversionTestSuite::testGetDocumentConLocation().

00234 {
00235     conLocation = conversion_location;
00236 }

void Document::setDocumentConversion string  conversion_request  )  [private]
 

Definition at line 218 of file Document.cpp.

References conversion.

Referenced by Document().

00219 {
00220     // set with passed parameter, no checking yet.
00221     conversion = conversion_request;
00222 }

void Document::setDocumentFile  )  [private]
 

Definition at line 193 of file Document.cpp.

References file, and url.

Referenced by Document().

00194 {
00195     // attempt to determine basename() with Linux system call.
00196     if ( basename( url.c_str() ) )
00197     {
00198         file = basename(url.c_str() );
00199         return;
00200     }
00201     else
00202     {
00203         cerr << "File name could not be determined with basename()." << endl;
00204         exit(1);
00205     }
00206 }

void Document::setFileLocation string  file_location  ) 
 

Definition at line 247 of file Document.cpp.

References fileLocation.

Referenced by Server::getFile(), Server::requestConversion(), and DocConversionTestSuite::testGetDocumentFileLocation().

00248 {
00249     fileLocation = file_location;
00250 }


Member Data Documentation

string Document::conLocation [private]
 

Definition at line 152 of file Document.h.

Referenced by Document(), getConversionLocation(), and setConversionLocation().

string Document::conversion [private]
 

Definition at line 151 of file Document.h.

Referenced by getDocumentConversion(), and setDocumentConversion().

string Document::file [private]
 

Definition at line 150 of file Document.h.

Referenced by Document(), getDocumentFile(), and setDocumentFile().

string Document::fileLocation [private]
 

Definition at line 153 of file Document.h.

Referenced by Document(), getFileLocation(), and setFileLocation().

string Document::url [private]
 

Definition at line 149 of file Document.h.

Referenced by Document(), getDocumentFile(), getDocumentUrl(), and setDocumentFile().


The documentation for this class was generated from the following files:
Generated on Thu Dec 4 14:39:22 2003 for docconversion.kdevelop by doxygen 1.3.4