#include <OpenGUI_Value.h>
Each Value has a stored value of ValueType as well as the option to carry a string based Name.
Public Types | |
| enum | ValueType { T_STRING = 0, T_BOOL = 1, T_FLOAT = 2, T_FVECTOR2 = 3, T_FRECT = 4, T_INTEGER = 5, T_IVECTOR2 = 6, T_IRECT = 7, T_COLOR = 8, T_FONT = 9, T_TEXTALIGNMENT = 10, T_IMAGERY = 11, T_FACE = 12, T_CURSOR = 13 } |
| signifies the stored value type More... | |
Public Member Functions | |
| Value () | |
| default constructor | |
| Value (const Value ©) | |
| Copy Constructor. | |
| ~Value () | |
| Destructor. | |
| const String & | getName () const |
| gets the name of this Value | |
| void | setName (const String &Name="") |
| sets the name of this Value | |
| ValueType | getType () const |
| Returns the type of this value. | |
| void | clearValue () |
| clears the stored value if one is stored, otherwise does nothing | |
| bool | isSet () const |
| returns true if a value is stored | |
| bool | operator== (const Value &right) const |
| bool | operator!= (const Value &right) const |
| bool | operator! () const |
| Returns true if this Value is empty (contains no stored value). | |
| operator bool () const | |
| Returns true if this Value is not empty (has a value stored). | |
| Value & | operator= (const Value &right) |
Assignment operation creates a complete copy of the contents (clones), but does not alter the Name of the assign target. | |
| void | SaveToXMLNode (XMLNode &node) const |
| Saves this Value to the given XMLNode object, overwriting any colliding content. | |
| void | LoadFromXMLNode (const XMLNode &node) |
| Loads this value from the given XMLNode object. | |
Assigning constructors that auto detect type based on parameter type | |
| Value (const String &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const char *value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (bool boolean, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (float value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const FVector2 &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const FRect &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (int value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const IVector2 &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const IRect &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const Color &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const Font &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const TextAlignment &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const ImageryPtr &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const FacePtr &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
| Value (const CursorPtr &value, const String &Name="") | |
Constructor, initializes object with copy of given value, the Name is optional. | |
Auto detect type based on parameter type | |
| void | setValue (const String &str) |
| Sets the value, stored value is a copy. | |
| void | setValue (const char *cString) |
| Sets the value, stored value is a copy. | |
| void | setValue (bool boolean) |
| Sets the value, stored value is a copy. | |
| void | setValue (float floatingPoint) |
| Sets the value, stored value is a copy. | |
| void | setValue (const FVector2 &floatVector) |
| Sets the value, stored value is a copy. | |
| void | setValue (const FRect &floatRect) |
| Sets the value, stored value is a copy. | |
| void | setValue (int integer) |
| Sets the value, stored value is a copy. | |
| void | setValue (const IVector2 &intVector) |
| Sets the value, stored value is a copy. | |
| void | setValue (const IRect &intRect) |
| Sets the value, stored value is a copy. | |
| void | setValue (const Color &color) |
| Sets the value, stored value is a copy. | |
| void | setValue (const Font &font) |
| Sets the value, stored value is a copy. | |
| void | setValue (const TextAlignment &textAlignment) |
| Sets the value, stored value is a copy. | |
| void | setValue (const ImageryPtr &imageryPtr) |
| Sets the value, stored value is a copy. | |
| void | setValue (const FacePtr &facePtr) |
| Sets the value, stored value is a copy. | |
| void | setValue (const CursorPtr &cursorPtr) |
| Sets the value, stored value is a copy. | |
Get value as explicit type | |
| String | getValueAsString () const |
| Gets the stored value, throws exception if no value is stored. | |
| const char * | getValueAsCString () const |
| Gets the stored value, throws exception if no value is stored. | |
| bool | getValueAsBool () const |
| Gets the stored value, throws exception if no value is stored. | |
| float | getValueAsFloat () const |
| Gets the stored value, throws exception if no value is stored. | |
| FVector2 | getValueAsFVector2 () const |
| Gets the stored value, throws exception if no value is stored. | |
| FRect | getValueAsFRect () const |
| Gets the stored value, throws exception if no value is stored. | |
| int | getValueAsInt () const |
| Gets the stored value, throws exception if no value is stored. | |
| IVector2 | getValueAsIVector2 () const |
| Gets the stored value, throws exception if no value is stored. | |
| IRect | getValueAsIRect () const |
| Gets the stored value, throws exception if no value is stored. | |
| Color | getValueAsColor () const |
| Gets the stored value, throws exception if no value is stored. | |
| Font | getValueAsFont () const |
| Gets the stored value, throws exception if no value is stored. | |
| TextAlignment | getValueAsTextAlignment () const |
| Gets the stored value, throws exception if no value is stored. | |
| ImageryPtr | getValueAsImageryPtr () const |
| Gets the stored value, throws exception if no value is stored. | |
| FacePtr | getValueAsFacePtr () const |
| Gets the stored value, throws exception if no value is stored. | |
| CursorPtr | getValueAsCursorPtr () const |
| Gets the stored value, throws exception if no value is stored. | |
Set from string with explicit type conversion | |
| void | setValueAsInt (const String &intStr) |
| Sets the value from a string, parsed into an int. | |
| void | setValueAsFloat (const String &floatStr) |
| Sets the value from a string, parsed into a float. | |
| void | setValueAsFVector2 (const String &fv2Str) |
| Sets the value from a string, parsed into an FVector2. | |
| void | setValueAsFRect (const String &frectStr) |
| Sets the value from a string, parsed into an FRect. | |
| void | setValueAsIVector2 (const String &iv2Str) |
| Sets the value from a string, parsed into an IVector2. | |
| void | setValueAsIRect (const String &irectStr) |
| Sets the value from a string, parsed into an IRect. | |
| void | setValueAsColor (const String &colorStr) |
| Sets the value from a string, parsed into a Color. | |
| void | setValueAsString (const String &stringStr) |
| Sets the value from a string, parsed into a string. | |
| void | setValueAsBool (const String &boolStr) |
| Sets the value from a string, parsed into a boolean. | |
| void | setValueAsFont (const String &fontStr) |
| Sets the value from a string, parsed into a Font. | |
| void | setValueAsTextAlignment (const String &textAlignmentStr) |
| Sets the value from a string, parsed into a TextAlignment. | |
| void | setValueAsImageryPtr (const String &imageryName) |
| Sets the value from a string, used to look up the Imagery (can be either short name or FQN). | |
| void | setValueAsFacePtr (const String &faceName) |
| Sets the value from a string, used to look up the Face. | |
| void | setValueAsCursorPtr (const String &cursorName) |
| Sets the value from a string, used to look up the Cursor via CursorManager::CreateDefinedCursor(). | |
Purely string based functions | |
| String | toStr () const |
| Returns a string representation of the stored value. | |
|
|
signifies the stored value type
|
|
|
default constructor
|
|
|
Copy Constructor.
|
|
|
Destructor.
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
||||||||||||
|
Constructor, initializes object with copy of given
|
|
|
clears the stored value if one is stored, otherwise does nothing
|
|
|
gets the name of this Value
|
|
|
Returns the type of this value. Only valid if isSet() == true |
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored. You must copy this if you wish to keep it, the buffer is temporary |
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
Gets the stored value, throws exception if no value is stored.
|
|
|
returns true if a value is stored
|
|
|
Loads this value from the given XMLNode object.
This expects the given
|
|
|
Returns true if this Value is not empty (has a value stored).
|
|
|
Returns true if this Value is empty (contains no stored value).
|
|
|
return !operator==( right );
|
|
|
Assignment operation creates a complete copy of the contents (clones), but does not alter the If you want to create a complete clone, including the name, use the copy constructor. |
|
|
Values are only equal under fairly strict conditions.
|
|
|
Saves this Value to the given XMLNode object, overwriting any colliding content.
This works by storing the necessary information in attributes of the given tag. If any of the attributes already exist, their contents are silently overwritten. |
|
|
sets the name of this Value
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value, stored value is a copy.
|
|
|
Sets the value from a string, parsed into a boolean.
|
|
|
Sets the value from a string, parsed into a Color.
|
|
|
Sets the value from a string, used to look up the Cursor via CursorManager::CreateDefinedCursor().
|
|
|
Sets the value from a string, used to look up the Face.
|
|
|
Sets the value from a string, parsed into a float.
|
|
|
Sets the value from a string, parsed into a Font.
|
|
|
Sets the value from a string, parsed into an FRect.
|
|
|
Sets the value from a string, parsed into an FVector2.
|
|
|
Sets the value from a string, used to look up the Imagery (can be either short name or FQN).
|
|
|
Sets the value from a string, parsed into an int.
|
|
|
Sets the value from a string, parsed into an IRect.
|
|
|
Sets the value from a string, parsed into an IVector2.
|
|
|
Sets the value from a string, parsed into a string. Yes, this is redundant. |
|
|
Sets the value from a string, parsed into a TextAlignment.
|
|
|
Returns a string representation of the stored value.
|