Guiliani  Version 2.5 revision 7293 (documentation build 13)
GUIValue.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef GUI_VALUE__H_
11#define GUI_VALUE__H_
12
13#include "GUIStreamableObject.h"
14#include "eC_Types.h"
15#include "eC_String.h"
16
25{
26public:
29 {
30 EC_INT,
31 EC_FLOAT,
32 EC_STRING,
33 EC_HEX,
34 EC_BOOL,
35 EC_BYTE,
36 EC_UBYTE,
37 EC_CHAR,
38 EC_WCHAR,
39 EC_SHORT,
40 EC_USHORT,
41 EC_UINT,
42 EC_VALUE,
43 EC_FIXED,
44 EC_POINTER
45 };
46
47public:
52
56 CGUIValue(const eC_Bool bValue);
57
61 CGUIValue(const eC_Byte bValue);
62
66 CGUIValue(const eC_UByte ubValue);
67
71 CGUIValue(const eC_Char cValue);
72
76 CGUIValue(const eC_UTF16 wcValue);
77
81 CGUIValue(const eC_Short sValue);
82
86 CGUIValue(const eC_Int iValue);
87
91 CGUIValue(const eC_UInt uiValue);
92
93#ifndef EC_INT_ALIASES_INT
97 CGUIValue(const unsigned int uiValue);
98#endif
99
100#ifndef EC_INT_ALIASES_INT
104 CGUIValue(const int uiValue);
105#endif
106
111 CGUIValue(const double dValue);
112
117 CGUIValue(const eC_Char* pcStringValue);
118
123 CGUIValue(const eC_String& StringValue, const GUIValue_t& eType = EC_STRING);
124
128 CGUIValue(void* const PointerValue);
129
135 inline GUIValue_t GetType() const {return m_eType;}
136
141 eC_Bool ConvertTo(const GUIValue_t& eType);
142
148 eC_Bool IsConvertibleTo(const GUIValue_t& eType) const;
149
155 eC_Bool ToBool() const;
156
163 eC_Byte ToByte() const;
164
171 eC_UByte ToUByte() const;
172
179 eC_Char ToChar() const;
180
187 eC_UTF16 ToWChar() const;
188
195 eC_Short ToShort() const;
196
203 eC_UShort ToUShort() const;
204
211 eC_Int ToInt() const;
212
219 eC_UInt ToUInt() const;
220
226 eC_Float ToFloat() const;
227
234 eC_Value ToValue() const;
235
242 eC_Fixed ToFix() const;
243
250 eC_String ToString() const;
251
257 void* ToPointer() const;
258
265
266#ifdef GUILIANI_STREAM_GUI
271 virtual void ReadFromStream();
272#endif
273
274#ifdef GUILIANI_WRITE_GUI
282 virtual void WriteToStream(const eC_Bool bWriteClassID=false);
283#endif
284
285private:
286
288 static const eC_String ms_FalseString;
290 static const eC_String ms_TrueString;
291
293 GUIValue_t m_eType;
295 eC_String m_kStringValue;
297 union BaseType_t
298 {
299 eC_Bool boolValue;
300 eC_Byte byteValue;
301 eC_UByte uByteValue;
302 eC_Char cValue;
303 eC_UTF16 wcValue;
304 eC_Short sValue;
305 eC_UShort usValue;
306 eC_Int iValue;
307 eC_UInt uiValue;
308 eC_Float fValue;
309 eC_Value vValue;
310 eC_Fixed fixValue;
311 void* pPtr;
312 };
314 BaseType_t m_BaseTypeValue;
315};
316
326bool operator== (const CGUIValue& Value1, const CGUIValue& Value2);
327
337bool operator!= (const CGUIValue& Value1, const CGUIValue& Value2);
338
348bool operator> (const CGUIValue& Value1, const CGUIValue& Value2);
349
350#endif // GUI_VALUE__H_
Base class for streamable objects.
Definition: GUIStreamableObject.h:45
CGUIValue stores a single value in one specific type.
Definition: GUIValue.h:25
CGUIValue(void *const PointerValue)
CGUIValue(const eC_UTF16 wcValue)
CGUIValue(const eC_UByte ubValue)
eC_UInt ToUInt() const
eC_Char ToChar() const
GUIValue_t GetType() const
Definition: GUIValue.h:135
eC_Bool ToBool() const
eC_Int ToInt() const
CGUIValue(const eC_Short sValue)
eC_UShort ToUShort() const
CGUIValue(const eC_Bool bValue)
eC_Float ToFloat() const
eC_UByte ToUByte() const
eC_Fixed ToFix() const
GUIValue_t
This enumeration indicates the type (format) of the CGUIValue.
Definition: GUIValue.h:29
eC_Bool IsConvertibleTo(const GUIValue_t &eType) const
eC_String ToString() const
CGUIValue(const double dValue)
CGUIValue(const eC_Int iValue)
void * ToPointer() const
eC_UTF16 ToWChar() const
CGUIValue(const eC_String &StringValue, const GUIValue_t &eType=EC_STRING)
eC_Value ToValue() const
eC_Short ToShort() const
CGUIValue(const int uiValue)
CGUIValue(const eC_Char cValue)
CGUIValue(const eC_UInt uiValue)
eC_Byte ToByte() const
CGUIValue(const eC_Byte bValue)
virtual void ReadFromStream()
CGUIValue(const unsigned int uiValue)
CGUIValue & operator=(const CGUIValue &Value)
eC_Bool ConvertTo(const GUIValue_t &eType)
CGUIValue(const eC_Char *pcStringValue)
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
bool operator==(const NSmartPtr::SharedPtr< C1 > &a, const NSmartPtr::SharedPtr< C2 > &b)
Definition: SharedPtr.h:240
bool operator!=(const NSmartPtr::SharedPtr< C1 > &a, const NSmartPtr::SharedPtr< C2 > &b)
Definition: SharedPtr.h:226