00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __embite_VariantValue_h
00019 #define __embite_VariantValue_h
00020
00021 #include <string>
00022 #include <glibmm/ustring.h>
00023
00024 namespace embite
00025 {
00026
00030 class VariantValue
00031 {
00032 protected:
00033 enum TType {
00034 typeInt,
00035 typeDouble,
00036 typeUstring,
00037 typeString,
00038 typeSz
00039 };
00040 TType m_type;
00041
00042 union TValueRef {
00043 int* valueInt;
00044 double* valueDouble;
00045 Glib::ustring* valueUstring;
00046 std::string* valueString;
00047 const char* valueSz;
00048 };
00049 TValueRef m_valueRef;
00050 };
00051
00054 class VariantValueOut : public VariantValue
00055 {
00056 public:
00057 VariantValueOut(int& v);
00058 VariantValueOut(double& v);
00059 VariantValueOut(Glib::ustring& v);
00060 VariantValueOut(std::string& v);
00061
00062 VariantValueOut(const VariantValueOut& op);
00063
00064 bool assign(const Glib::ustring& from);
00065 };
00066
00069 class VariantValueIn : public VariantValue
00070 {
00071 public:
00072 VariantValueIn(int& v);
00073 VariantValueIn(double& v);
00074 VariantValueIn(const Glib::ustring& v);
00075 VariantValueIn(const std::string& v);
00076 VariantValueIn(const char* v);
00077
00078 Glib::ustring toString() const;
00079 };
00080
00081
00082 }
00083
00084 #endif // __embite_VariantValue_h