5#include "Foundation/StringView.h"
11 enum class ParsedDataType
42 explicit ValueVariant(
float value) : floatValue(value), type(ParsedDataType::Float) {}
43 explicit ValueVariant(
bool value) : boolValue(value), type(ParsedDataType::Bool) {}
44 explicit ValueVariant(
double value) : doubleValue(value), type(ParsedDataType::Double) {}
45 explicit ValueVariant(
int value) : intValue(value), type(ParsedDataType::Int) {}
46 explicit ValueVariant(
const char * value) : float4x4Value(0.f), stringValue(value), type(ParsedDataType::String) {}
47 explicit ValueVariant(
const StringView & value) : float4x4Value(0.f), stringValue(value.to_string()), type(ParsedDataType::String) {}
48 explicit ValueVariant(glm::vec2 value) : float2Value(value), type(ParsedDataType::Float2) {}
49 explicit ValueVariant(glm::vec3 value) : float3Value(value), type(ParsedDataType::Float3) {}
50 explicit ValueVariant(glm::vec4 value) : float4Value(value), type(ParsedDataType::Float4) {}
52 bool isNumericType(ParsedDataType type)
const;
53 bool isNumeric()
const {
return isNumericType(type); }
54 bool isFloat()
const {
return isNumeric(); }
56 float getFloat(
float defaultValue = 0.0f)
const;
57 double getDouble(
double defaultValue = 0.0)
const;
58 bool getBool(
bool defaultValue =
false)
const;
59 int getInt(
int defaultValue =
false)
const;
60 glm::vec2 getVec2(glm::vec2 defaultValue = {})
const;
61 glm::vec3 getVec3(glm::vec3 defaultValue = {})
const;
62 glm::vec4 getVec4(glm::vec4 defaultValue = {})
const;
65 ParsedDataType getType()
const {
return type; }
73 glm::vec2 float2Value;
74 glm::vec3 float3Value;
75 glm::vec4 float4Value;
76 glm::mat4 float4x4Value;
82 glm::uvec2 uint2Value;
83 glm::uvec3 uint3Value;
84 glm::uvec4 uint4Value;
89 std::string stringValue;
91 ParsedDataType type = ParsedDataType::Unknown;
Provides a weakly referenced view over the contents of a string.
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....