lecui 1.0.0-alpha.20
lecui C++ user interface library
Static Public Member Functions | List of all members
liblec::lecui::get Class Reference

Helper class for extracting values from a std::any. Strictly added to enable more terse code and make the code more readable. More...

#include <lecui.h>

Static Public Member Functions

static int integer (const std::any &value)
 Extract integer value. More...
 
static double real (const std::any &value)
 Extract double value. More...
 
static std::string text (const std::any &value)
 Extract text. More...
 

Detailed Description

Helper class for extracting values from a std::any. Strictly added to enable more terse code and make the code more readable.

If the std::any actually contains a different data type than what you expect the methods in this class will throw, so make sure to use a try-catch block in the calling code.

Member Function Documentation

◆ integer()

static int liblec::lecui::get::integer ( const std::any &  value)
static

Extract integer value.

Parameters
valueThe std::any containing the value.
Returns
The integer.

◆ real()

static double liblec::lecui::get::real ( const std::any &  value)
static

Extract double value.

Parameters
valueThe std::any containing the value.
Returns
The double.

◆ text()

static std::string liblec::lecui::get::text ( const std::any &  value)
static

Extract text.

Parameters
valueThe std::any containing the text.
Returns
The text.

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