diff options
author | lordjaxom <lordjaxom> | 2004-12-08 18:48:39 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2004-12-08 18:48:39 +0000 |
commit | 5382d18d05d358bb1c313c642395e835aa44a6a0 (patch) | |
tree | 2b5ef58620b3640c5b21e8eafe92ee4b266b1d30 /xml/type.h | |
parent | eb2f2c9600e8f69788232582191b141002bcd522 (diff) | |
download | vdr-plugin-text2skin-5382d18d05d358bb1c313c642395e835aa44a6a0.tar.gz vdr-plugin-text2skin-5382d18d05d358bb1c313c642395e835aa44a6a0.tar.bz2 |
1.0-pre1v1.0-pre1
Diffstat (limited to 'xml/type.h')
-rw-r--r-- | xml/type.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/xml/type.h b/xml/type.h new file mode 100644 index 0000000..1b1113c --- /dev/null +++ b/xml/type.h @@ -0,0 +1,42 @@ +/* + * $Id: type.h,v 1.3 2004/12/08 17:13:26 lordjaxom Exp $ + */ + +#ifndef VDR_TEXT2SKIN_XML_TYPE_H +#define VDR_TEXT2SKIN_XML_TYPE_H + +#include <string> + +class cxType { +public: + enum eType { + string, + number, + boolean + }; + +private: + eType mType; + std::string mString; + int mNumber; + +public: + cxType(const char *String): mType(string), mString(String ?: "") {} + cxType(std::string String): mType(string), mString(String) {} + cxType(int Number): mType(number), mNumber(Number) {} + cxType(time_t Number): mType(number), mNumber(Number) {} + cxType(bool Value): mType(boolean), mNumber(Value ? 1 : 0) {} + + const std::string &String(void); + int Number(void) const; + + operator std::string () { return String(); } + operator int () { return Number(); } + operator bool () { return Number(); } +}; + +inline int cxType::Number(void) const { + return mType == number ? mNumber : 0; +} + +#endif // VDR_TEXT2SKIN_XML_TYPE_H |