This class produces a dump of the InputFileParameters in the Standard Object Notation (SON) format for use by the Hierarchical Input Validation Engine (HIVE) in the NEAMS Workbench. More...
#include <SONDefinitionFormatter.h>
Public Member Functions | |
SONDefinitionFormatter () | |
std::string | toString (const nlohmann::json &root) |
returns a string representation of the tree in input file format More... | |
Protected Member Functions | |
void | addLine (const std::string &line) |
adds a line to the output with the proper indentation automatically More... | |
void | addBlock (const std::string &block_name, const nlohmann::json &block, bool is_typeblock=false, const std::string &parent_name="", const nlohmann::json ¶meters_in=nlohmann::json(nullptr), const nlohmann::json &subblocks_in=nlohmann::json(nullptr)) |
adds a new block to the output More... | |
void | addParameters (const nlohmann::json ¶ms) |
adds all parameters from a given block More... | |
Protected Attributes | |
const int | _spaces |
int | _level |
std::ostringstream | _stream |
std::map< std::string, std::vector< std::string > > | _assoc_types_map |
nlohmann::json | _global_params |
This class produces a dump of the InputFileParameters in the Standard Object Notation (SON) format for use by the Hierarchical Input Validation Engine (HIVE) in the NEAMS Workbench.
It takes its input from JsonSyntaxTree.
Definition at line 22 of file SONDefinitionFormatter.h.
SONDefinitionFormatter::SONDefinitionFormatter | ( | ) |
Definition at line 15 of file SONDefinitionFormatter.C.
|
protected |
adds a new block to the output
block_name | - name of the block |
block | - json holding data for the block |
parameters_in | - if a typeblock, the parameters for inheritance |
subblocks_in | - if a typeblock, the subblocks for inheritance |
is_typeblock | - true only if block being added is a typeblock |
Definition at line 68 of file SONDefinitionFormatter.C.
Referenced by toString().
|
protected |
adds a line to the output with the proper indentation automatically
line | - the line to add |
Definition at line 58 of file SONDefinitionFormatter.C.
Referenced by addBlock(), and addParameters().
|
protected |
adds all parameters from a given block
params | - json holding data for all of the given block's parameters |
Definition at line 255 of file SONDefinitionFormatter.C.
Referenced by addBlock().
std::string SONDefinitionFormatter::toString | ( | const nlohmann::json & | root | ) |
returns a string representation of the tree in input file format
root | - the root node of the tree to output |
Definition at line 24 of file SONDefinitionFormatter.C.
Referenced by MooseApp::setupOptions().
|
protected |
Definition at line 65 of file SONDefinitionFormatter.h.
Referenced by addParameters(), and toString().
|
protected |
Definition at line 66 of file SONDefinitionFormatter.h.
Referenced by addBlock(), and toString().
|
protected |
Definition at line 63 of file SONDefinitionFormatter.h.
Referenced by addBlock(), and addParameters().
|
protected |
Definition at line 62 of file SONDefinitionFormatter.h.
|
protected |
Definition at line 64 of file SONDefinitionFormatter.h.
Referenced by addLine(), and toString().