class EE::UI::Models::Variant¶
#include <variant.hpp> class Variant { public: // enums enum Type; // fields void* asDataPtr { nullptr }; Drawable* asDrawable; UIIcon* asIcon; std::string* asStdString; String* asString; const String* asStringPtr; bool asBool; Float asFloat; int asInt; unsigned int asUint; Int64 asInt64; Uint64 asUint64; Vector2f* asVector2f; Rectf* asRectf; const char* asCStr; // construction Variant(); Variant(const std::string& string); Variant(const String& string); Variant(const String* string); Variant(Drawable* drawable, bool ownDrawable = false); Variant(UIIcon* icon); Variant(const Vector2f& v); Variant(void* data); Variant(const Rectf& r); Variant(bool val); Variant(const Float& val); Variant(const int& val); Variant(const unsigned int& val); Variant(const Int64& val); Variant(const Uint64& val); Variant(const char* data); ~Variant(); // methods const std::string& asStdString() const; const String& asString() const; const String& asStringPtr() const; Drawable* asDrawable() const; const bool& asBool() const; const Float& asFloat() const; const int& asInt() const; const unsigned int& asUint() const; const Int64& asInt64() const; const Uint64& asUint64() const; const Vector2f& asVector2f() const; const Rectf& asRectf() const; const char* asCStr() const; UIIcon* asIcon() const; void* asDataPtr() const; bool is(const Type& type) const; bool isString() const; void reset(); bool isValid() const; std::string toString() const; bool operator<(const Variant& other) const; bool operator==(const Variant& other) const; size_t size() const; };