2014-09-27 09:25:14 +02:00
|
|
|
#ifndef __XMLGLOBALS_H
|
|
|
|
#define __XMLGLOBALS_H
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
#include <set>
|
|
|
|
#include <sstream>
|
|
|
|
#include <vdr/plugin.h>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
typedef uint32_t tColor;
|
|
|
|
|
|
|
|
// --- cGlobals -------------------------------------------------------------
|
|
|
|
|
|
|
|
class cGlobals {
|
|
|
|
private:
|
2015-06-05 14:48:45 +02:00
|
|
|
time_t customTokenChange;
|
|
|
|
time_t lastCustomTokenQuery;
|
2014-09-27 09:25:14 +02:00
|
|
|
string language;
|
|
|
|
string DoTranslate(string token);
|
|
|
|
map <string, tColor> colors;
|
2015-01-24 10:47:47 +01:00
|
|
|
map <string, string> fonts;
|
2014-09-27 09:25:14 +02:00
|
|
|
map <string, int> intVars;
|
2014-10-10 15:32:38 +02:00
|
|
|
map <string, double> doubleVars;
|
2014-09-27 09:25:14 +02:00
|
|
|
map <string, string> stringVars;
|
|
|
|
map <string, map< string, string > > translations;
|
2014-12-19 15:39:21 +01:00
|
|
|
map <string, string> customStringTokens;
|
|
|
|
map <string, int> customIntTokens;
|
2015-01-24 10:47:47 +01:00
|
|
|
public:
|
|
|
|
cGlobals(void);
|
|
|
|
virtual ~cGlobals(void) {};
|
2014-09-27 09:25:14 +02:00
|
|
|
bool ReadFromXML(void);
|
2015-01-24 10:47:47 +01:00
|
|
|
void AddColor(string &name, tColor &col);
|
|
|
|
bool GetColor(string &name, tColor &col);
|
|
|
|
void AddFont(string &name, string &font);
|
|
|
|
bool GetFont(string name, string &font);
|
|
|
|
void AddInt(string &name, int value);
|
|
|
|
void ReplaceIntVars(string &value);
|
|
|
|
bool GetInt(string name, int &val);
|
|
|
|
void AddDouble(string &name, string &value);
|
|
|
|
void ReplaceDoubleVars(string &value);
|
|
|
|
void AddString(string &name, string &value);
|
|
|
|
void ReplaceStringVars(string &value);
|
2015-08-08 11:04:15 +02:00
|
|
|
bool GetString(string &name, string &value);
|
2015-01-24 10:47:47 +01:00
|
|
|
bool AddTranslation(string name, map < string, string > transl);
|
2014-09-27 09:25:14 +02:00
|
|
|
bool Translate(string text, string &translation);
|
2015-01-24 10:47:47 +01:00
|
|
|
void AddCustomInt(string &name, int value);
|
|
|
|
void AddCustomString(string &name, string &value);
|
|
|
|
bool GetCustomInt(string name, int &val);
|
2015-06-05 14:48:45 +02:00
|
|
|
map <string, string> GetCustomStringTokens(void);
|
|
|
|
map <string, int> GetCustomIntTokens(void);
|
|
|
|
bool CustomTokenChange(void);
|
2015-01-24 10:47:47 +01:00
|
|
|
void ListCustomTokens(void);
|
2014-09-27 09:25:14 +02:00
|
|
|
void Debug(void);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__XMLGLOBALS_H
|