Cogs.Core
Public Member Functions | Public Attributes | List of all members
Cogs::Core::ParsedValue Struct Reference

Stores the parsed output of a key/value pair. More...

#include <Parsing.h>

Public Member Functions

 ParsedValue (const ParsedValue &other)
 
 ParsedValue (ParsedValue &&other) noexcept
 
ParsedValueoperator= (const ParsedValue &other)
 
bool asBool (bool &rv, bool complain=true) const
 
bool asFloat (float &rv, bool complain=true) const
 
bool asInt (int &rv, bool complain=true) const
 

Public Attributes

std::string key
 The input key.
 
std::string value
 The value is available for all non vector types.
 
ParsedDataType type = ParsedDataType::Unknown
 The data type of the value. Determines type stored in union below.
 
size_t valueHash = 0
 The hash is only set for values where the type is explicitly given.
 
size_t dimension = static_cast<size_t>(-1)
 This value is for external use.
 
union {
   float   floatValue
 
   glm::vec2   float2Value
 
   glm::vec3   float3Value
 
   glm::vec4   float4Value
 
   glm::mat4   float4x4Value
 
   int   intValue
 
   glm::ivec2   int2Value
 
   glm::ivec3   int3Value
 
   glm::ivec4   int4Value
 
   uint32_t   uintValue
 
   glm::uvec2   uint2Value
 
   glm::uvec3   uint3Value
 
   glm::uvec4   uint4Value
 
   double   doubleValue
 
   bool   boolValue
 
   struct {
      ParsedValueTextureFlags   flags
 
   }   texture
 
   float   _fill [16] = { 0.f }
 
}; 
 
std::vector< std::pair< size_t, std::string > > expressions
 
std::vector< ParsedValuevalues
 

Detailed Description

Stores the parsed output of a key/value pair.

Definition at line 31 of file Parsing.h.

Constructor & Destructor Documentation

◆ ParsedValue() [1/3]

Cogs::Core::ParsedValue::ParsedValue ( )
inline

Definition at line 33 of file Parsing.h.

◆ ParsedValue() [2/3]

Cogs::Core::ParsedValue::ParsedValue ( const ParsedValue other)

Definition at line 86 of file Parsing.cpp.

◆ ParsedValue() [3/3]

Cogs::Core::ParsedValue::ParsedValue ( ParsedValue &&  other)
noexcept

Definition at line 98 of file Parsing.cpp.

Member Function Documentation

◆ asBool()

bool Cogs::Core::ParsedValue::asBool ( bool &  rv,
bool  complain = true 
) const

Definition at line 125 of file Parsing.cpp.

◆ asFloat()

bool Cogs::Core::ParsedValue::asFloat ( float &  rv,
bool  complain = true 
) const

Definition at line 182 of file Parsing.cpp.

◆ asInt()

bool Cogs::Core::ParsedValue::asInt ( int &  rv,
bool  complain = true 
) const

Definition at line 217 of file Parsing.cpp.

◆ operator=()

Cogs::Core::ParsedValue & Cogs::Core::ParsedValue::operator= ( const ParsedValue other)

Definition at line 110 of file Parsing.cpp.

Member Data Documentation

◆ _fill

float Cogs::Core::ParsedValue::_fill[16] = { 0.f }

Definition at line 73 of file Parsing.h.

◆ boolValue

bool Cogs::Core::ParsedValue::boolValue

Definition at line 69 of file Parsing.h.

◆ dimension

size_t Cogs::Core::ParsedValue::dimension = static_cast<size_t>(-1)

This value is for external use.

Definition at line 50 of file Parsing.h.

◆ doubleValue

double Cogs::Core::ParsedValue::doubleValue

Definition at line 68 of file Parsing.h.

◆ expressions

std::vector<std::pair<size_t, std::string> > Cogs::Core::ParsedValue::expressions

Definition at line 75 of file Parsing.h.

◆ flags

ParsedValueTextureFlags Cogs::Core::ParsedValue::flags

Definition at line 71 of file Parsing.h.

◆ float2Value

glm::vec2 Cogs::Core::ParsedValue::float2Value

Definition at line 56 of file Parsing.h.

◆ float3Value

glm::vec3 Cogs::Core::ParsedValue::float3Value

Definition at line 57 of file Parsing.h.

◆ float4Value

glm::vec4 Cogs::Core::ParsedValue::float4Value

Definition at line 58 of file Parsing.h.

◆ float4x4Value

glm::mat4 Cogs::Core::ParsedValue::float4x4Value

Definition at line 59 of file Parsing.h.

◆ floatValue

float Cogs::Core::ParsedValue::floatValue

Definition at line 55 of file Parsing.h.

◆ int2Value

glm::ivec2 Cogs::Core::ParsedValue::int2Value

Definition at line 61 of file Parsing.h.

◆ int3Value

glm::ivec3 Cogs::Core::ParsedValue::int3Value

Definition at line 62 of file Parsing.h.

◆ int4Value

glm::ivec4 Cogs::Core::ParsedValue::int4Value

Definition at line 63 of file Parsing.h.

◆ intValue

int Cogs::Core::ParsedValue::intValue

Definition at line 60 of file Parsing.h.

◆ key

std::string Cogs::Core::ParsedValue::key

The input key.

Definition at line 39 of file Parsing.h.

◆ type

ParsedDataType Cogs::Core::ParsedValue::type = ParsedDataType::Unknown

The data type of the value. Determines type stored in union below.

Definition at line 45 of file Parsing.h.

◆ uint2Value

glm::uvec2 Cogs::Core::ParsedValue::uint2Value

Definition at line 65 of file Parsing.h.

◆ uint3Value

glm::uvec3 Cogs::Core::ParsedValue::uint3Value

Definition at line 66 of file Parsing.h.

◆ uint4Value

glm::uvec4 Cogs::Core::ParsedValue::uint4Value

Definition at line 67 of file Parsing.h.

◆ uintValue

uint32_t Cogs::Core::ParsedValue::uintValue

Definition at line 64 of file Parsing.h.

◆ value

std::string Cogs::Core::ParsedValue::value

The value is available for all non vector types.

Definition at line 42 of file Parsing.h.

◆ valueHash

size_t Cogs::Core::ParsedValue::valueHash = 0

The hash is only set for values where the type is explicitly given.

Definition at line 47 of file Parsing.h.

◆ values

std::vector<ParsedValue> Cogs::Core::ParsedValue::values

Definition at line 77 of file Parsing.h.


The documentation for this struct was generated from the following files: