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 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...
|
|
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.
◆ integer()
static int liblec::lecui::get::integer |
( |
const std::any & |
value | ) |
|
|
static |
Extract integer value.
- Parameters
-
value | The std::any containing the value. |
- Returns
- The integer.
◆ real()
static double liblec::lecui::get::real |
( |
const std::any & |
value | ) |
|
|
static |
Extract double value.
- Parameters
-
value | The std::any containing the value. |
- Returns
- The double.
◆ text()
static std::string liblec::lecui::get::text |
( |
const std::any & |
value | ) |
|
|
static |
Extract text.
- Parameters
-
value | The std::any containing the text. |
- Returns
- The text.
The documentation for this class was generated from the following file: