TreeFrogFramework  2.8
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
TWebApplication Class Reference

#include <twebapplication.h>

Inheritance diagram for TWebApplication:
Inheritance graph
[legend]
Collaboration diagram for TWebApplication:
Collaboration graph
[legend]

Public Types

enum  MultiProcessingModule { Invalid = 0 , Thread = 1 , Epoll = 2 }
 

Public Member Functions

 TWebApplication (int &argc, char **argv)
 
 ~TWebApplication ()
 
int exec ()
 
QString webRootPath () const
 
bool webRootExists () const
 
QString publicPath () const
 
QString configPath () const
 
QString libPath () const
 
QString logPath () const
 
QString pluginPath () const
 
QString tmpPath () const
 
QString databaseEnvironment () const
 
void setDatabaseEnvironment (const QString &environment)
 
bool appSettingsFileExists () const
 
QString appSettingsFilePath () const
 
const QVariantMap & sqlDatabaseSettings (int databaseId) const
 
int sqlDatabaseSettingsCount () const
 
const QVariantMap & kvsSettings (Tf::KvsEngine engine) const
 
bool isKvsAvailable (Tf::KvsEngine engine) const
 
bool cacheEnabled () const
 
QString cacheBackend () const
 
int databaseIdForCache () const
 
const QVariantMap & loggerSettings () const
 
const QVariantMap & validationSettings () const
 
QString validationErrorMessage (int rule) const
 
QByteArray internetMediaType (const QString &ext, bool appendCharset=false)
 
MultiProcessingModule multiProcessingModule () const
 
void setMultiProcessingModule (MultiProcessingModule mpm)
 
int maxNumberOfAppServers () const
 
int maxNumberOfThreadsPerAppServer () const
 
QString routesConfigFilePath () const
 
QString systemLogFilePath () const
 
QString accessLogFilePath () const
 
QString sqlQueryLogFilePath () const
 
QStringConverter::Encoding encodingForInternal () const
 
QStringConverter::Encoding encodingForHttpOutput () const
 
int applicationServerId () const
 
QThread * databaseContextMainThread () const
 
TDatabaseContextmainDatabaseContext () const
 
const QVariantMap & getConfig (const QString &configName)
 
QVariant getConfigValue (const QString &configName, const QString &key, const QVariant &defaultValue=QVariant())
 
void initializeCache ()
 
void cleanupCache ()
 

Protected Member Functions

void timerEvent (QTimerEvent *event)
 

Static Protected Member Functions

static int signalNumber ()
 

Detailed Description

The TWebApplication class provides an event loop for TreeFrog applications.

Member Enumeration Documentation

◆ MultiProcessingModule

Enumerator
Invalid 
Thread 
Epoll 

Constructor & Destructor Documentation

◆ TWebApplication()

TWebApplication::TWebApplication ( int &  argc,
char **  argv 
)

Constructor.

◆ ~TWebApplication()

TWebApplication::~TWebApplication ( )

Member Function Documentation

◆ accessLogFilePath()

QString TWebApplication::accessLogFilePath ( ) const

Returns the absolute file path of the access log, which is set by the setting AccessLog.FilePath in the application.ini.

◆ applicationServerId()

int TWebApplication::applicationServerId ( ) const
inline

◆ appSettingsFileExists()

bool TWebApplication::appSettingsFileExists ( ) const

Returns true if the file of the application settings exists; otherwise returns false.

◆ appSettingsFilePath()

QString TWebApplication::appSettingsFilePath ( ) const

Returns the absolute file path of the application settings.

◆ cacheBackend()

QString TWebApplication::cacheBackend ( ) const

◆ cacheEnabled()

bool TWebApplication::cacheEnabled ( ) const

◆ cleanupCache()

void TWebApplication::cleanupCache ( )

◆ configPath()

QString TWebApplication::configPath ( ) const

Returns the absolute path of the config directory.

◆ databaseContextMainThread()

QThread * TWebApplication::databaseContextMainThread ( ) const

◆ databaseEnvironment()

QString TWebApplication::databaseEnvironment ( ) const
inline

Returns the database environment, which string is used to load the settings in database.ini.

See also
setDatabaseEnvironment(const QString &environment)

◆ databaseIdForCache()

int TWebApplication::databaseIdForCache ( ) const

◆ encodingForHttpOutput()

QStringConverter::Encoding TWebApplication::encodingForHttpOutput ( ) const
inline

◆ encodingForInternal()

QStringConverter::Encoding TWebApplication::encodingForInternal ( ) const
inline

◆ exec()

int TWebApplication::exec ( )

Enters the main event loop and waits until exit() is called.

Returns the value that was set to exit() (which is 0 if exit() is called via quit()).

◆ getConfig()

const QVariantMap & TWebApplication::getConfig ( const QString &  configName)

◆ getConfigValue()

QVariant TWebApplication::getConfigValue ( const QString &  configName,
const QString &  key,
const QVariant &  defaultValue = QVariant() 
)

◆ initializeCache()

void TWebApplication::initializeCache ( )

◆ internetMediaType()

QByteArray TWebApplication::internetMediaType ( const QString &  ext,
bool  appendCharset = false 
)

Returns the internet media type associated with the file extension ext.

◆ isKvsAvailable()

bool TWebApplication::isKvsAvailable ( Tf::KvsEngine  engine) const

Returns true if the settings of the specified engine is available; otherwise returns false.

◆ kvsSettings()

const QVariantMap & TWebApplication::kvsSettings ( Tf::KvsEngine  engine) const

Returns a reference to the settings object for the specified engine.

◆ libPath()

QString TWebApplication::libPath ( ) const

Returns the absolute path of the library directory.

◆ loggerSettings()

const QVariantMap & TWebApplication::loggerSettings ( ) const
inline

Returns a reference to the QSettings object for settings of the logger, which file is logger.ini.

◆ logPath()

QString TWebApplication::logPath ( ) const

Returns the absolute path of the log directory.

◆ mainDatabaseContext()

TDatabaseContext * TWebApplication::mainDatabaseContext ( ) const

◆ maxNumberOfAppServers()

int TWebApplication::maxNumberOfAppServers ( ) const

Returns the maximum number of application servers, which is set in the application.ini.

◆ maxNumberOfThreadsPerAppServer()

int TWebApplication::maxNumberOfThreadsPerAppServer ( ) const

Maximum number of action threads allowed to start simultaneously per server process.

◆ multiProcessingModule()

TWebApplication::MultiProcessingModule TWebApplication::multiProcessingModule ( ) const

Returns the module name for multi-processing that is set by the setting MultiProcessingModule in the application.ini.

◆ pluginPath()

QString TWebApplication::pluginPath ( ) const

Returns the absolute path of the plugin directory.

◆ publicPath()

QString TWebApplication::publicPath ( ) const

Returns the absolute path of the public directory.

◆ routesConfigFilePath()

QString TWebApplication::routesConfigFilePath ( ) const

Returns the absolute file path of the routes config.

◆ setDatabaseEnvironment()

void TWebApplication::setDatabaseEnvironment ( const QString &  environment)
inline

Sets the database environment to environment.

See also
databaseEnvironment()

◆ setMultiProcessingModule()

void TWebApplication::setMultiProcessingModule ( MultiProcessingModule  mpm)
inline

◆ signalNumber()

int TWebApplication::signalNumber ( )
staticprotected

Returns the integral number of the received signal.

◆ sqlDatabaseSettings()

const QVariantMap & TWebApplication::sqlDatabaseSettings ( int  databaseId) const

Returns a reference to the QSettings object for settings of the SQL database databaseId.

◆ sqlDatabaseSettingsCount()

int TWebApplication::sqlDatabaseSettingsCount ( ) const

Returns the number of SQL database settings files set by the setting DatabaseSettingsFiles in the application.ini.

◆ sqlQueryLogFilePath()

QString TWebApplication::sqlQueryLogFilePath ( ) const

Returns the absolute file path of the SQL query log, which is set by the setting SqlQueryLogFile in the application.ini.

◆ systemLogFilePath()

QString TWebApplication::systemLogFilePath ( ) const

Returns the absolute file path of the system log, which is set by the setting SystemLog.FilePath in the application.ini.

◆ timerEvent()

void TWebApplication::timerEvent ( QTimerEvent *  event)
protected

Reimplemented from QObject::timerEvent().

◆ tmpPath()

QString TWebApplication::tmpPath ( ) const

Returns the absolute path of the tmp directory.

◆ validationErrorMessage()

QString TWebApplication::validationErrorMessage ( int  rule) const

Returns the error message for validation of the given rule.

These messages are defined in the validation.ini.

◆ validationSettings()

const QVariantMap & TWebApplication::validationSettings ( ) const
inline

Returns a reference to the QSettings object for settings of the validation, which file is validation.ini.

◆ webRootExists()

bool TWebApplication::webRootExists ( ) const

Returns true if the web root directory exists; otherwise returns false.

◆ webRootPath()

QString TWebApplication::webRootPath ( ) const
inline

Returns the absolute path of the web root directory.


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