OpenMS
|
Load from JSON (in a Common Workflow Language (CWL) compatible way) into the Param class. More...
#include <OpenMS/FORMAT/ParamJSONFile.h>
Public Member Functions | |
void | store (const std::string &filename, const Param ¶m, const ToolInfo &tool_info) const |
Write Json file with set values. More... | |
void | writeToStream (std::ostream *os_ptr, const Param ¶m) const |
Static Public Member Functions | |
static bool | load (const std::string &filename, Param ¶m) |
Read JSON file that is formatted in CWL conforming style. More... | |
Public Attributes | |
bool | flatHierarchy {} |
If set to true, all parameters will be listed on when writing the JSON file. The names will be expanded to include the nesting hierarchy. More... | |
Load from JSON (in a Common Workflow Language (CWL) compatible way) into the Param class.
The JSON file must contain one top level mapping of param value names to actual values. These values can be one of the following types: - null - boolean - int - long - float - double - string - a CWL style file path ({ "class": "File", "path": "./myFolder/myFile.txt" }) - an array of these param value names match the command line option without the leading '-'. Optionally the ':' can be replaced with a double underscore "__".
Same file with "__" instead of ':' as the section separator.
|
static |
Read JSON file that is formatted in CWL conforming style.
filename | The file from where to read the Param object. |
param | A param object with pre-filled defaults, which are updated by the values in the JSON file |
Exception::FileNotFound | is thrown if the file could not be found |
Exception::ParseError | is thrown if an error occurs during parsing |
Write Json file with set values.
filename | The name of the file the param data structure should be stored in. |
param | The param data structure that should be stored. |
tool_info | unused, required for compatiblity with ParamCWLFile |
std::ios::failure | is thrown if the file could not be created |
void writeToStream | ( | std::ostream * | os_ptr, |
const Param & | param | ||
) | const |
bool flatHierarchy {} |
If set to true, all parameters will be listed on when writing the JSON file. The names will be expanded to include the nesting hierarchy.