yacreader/YACReaderLibrary/server/static.h
Felix Kauselmann 1b344d70e5 Update server code integration for QtWebApp 1.7.11
- Adapt server code for QtWebapp namespace 'stefanfrings'
- Implement custom modifications needed by v1 controller
  via template engine
- Unify iphone and ipad templates
2020-08-20 18:22:57 +02:00

66 lines
1.7 KiB
C++

/**
@file
@author Stefan Frings
*/
#ifndef STATIC_H
#define STATIC_H
#include <QString>
#include "templatecache.h"
#include "httpsessionstore.h"
#include "staticfilecontroller.h"
#include "yacreader_http_session_store.h"
/**
This class contains some static resources that are used by the application.
*/
class Static
{
public:
/**
Search the main config file and return its full path.
On the first call, the INI file gets searched. If not found,
the application aborts with an error message.
<p>
The filename is the applications name plus the ending ".ini". It is searched
in the following directories:
- Same directory as the applications executable file
- In ../etc relative to the applications executable file
- In ../../etc relative to the applications executable file
- In /etc/xdg/{organisation name} on the root drive
- In /etc/opt on the root drive
- In /etc on the root drive
*/
static QString getConfigFileName();
/**
Gets the directory where the main config file is located.
On the first call, the INI file gets searched. If not found,
the application aborts with an error message.
@see getConfigFileName()
*/
static QString getConfigDir();
/** Cache for template files */
static stefanfrings::TemplateLoader *templateLoader;
/** Storage for session cookies */
static stefanfrings::HttpSessionStore *sessionStore;
static YACReaderHttpSessionStore *yacreaderSessionStore;
/** Controller for static files */
static stefanfrings::StaticFileController *staticFileController;
private:
/** Directory of the main config file */
static QString configDir;
};
#endif // STATIC_H