TreeFrogFramework  1.18
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, Hybrid }
 

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
 
QSettings & sqlDatabaseSettings (int databaseId) const
 
int sqlDatabaseSettingsCount () const
 
bool isSqlDatabaseAvailable () const
 
QSettings & mongoDbSettings () const
 
bool isMongoDbAvailable () const
 
QSettings & redisSettings () const
 
bool isRedisAvailable () const
 
QSettings & loggerSettings () const
 
QSettings & validationSettings () const
 
QString validationErrorMessage (int rule) const
 
QByteArray internetMediaType (const QString &ext, bool appendCharset=false)
 
MultiProcessingModule multiProcessingModule () const
 
int maxNumberOfAppServers () const
 
int maxNumberOfThreadsPerAppServer () const
 
QString routesConfigFilePath () const
 
QString systemLogFilePath () const
 
QString accessLogFilePath () const
 
QString sqlQueryLogFilePath () const
 
QTextCodec * codecForInternal () const
 
QTextCodec * codecForHttpOutput () const
 
int applicationServerId () const
 
QThread * databaseContextMainThread () const
 
const QVariantMap & getConfig (const QString &configName)
 
QVariant getConfigValue (const QString &configName, const QString &key, const QVariant &defaultValue=QVariant())
 

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

Enumerator
Invalid 
Thread 
Hybrid 

Constructor & Destructor Documentation

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

Constructor.

TWebApplication::~TWebApplication ( )

Member Function Documentation

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.

int TWebApplication::applicationServerId ( ) const
inline
bool TWebApplication::appSettingsFileExists ( ) const

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

QString TWebApplication::appSettingsFilePath ( ) const

Returns the absolute file path of the application settings.

QTextCodec * TWebApplication::codecForHttpOutput ( ) const
inline

Returns a pointer to the codec of the HTTP output stream used by an action view, which is set by the setting HttpOutputEncoding in the application.ini.

QTextCodec * TWebApplication::codecForInternal ( ) const
inline

Returns a pointer to the codec used internally, which is set by the setting InternalEncoding in the application.ini.

This codec is used by QObject::tr() and toLocal8Bit() functions.

QString TWebApplication::configPath ( ) const

Returns the absolute path of the config directory.

QThread * TWebApplication::databaseContextMainThread ( ) const
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)
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()).

const QVariantMap & TWebApplication::getConfig ( const QString &  configName)
QVariant TWebApplication::getConfigValue ( const QString &  configName,
const QString &  key,
const QVariant &  defaultValue = QVariant() 
)
QByteArray TWebApplication::internetMediaType ( const QString &  ext,
bool  appendCharset = false 
)

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

bool TWebApplication::isMongoDbAvailable ( ) const

Returns true if MongoDB settings is available; otherwise returns false.

bool TWebApplication::isRedisAvailable ( ) const

Returns true if Redis settings is available; otherwise returns false.

bool TWebApplication::isSqlDatabaseAvailable ( ) const

Returns true if SQL database is available; otherwise returns false.

QString TWebApplication::libPath ( ) const

Returns the absolute path of the library directory.

QSettings & TWebApplication::loggerSettings ( ) const
inline

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

QString TWebApplication::logPath ( ) const

Returns the absolute path of the log directory.

int TWebApplication::maxNumberOfAppServers ( ) const

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

int TWebApplication::maxNumberOfThreadsPerAppServer ( ) const

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

QSettings & TWebApplication::mongoDbSettings ( ) const

Returns a reference to the QSettings object for settings of the MongoDB system.

TWebApplication::MultiProcessingModule TWebApplication::multiProcessingModule ( ) const

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

QString TWebApplication::pluginPath ( ) const

Returns the absolute path of the plugin directory.

QString TWebApplication::publicPath ( ) const

Returns the absolute path of the public directory.

QSettings & TWebApplication::redisSettings ( ) const

Returns a reference to the QSettings object for settings of the Redis system.

QString TWebApplication::routesConfigFilePath ( ) const

Returns the absolute file path of the routes config.

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

Sets the database environment to environment.

See also
databaseEnvironment()
int TWebApplication::signalNumber ( )
staticprotected

Returns the integral number of the received signal.

QSettings & TWebApplication::sqlDatabaseSettings ( int  databaseId) const

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

int TWebApplication::sqlDatabaseSettingsCount ( ) const

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

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.

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.

void TWebApplication::timerEvent ( QTimerEvent *  event)
protected

Reimplemented from QObject::timerEvent().

QString TWebApplication::tmpPath ( ) const

Returns the absolute path of the tmp directory.

QString TWebApplication::validationErrorMessage ( int  rule) const

Returns the error message for validation of the given rule.

These messages are defined in the validation.ini.

QSettings & TWebApplication::validationSettings ( ) const
inline

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

bool TWebApplication::webRootExists ( ) const

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

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: