summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2018-08-11 14:56:46 +0200
committerDimitar Petrovski <dimeptr@gmail.com>2018-08-11 14:56:46 +0200
commitefbf22b18d2509ca8c5bccdb1894661fe8d888d1 (patch)
tree4f3393897cea4afd912ee1e9d3cab4d5644aff28 /util.h
parent9cd9a75a061ed301378e8102b726549f5a0e672d (diff)
parentca0c9dda448ffe0cd71e85cbc5b1f9c10203e1ad (diff)
downloadvdr-plugin-eepg-efbf22b18d2509ca8c5bccdb1894661fe8d888d1.tar.gz
vdr-plugin-eepg-efbf22b18d2509ca8c5bccdb1894661fe8d888d1.tar.bz2
Merge branch 'experimental'
Diffstat (limited to 'util.h')
-rw-r--r--util.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/util.h b/util.h
index 0113249..7573744 100644
--- a/util.h
+++ b/util.h
@@ -9,22 +9,30 @@
#define UTIL_H_
#include <time.h>
#include <stdlib.h>
+#include <string>
+#include <map>
class cChannel;
struct tChannelID;
class cEvent;
class cEquivHandler;
class cSchedules;
+class cCharSetConv;
#define START '\0'
#define STOP '\0'
#define ESCAPE '\1'
+
+
#define Asprintf(a, b, c...) void( asprintf(a, b, c) < 0 ? esyslog("memory allocation error - %s", b) : void() )
namespace util
{
+static const char CATEGORY[] = "Category: ";
+static const char GENRE[] = "Genre: ";
+
extern int AvailableSources[32];
extern int NumberOfAvailableSources;
@@ -53,7 +61,7 @@ extern cEquivHandler* EquivHandler;
void AddEvent(cEvent *event, tChannelID ChannelID);
-cChannel *GetChannelByID(tChannelID & channelID, bool searchOtherPos);
+const cChannel *GetChannelByID(const tChannelID & channelID, bool searchOtherPos);
time_t LocalTime2UTC(time_t t);
time_t UTC2LocalTime(time_t t);
void GetLocalTimeOffset(void);
@@ -61,6 +69,12 @@ void CleanString(unsigned char *String);
void decodeText2(const unsigned char *from, int len, char *buffer, int buffsize);
char *freesat_huffman_decode(const unsigned char *src, size_t size);
void sortSchedules(cSchedules * Schedules, tChannelID channelID);
+/**
+ * Locate the translation of a given Theme (Category, Genre) string in the translation map
+ * @param the text to search
+ * @return found translation or the source text if not found.
+ */
+std::string findThemeTr(const char*);
//struct sNode
//{
@@ -88,6 +102,25 @@ struct hufftab
extern struct hufftab *tables[2][128];
extern int table_size[2][128];
//static sNodeH* sky_tables[2];
+extern std::map<std::string,std::string> tableDict;
+
+
+class cCharsetFixer
+{
+public:
+ cCharsetFixer();
+ virtual ~cCharsetFixer();
+ const char* FixCharset(const char* text);
+ void InitCharsets(const cChannel* Channel);
+
+private:
+ cCharSetConv* conv_revert;//("UTF-8",CharsetOverride);
+ cCharSetConv* conv_to;//(fixCharset.c_str());
+ const char* charsetOverride;
+ std::string fixedCharset;
+ std::string initialCharset;
+
+};
}
#endif /* UTIL_H_ */