Globals Class Reference

This class is used to provide some configuration values, which will be read from a configuration-file (which is created on first run and filled with default-values, if not already existing). More...

#include <SemiGlobals.hpp>

List of all members.


Public Member Functions

 Globals ()
 default constructor

Static Public Member Functions

void initialize ()
 load all configuration values from file
string getCGIPath ()
char * getProxyComHost ()
int getProxyComPort ()
char * getConfigFilePath ()
char * getMoviesFileName ()
char * getAbsoluteImagesFilePath ()
char * getRelativeImagesFilePath ()
char * getMediaserverHttpHost ()
int getMediaserverHttpPort ()
char * getRelativeSDPFilePath ()
char * getAbsoluteSDPFilePath ()
uint getHoursToPreserveClosedSessions ()
uint getPRMaxWaitSecs ()
bool loadConfiguration (char *filename)
 load configuration from file
void readConfigValues (char *buffer)
 read configuration-fields from buffer
void loadDefaultConfiguration ()
 load default-configuration into map
void writeConfiguration (char *filename)
 write current configuration to file
void showCurrentConfiguration ()
 output current configuration to standard-out

Static Public Attributes

SemiDebug sdebug
 reference to debugging class

Detailed Description

This class is used to provide some configuration values, which will be read from a configuration-file (which is created on first run and filled with default-values, if not already existing).

Author:
Klaus Schoeffmann

Definition at line 412 of file SemiGlobals.hpp.


Member Function Documentation

char * Globals::getAbsoluteImagesFilePath  )  [static]
 

Returns:
absolute path of images used from semiserver
Definition at line 321 of file SemiGlobals.cpp.

References initialize().

Referenced by MovieListRequest::requestMovieList().

00322 { 00323 if (!initialized) initialize(); 00324 return config["AbsoluteImagesFilePath"]; 00325 }

char * Globals::getAbsoluteSDPFilePath  )  [static]
 

Returns:
absolute path where SDP files are/should be stored
Definition at line 349 of file SemiGlobals.cpp.

References initialize().

Referenced by Movie::getHTMLRepresentation(), and SessionList::writeHTMLRepresentation().

00350 { 00351 if (!initialized) initialize(); 00352 return config["AbsoluteSDPFilePath"]; 00353 }

string Globals::getCGIPath  )  [static]
 

Returns:
the CGI-Path to use
Definition at line 293 of file SemiGlobals.cpp.

References initialize().

00294 { 00295 if (!initialized) initialize(); 00296 return config["CGIPath"]; 00297 }

char * Globals::getConfigFilePath  )  [static]
 

Returns:
file-path of config-file
Definition at line 273 of file SemiGlobals.cpp.

Referenced by initialize().

00274 { 00275 char *dest = new char[100]; 00276 if (getenv("HOME") != NULL) { 00277 strcpy(dest, getenv("HOME")); 00278 strcat(dest, "/.semirc"); 00279 } else { 00280 strcpy(dest, "/.semirc"); 00281 } 00282 return dest; 00283 }

uint Globals::getHoursToPreserveClosedSessions  )  [static]
 

Returns:
number of hours, a closed session should be remained in the list of started sessions
Definition at line 362 of file SemiGlobals.cpp.

References initialize().

Referenced by ServerCommunication::sendSessionsToServer().

00363 { 00364 if (!initialized) initialize(); 00365 return atoi(config["HoursToPreserveClosedSessions"]); 00366 }

char * Globals::getMediaserverHttpHost  )  [static]
 

Returns:
host running the http-server of the mediaserver
Definition at line 335 of file SemiGlobals.cpp.

References initialize().

00336 { 00337 if (!initialized) initialize(); 00338 return config["MediaserverHttpHost"]; 00339 }

int Globals::getMediaserverHttpPort  )  [static]
 

Returns:
port running the http-server of the mediaserver
Definition at line 342 of file SemiGlobals.cpp.

References initialize().

00343 { 00344 if (!initialized) initialize(); 00345 return atoi(config["MediaserverHttpPort"]); 00346 }

char * Globals::getMoviesFileName  )  [static]
 

Returns:
filepath to movielist (which was requested from mediaserver)
Definition at line 314 of file SemiGlobals.cpp.

References initialize().

00315 { 00316 if (!initialized) initialize(); 00317 return config["MoviesFilePath"]; 00318 }

uint Globals::getPRMaxWaitSecs  )  [static]
 

Returns:
maximum number of seconds to wait for the response of a position request
Definition at line 368 of file SemiGlobals.cpp.

References initialize().

Referenced by SemiProxySession::requestClientTimeMs(), and SemiProxySession::requestServerTimeMs().

00369 { 00370 if (!initialized) initialize(); 00371 return atoi(config["PRMaxWaitSecs"]); 00372 }

char * Globals::getProxyComHost  )  [static]
 

Returns:
the host-address of the semiproxy (used from semiserver)
Definition at line 300 of file SemiGlobals.cpp.

References initialize().

00301 { 00302 if (!initialized) initialize(); 00303 return config["ProxyComHost"]; 00304 }

int Globals::getProxyComPort  )  [static]
 

Returns:
the port of the semiproxy (used from semiserver)
Definition at line 307 of file SemiGlobals.cpp.

References initialize().

00308 { 00309 if (!initialized) initialize(); 00310 return atoi(config["ProxyComPort"]); 00311 }

char * Globals::getRelativeImagesFilePath  )  [static]
 

Returns:
relative path of images used from semiserver
Definition at line 328 of file SemiGlobals.cpp.

References initialize().

00329 { 00330 if (!initialized) initialize(); 00331 return config["RelativeImagesFilePath"]; 00332 }

char * Globals::getRelativeSDPFilePath  )  [static]
 

Returns:
relative path where SDP files are/should be stored
Definition at line 356 of file SemiGlobals.cpp.

References initialize().

Referenced by Movie::getHTMLRepresentation(), and SessionList::writeHTMLRepresentation().

00357 { 00358 if (!initialized) initialize(); 00359 return config["RelativeSDPFilePath"]; 00360 }


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