AnimatLab  2
Test
StdVariant.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 namespace StdUtils
10 {
15 {
16  StdVtEmpty = -1,
17  StdVtShort = 0,
18  StdVtLong = 1,
19  StdVtFloat = 2,
20  StdVtDouble = 3,
21  StdVtBool = 4,
22  StdVtChar = 5,
23  StdVtUChar = 6,
24  StdVtUShort = 7,
25  StdVtULong = 8,
26  StdVtInt = 9,
27  StdVtUInt = 10,
28  StdVtString = 11
29 };
30 
37 class STD_UTILS_PORT CStdVariant : public CStdSerialize
38 {
39 protected:
42 
45 
47  short *m_lpShort;
48 
50  long *m_lpLong;
51 
53  float *m_lpFloat;
54 
56  double *m_lpDouble;
57 
59  bool *m_lpBool;
60 
62  char *m_lpChar;
63 
65  unsigned char *m_lpUChar;
66 
68  unsigned short *m_lpUShort;
69 
71  unsigned long *m_lpULong;
72 
74  int *m_lpInt;
75 
77  unsigned int *m_lpUInt;
78 
80  std::string *m_lpString;
81 
82 public:
83  CStdVariant();
84  virtual ~CStdVariant();
85 
86  void Reset();
87  int VariantType();
88  std::string VariantTypeName();
89 
90  short GetShort(bool bConvert = true);
91  short *GetShortPtr();
92  void SetValue(short Val);
93  void SetPtr(short *lpVal);
94 
95  long GetLong(bool bConvert = true);
96  long *GetLongPtr();
97  void SetValue(long Val);
98  void SetPtr(long *lpVal);
99 
100  float GetFloat(bool bConvert = true);
101  float *GetFloatPtr();
102  void SetValue(float Val);
103  void SetPtr(float *lpVal);
104 
105  double GetDouble(bool bConvert = true);
106  double *GetDoublePtr();
107  void SetValue(double Val);
108  void SetPtr(double *lpVal);
109 
110  bool GetBool(bool bConvert = true);
111  bool *GetBoolPtr();
112  void SetValue(bool Val);
113  void SetPtr(bool *lpVal);
114 
115  char GetChar(bool bConvert = true);
116  char *GetCharPtr();
117  void SetValue(char Val);
118  void SetPtr(char *lpVal);
119 
120  unsigned char GetUChar(bool bConvert = true);
121  unsigned char *GetUCharPtr();
122  void SetValue(unsigned char Val);
123  void SetPtr(unsigned char *lpVal);
124 
125  unsigned short GetUShort(bool bConvert = true);
126  unsigned short *GetUShortPtr();
127  void SetValue(unsigned short Val);
128  void SetPtr(unsigned short *lpVal);
129 
130  unsigned long GetULong(bool bConvert = true);
131  unsigned long *GetULongPtr();
132  void SetValue(unsigned long Val);
133  void SetPtr(unsigned long *lpVal);
134 
135  int GetInt(bool bConvert = true);
136  int *GetIntPtr();
137  void SetValue(int Val);
138  void SetPtr(int *lpVal);
139 
140  unsigned int GetUInt(bool bConvert = true);
141  unsigned int *GetUIntPtr();
142  void SetValue(unsigned int Val);
143  void SetPtr(unsigned int *lpVal);
144 
145  std::string GetString(bool bConvert = true);
146  std::string GetNumericString();
147  std::string *GetStringPtr();
148  void SetValue(std::string Val);
149  void SetPtr(std::string *lpVal);
150 
151  void Copy(CStdVariant &oVar);
152  void operator=(CStdVariant &oVar);
153 
154  //CStdSerialize overloads
155  virtual CStdSerialize *Clone();
156  virtual void Trace(std::ostream &oOs);
157  virtual void Load(CStdXml &oXml);
158  virtual void Save(CStdXml &oXml);
159 };
160 
161 } //StdUtils
long * m_lpLong
StdVtLong 4-byte signed int.
Definition: StdVariant.h:50
Standard variant type.
Definition: StdVariant.h:37
unsigned short * m_lpUShort
StdVtUShort 2 byte unsigned int.
Definition: StdVariant.h:68
char * m_lpChar
StdVtChar Char.
Definition: StdVariant.h:62
A standard xml manipulation class.
Definition: StdXml.h:19
std::string * m_lpString
StdVtString string.
Definition: StdVariant.h:80
Namespace for the standard utility objects.
Definition: MarkupSTL.cpp:19
unsigned int * m_lpUInt
StdVtUInt 2 byte unsigned int.
Definition: StdVariant.h:77
int * m_lpInt
StdVtInt 2 byte signed int.
Definition: StdVariant.h:74
float * m_lpFloat
StdVtFloat 4-byte real.
Definition: StdVariant.h:53
bool * m_lpBool
StdVtBool Boolean.
Definition: StdVariant.h:59
double * m_lpDouble
StdVtDouble 8-byte real.
Definition: StdVariant.h:56
StdVariantType
Values that represent StdVariantType.
Definition: StdVariant.h:14
Standard serialize class.
Definition: StdSerialize.h:20
bool m_bCreatedVar
true if created variable
Definition: StdVariant.h:41
unsigned char * m_lpUChar
StdVtUChar Unsigned char.
Definition: StdVariant.h:65
short * m_lpShort
StdVtShort 2-byte signed int.
Definition: StdVariant.h:47
unsigned long * m_lpULong
StdVtULong 4 byte unsigned int.
Definition: StdVariant.h:71
int m_iVariantType
Variant type.
Definition: StdVariant.h:44