Class SpiceQL::Config
Object for interacting with SpiceQL target configs.More...
#include <config.h>
Public Functions
Type | Name |
---|---|
Config () Construct a new Config object. |
|
Config (std::string json) Construct a new Config object from json file. |
|
bool | contains (std::string key) Check if the given key is in the config. |
std::vector< std::string > | findKey (std::string key, bool recursive) Search for a key inside the config. |
nlohmann::json | get (std::string pointer="") get kernel lists from key |
nlohmann::json | get (std::vector< std::string > pointers) get kernel lists from key vector |
nlohmann::json | getLatest (std::string pointer="") get kernel lists from key but only returns the latest version of each kernel. |
nlohmann::json | getLatestRecursive (std::string pointer="") get kernel list from all instances of a key but only returns the latest version of each kernel. |
std::string | getParentPointer (std::string searchPointer, int pointerPosition=0) Get the pointer at a position of a pointer. |
nlohmann::json | getRecursive (std::string pointer) get kernel list from all instances of a key |
nlohmann::json | globalConf () Get the Global Json object. |
Config | operator[] (std::string pointer) get a value from the config object |
Config | operator[] (std::vector< std::string > pointers) |
unsigned int | size () |
Detailed Description
The config class can wrap multiple config files and give an interface for interacting with the configs and obtaining kernel lists.
Public Functions Documentation
function Config [1/3]
Construct a new Config object.
Loads all config files into a config object.
function Config [2/3]
Construct a new Config object from json file.
Parameters:
json
path to json config file
function contains
Check if the given key is in the config.
Wrapper around nlohmann::json contains to see if the underlying config json contains the given key
Parameters:
key
a key or json style pointer
Returns:
boolean true if key was found, otherwise false
function findKey
Search for a key inside the config.
Parameters:
key
a key or json style pointerrecursive
if true, searches recursively for all matches
Returns:
std::vector<nlohmann::json::json_pointer> vector of pointers to where the key was found
function get [1/2]
get kernel lists from key
Returns a sub group of the JSON where regexes are expanded into file lists.
Parameters:
pointers
key or JSON pointer to subgroup on
Returns:
nlohmann::json merged JSON
function get [2/2]
get kernel lists from key vector
Returns a sub group of the JSON where regexes are expanded into file lists. For each key in the vector, the resulting JSON is merged into a single json object.
Parameters:
pointers
list of keys or JSON pointer to subgroup on
Returns:
nlohmann::json merged JSON
function getLatest
get kernel lists from key but only returns the latest version of each kernel.
Returns a sub group of the JSON where regexes are expanded into file lists containing only the latest kernel versions. For example, insted of a list of all IK kernels you would get the IK with the latest v??? string or similar according to how a specific set of kernels are versioned.
Parameters:
pointers
key or JSON pointer to subgroup on
Returns:
nlohmann::json new JSON subgroup with latest kernels
function getLatestRecursive
get kernel list from all instances of a key but only returns the latest version of each kernel.
Searches recursively for all instances of the input key and returns a new merged JSON object with values of the JSON where regexes are expanded into file lists containing only the latest kernel versions. For example, insted of a list of all IK kernels you would get the IK with the latest v??? string or similar according to how a specific set of kernels are versioned.
Parameters:
pointer
key or JSON pointer to recursively subgroup on
Returns:
nlohmann::json json subgroup with kernels
function getParentPointer
Get the pointer at a position of a pointer.
Parameters:
searchPointer
Pointer/path to be searchedpointerPosition
Position of the pointer to extract
Returns:
std::string pointer at the position in the searchPointer
function getRecursive
get kernel list from all instances of a key
Searches recursively for all instances of the input key and returns a new merged JSON object with values of the JSON where regexes are expanded into file lists.
Parameters:
pointer
key or JSON pointer to recursively subgroup on
Returns:
nlohmann::json json subgroup with kernels
function globalConf
Get the Global Json object.
The global JSON object represents the current SpiceQL config for all frames.
Returns:
nlohmann::json the config file
function operator[]
get a value from the config object
Parameters:
pointer
json pointer to a key inside the config file
Returns:
Config Returns a new config instance representing the sub object
function operator[]
function size
Returns:
unsigned int
The documentation for this class was generated from the following file SpiceQL/include/config.h