https://mooseframework.inl.gov
Loading...
Searching...
No Matches
YAMLFormatter.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "SyntaxTree.h"
13#include "InputParameters.h"
14
15#include <sstream>
16#include <iterator>
17
23{
24public:
25 YAMLFormatter(bool dump_mode);
26
27 virtual std::string preamble() const override;
28 virtual std::string postscript() const override;
29
30 virtual std::string preTraverse(short depth) const override;
31 virtual std::string
32 printBlockOpen(const std::string & name, short depth, const std::string & doc) override;
33 virtual std::string printBlockClose(const std::string & name, short depth) const override;
34 virtual std::string printParams(const std::string & prefix,
35 const std::string & fully_qualified_name,
36 InputParameters & params,
37 short depth,
38 const std::string & search_string,
39 bool & found) override;
40 template <typename T>
41 void addEnumOptionsAndDocs(std::ostringstream & oss, T & param, const std::string & indent);
42
43protected:
45
51 void buildOutputString(std::ostringstream & output,
52 const std::iterator_traits<InputParameters::iterator>::value_type & p);
53};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
This class produces produces a yaml dump of the InputParameters that is machine parsable by any YAML ...
virtual std::string printBlockOpen(const std::string &name, short depth, const std::string &doc) override
This method is called at the beginning of each Node in the tree.
void buildOutputString(std::ostringstream &output, const std::iterator_traits< InputParameters::iterator >::value_type &p)
Method for building an output string that accounts for specific types (e.g., Point)
virtual std::string preamble() const override
This method is called once at the beginning of the tree traversal and can be used to build up header ...
virtual std::string printParams(const std::string &prefix, const std::string &fully_qualified_name, InputParameters &params, short depth, const std::string &search_string, bool &found) override
This function is called for each InputParameters object stored at a particular node.
virtual std::string postscript() const override
This method is called once at the end of the tree traversal and can be used to add any necessary trai...
virtual std::string preTraverse(short depth) const override
This method is called once at each node in the syntax tree before traversing child nodes.
void addEnumOptionsAndDocs(std::ostringstream &oss, T &param, const std::string &indent)
virtual std::string printBlockClose(const std::string &name, short depth) const override
This method is called at the end of of each Node in the tree.