www.mooseframework.org
Public Member Functions | List of all members
SyntaxFormatterInterface Class Referenceabstract

This interface is for classes that want to be called to format InputParameters. More...

#include <SyntaxFormatterInterface.h>

Inheritance diagram for SyntaxFormatterInterface:
[legend]

Public Member Functions

 SyntaxFormatterInterface ()
 
virtual ~SyntaxFormatterInterface ()=default
 
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 information. More...
 
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 trailing information to the final formatted string. More...
 
virtual std::string preTraverse (short) const
 This method is called once at each node in the syntax tree before traversing child nodes. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

This interface is for classes that want to be called to format InputParameters.

When the syntax tree is traversed, each of these methods are called at the right points to build up a formatted string that can meet a number of different needs.

Definition at line 22 of file SyntaxFormatterInterface.h.

Constructor & Destructor Documentation

◆ SyntaxFormatterInterface()

SyntaxFormatterInterface::SyntaxFormatterInterface ( )
inline

Definition at line 25 of file SyntaxFormatterInterface.h.

25 {}

◆ ~SyntaxFormatterInterface()

virtual SyntaxFormatterInterface::~SyntaxFormatterInterface ( )
virtualdefault

Member Function Documentation

◆ postscript()

virtual std::string SyntaxFormatterInterface::postscript ( ) const
inlinevirtual

This method is called once at the end of the tree traversal and can be used to add any necessary trailing information to the final formatted string.

Returns
- The formatted postscript string

Reimplemented in YAMLFormatter.

Definition at line 41 of file SyntaxFormatterInterface.h.

Referenced by SyntaxTree::print().

41 { return std::string(); }

◆ preamble()

virtual std::string SyntaxFormatterInterface::preamble ( ) const
inlinevirtual

This method is called once at the beginning of the tree traversal and can be used to build up header information.

Returns
- The formatted preamble string

Reimplemented in YAMLFormatter.

Definition at line 33 of file SyntaxFormatterInterface.h.

Referenced by SyntaxTree::print().

33 { return std::string(); }

◆ preTraverse()

virtual std::string SyntaxFormatterInterface::preTraverse ( short  ) const
inlinevirtual

This method is called once at each node in the syntax tree before traversing child nodes.

Returns
- The formatted pre-node traversal string

Reimplemented in YAMLFormatter.

Definition at line 47 of file SyntaxFormatterInterface.h.

47 { return std::string(); }

◆ printBlockClose()

virtual std::string SyntaxFormatterInterface::printBlockClose ( const std::string &  name,
short  depth 
) const
pure virtual

This method is called at the end of of each Node in the tree.

It is typically used to provide formatting necessary when closing blocks.

Returns
- The formatted block close string

Implemented in YAMLFormatter, and InputFileFormatter.

◆ printBlockOpen()

virtual std::string SyntaxFormatterInterface::printBlockOpen ( const std::string &  name,
short  depth,
const std::string &  doc 
)
pure virtual

This method is called at the beginning of each Node in the tree.

It is typically used to provide formatting necessary when opening new blocks.

Returns
- The formatted block open string

Implemented in YAMLFormatter, and InputFileFormatter.

◆ printParams()

virtual std::string SyntaxFormatterInterface::printParams ( const std::string &  prefix,
const std::string &  fully_qualified_name,
InputParameters params,
short  depth,
const std::string &  search_string,
bool &  found 
)
pure virtual

This function is called for each InputParameters object stored at a particular node.

It is responsible for formatting the parameters for the current node.

Returns
- The formatted parameters string for a Node.

Implemented in YAMLFormatter, and InputFileFormatter.


The documentation for this class was generated from the following file: