diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-02-02 15:57:48 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-02-02 15:57:48 +0100 |
commit | fa32be64a8781d8c1cdec9b359a2e8fe62668416 (patch) | |
tree | 999d6b33a467ea5412024fda2ddc497c15323f86 /config.h | |
parent | ddec0a101bfb97caa23ca731b8041547717a5eb3 (diff) | |
download | vdr-fa32be64a8781d8c1cdec9b359a2e8fe62668416.tar.gz vdr-fa32be64a8781d8c1cdec9b359a2e8fe62668416.tar.bz2 |
Config files can now contain comments separated by '#'
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.90 2002/01/30 18:30:03 kls Exp $ + * $Id: config.h 1.91 2002/02/02 15:57:48 kls Exp $ */ #ifndef __CONFIG_H @@ -182,7 +182,7 @@ private: public: cConfig(void) { fileName = NULL; } virtual ~cConfig() { delete fileName; } - virtual bool Load(const char *FileName) + virtual bool Load(const char *FileName, bool AllowComments = false) { Clear(); fileName = strdup(FileName); @@ -196,6 +196,11 @@ public: result = true; while (fgets(buffer, sizeof(buffer), f) > 0) { line++; + if (AllowComments) { + char *p = strchr(buffer, '#'); + if (p) + *p = 0; + } if (!isempty(buffer)) { T *l = new T; if (l->Parse(buffer)) @@ -242,7 +247,7 @@ protected: int maxNumber; public: cChannels(void) { maxNumber = 0; } - virtual bool Load(const char *FileName); + virtual bool Load(const char *FileName, bool AllowComments = false); int GetNextGroup(int Idx); // Get next channel group int GetPrevGroup(int Idx); // Get previous channel group int GetNextNormal(int Idx); // Get next normal channel (not group) |