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 <CCSDSUtils.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 145 of file CCSDSUtils.h.
Definition at line 147 of file CCSDSUtils.h.
|
inline |
Get value by key and type.
Definition at line 154 of file CCSDSUtils.h.
Definition at line 277 of file CCSDSUtils.cpp.
CCSDS::ResultBool Config::load | ( | const std::string & | filename | ) |
Load config file.
Definition at line 241 of file CCSDSUtils.cpp.
|
staticprivate |
Parse string "[1,2,3]" into vector<uint8_t>
Definition at line 301 of file CCSDSUtils.cpp.
|
staticprivate |
Parse a single line from config.
Definition at line 284 of file CCSDSUtils.cpp.
|
private |
Definition at line 163 of file CCSDSUtils.h.