Hyprlang
A fast and user-friendly configuration language
Loading...
Searching...
No Matches
Hyprlang::CConfigValue Class Reference

#include <hyprlang.hpp>

Public Member Functions

 CConfigValue ()
 
 CConfigValue (const INT value)
 
 CConfigValue (const FLOAT value)
 
 CConfigValue (const STRING value)
 
 CConfigValue (const VEC2 value)
 
 CConfigValue (CUSTOMTYPE &&value)
 
 CConfigValue (CConfigValue &&)=delete
 
 CConfigValue (const CConfigValue &&)=delete
 
 CConfigValue (CConfigValue &)=delete
 
 CConfigValue (const CConfigValue &)
 
 ~CConfigValue ()
 
void * dataPtr () const
 
void *const * getDataStaticPtr () const
 
std::any getValue () const
 

Public Attributes

bool m_bSetByUser = false
 

Friends

class CConfig
 

Detailed Description

Container for a config value

Constructor & Destructor Documentation

◆ CConfigValue() [1/10]

Hyprlang::CConfigValue::CConfigValue ( )

◆ CConfigValue() [2/10]

Hyprlang::CConfigValue::CConfigValue ( const INT value)

◆ CConfigValue() [3/10]

Hyprlang::CConfigValue::CConfigValue ( const FLOAT value)

◆ CConfigValue() [4/10]

Hyprlang::CConfigValue::CConfigValue ( const STRING value)

◆ CConfigValue() [5/10]

Hyprlang::CConfigValue::CConfigValue ( const VEC2 value)

◆ CConfigValue() [6/10]

Hyprlang::CConfigValue::CConfigValue ( CUSTOMTYPE && value)

◆ CConfigValue() [7/10]

Hyprlang::CConfigValue::CConfigValue ( CConfigValue && )
delete

◆ CConfigValue() [8/10]

Hyprlang::CConfigValue::CConfigValue ( const CConfigValue && )
delete

◆ CConfigValue() [9/10]

Hyprlang::CConfigValue::CConfigValue ( CConfigValue & )
delete

◆ CConfigValue() [10/10]

Hyprlang::CConfigValue::CConfigValue ( const CConfigValue & )
Since
0.3.0

◆ ~CConfigValue()

Hyprlang::CConfigValue::~CConfigValue ( )

Member Function Documentation

◆ dataPtr()

void * Hyprlang::CConfigValue::dataPtr ( ) const

Return a pointer to the data. Prefer getDataStaticPtr()

◆ getDataStaticPtr()

void *const * Hyprlang::CConfigValue::getDataStaticPtr ( ) const
Since
0.2.0

Return a static pointer to the m_pData. As long as this configValue is alive, this pointer is valid. CConfigValues are alive as long as the owning CConfig is alive.

Please note only the first (outer) pointer is static. The second may (and most likely will) be changing.

For all types except STRING typeof(**retval) is the config value type (e.g. INT or FLOAT)

Please note STRING is a special type and instead of typeof(**retval) being const char*, typeof(*retval) is a const char*.

◆ getValue()

std::any Hyprlang::CConfigValue::getValue ( ) const
inline

Get the contained value as an std::any. For strings, this is a const char*. For custom data types, this is a void* representing the data ptr stored by it.

Friends And Related Symbol Documentation

◆ CConfig

friend class CConfig
friend

Member Data Documentation

◆ m_bSetByUser

bool Hyprlang::CConfigValue::m_bSetByUser = false
Since
0.3.0

a flag to notify whether this value has been set explicitly by the user, or not.


The documentation for this class was generated from the following file: