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 InputFileParameters. 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 InputFileParameters.

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

Definition at line 32 of file SyntaxFormatterInterface.h.

Constructor & Destructor Documentation

SyntaxFormatterInterface::SyntaxFormatterInterface ( )
inline

Definition at line 35 of file SyntaxFormatterInterface.h.

35 {}
virtual SyntaxFormatterInterface::~SyntaxFormatterInterface ( )
virtualdefault

Member Function Documentation

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 51 of file SyntaxFormatterInterface.h.

Referenced by SyntaxTree::print().

51 { return std::string(); }
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 43 of file SyntaxFormatterInterface.h.

Referenced by SyntaxTree::print().

43 { return std::string(); }
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 57 of file SyntaxFormatterInterface.h.

Referenced by SyntaxTree::TreeNode::print().

57 { return std::string(); }
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.

Referenced by preTraverse(), and SyntaxTree::TreeNode::print().

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.

Referenced by preTraverse(), and SyntaxTree::TreeNode::print().

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.

Referenced by preTraverse(), and SyntaxTree::TreeNode::print().


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