|
CCSDSPack
C++ Library for CCSDS Space Packet manipulation. i.e. generation, extraction, analisys and more
|
Parses and stores config values from custom file format. More...
#include <CCSDSConfig.h>
Public Types | |
| using | ConfigValue = std::variant< std::string, int, float, bool, std::vector< uint8_t > > |
Public Member Functions | |
| CCSDS::ResultBool | load (const std::string &filename) |
| Load config file. | |
| template<typename T > | |
| CCSDS::Result< T > | get (const std::string &key) const |
| Get value by key and type. | |
| bool | isKey (const std::string &key) const |
Static Private Member Functions | |
| static std::tuple< std::string, std::string, std::string > | parseLine (const std::string &line) |
| Parse a single line from config. | |
| static CCSDS::ResultBuffer | parseBytes (const std::string &valueStr) |
| Parse string "[1,2,3]" into vector<uint8_t> | |
Private Attributes | |
| std::unordered_map< std::string, ConfigValue > | values |
Parses and stores config values from custom file format.
Definition at line 11 of file CCSDSConfig.h.
Definition at line 13 of file CCSDSConfig.h.
|
inline |
Get value by key and type.
Definition at line 20 of file CCSDSConfig.h.
Definition at line 48 of file CCSDSConfig.cpp.
| CCSDS::ResultBool Config::load | ( | const std::string & | filename | ) |
Load config file.
Definition at line 12 of file CCSDSConfig.cpp.
|
staticprivate |
Parse string "[1,2,3]" into vector<uint8_t>
Definition at line 72 of file CCSDSConfig.cpp.
|
staticprivate |
Parse a single line from config.
Definition at line 55 of file CCSDSConfig.cpp.
|
private |
Definition at line 33 of file CCSDSConfig.h.