OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Related Functions | List of all members
openstudio::Variant Class Reference

#include <Variant.hpp>

Public Member Functions

bool valueAsBoolean () const
 get value as a bool More...
 
double valueAsDouble () const
 get value as double More...
 
int valueAsInteger () const
 get value as int More...
 
std::string valueAsString () const
 get value as string More...
 
 Variant ()
 constructors More...
 
 Variant (bool value)
 
 Variant (double value)
 
 Variant (int value)
 
 Variant (const char *value)
 
 Variant (const std::string &value)
 
VariantType variantType () const
 get the variant value type More...
 

Related Functions

(Note that these are not member functions.)

using OptionalVariant = std::optional< Variant >
 
using VariantVector = std::vector< Variant >
 

Detailed Description

A Variant is a flexible type that can hold several types of values.

Constructor & Destructor Documentation

openstudio::Variant::Variant ( )
explicit

constructors

openstudio::Variant::Variant ( bool  value)
explicit
openstudio::Variant::Variant ( double  value)
explicit
openstudio::Variant::Variant ( int  value)
explicit
openstudio::Variant::Variant ( const char *  value)
explicit
openstudio::Variant::Variant ( const std::string &  value)
explicit

Member Function Documentation

bool openstudio::Variant::valueAsBoolean ( ) const

get value as a bool

double openstudio::Variant::valueAsDouble ( ) const

get value as double

int openstudio::Variant::valueAsInteger ( ) const

get value as int

std::string openstudio::Variant::valueAsString ( ) const

get value as string

VariantType openstudio::Variant::variantType ( ) const

get the variant value type

Friends And Related Function Documentation

using OptionalVariant = std::optional<Variant>
related
using VariantVector = std::vector<Variant>
related