https://mooseframework.inl.gov
SyntaxFormatterInterface.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 <string>
13 #include <ostream>
14 
15 class InputParameters;
16 
23 {
24 public:
26  virtual ~SyntaxFormatterInterface() = default;
27 
33  virtual std::string preamble() const { return std::string(); }
34 
41  virtual std::string postscript() const { return std::string(); }
42 
47  virtual std::string preTraverse(short /*depth*/) const { return std::string(); }
48 
55  virtual std::string
56  printBlockOpen(const std::string & name, short depth, const std::string & doc) = 0;
57 
64  virtual std::string printBlockClose(const std::string & name, short depth) const = 0;
65 
72  virtual std::string printParams(const std::string & prefix,
73  const std::string & fully_qualified_name,
74  InputParameters & params,
75  short depth,
76  const std::string & search_string,
77  bool & found) = 0;
78 };
This interface is for classes that want to be called to format InputParameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual std::string printBlockOpen(const std::string &name, short depth, const std::string &doc)=0
This method is called at the beginning of each Node in the tree.
virtual std::string preamble() const
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)=0
This function is called for each InputParameters object stored at a particular node.
virtual std::string preTraverse(short) const
This method is called once at each node in the syntax tree before traversing child nodes...
virtual std::string printBlockClose(const std::string &name, short depth) const =0
This method is called at the end of of each Node in the tree.
virtual std::string postscript() const
This method is called once at the end of the tree traversal and can be used to add any necessary trai...
virtual ~SyntaxFormatterInterface()=default