Public Member Functions | List of all members
Option Class Reference

The type that options are passed around as. Contains YAML node data and an OptionContext. More...

#include <Options.hpp>

Public Member Functions

const OptionContextcontext () const noexcept
 
void append_context (const std::string &context) noexcept
 Append a line to the contained context.
 
template<typename T , typename Metavariables = NoSuchType>
parse_as () const
 Convert to an object of type T.
 
 Option (YAML::Node node, OptionContext context={}) noexcept
 
 Option (OptionContext context) noexcept
 
const YAML::Node & node () const noexcept
 
void set_node (YAML::Node node) noexcept
 Sets the node and updates the context's mark to correspond to it. More...
 

Detailed Description

The type that options are passed around as. Contains YAML node data and an OptionContext.

Note
To use any methods on this class in a concrete function you must include ParseOptions.hpp, but you do not need to include that header to use this in an uninstantiated create_from_yaml::create function.

Constructor & Destructor Documentation

◆ Option() [1/2]

Option::Option ( YAML::Node  node,
OptionContext  context = {} 
)
inlineexplicitnoexcept
Note
This constructor overwrites the mark data in the supplied context with the one from the node.
Warning
This method is for internal use of the option parser.

◆ Option() [2/2]

Option::Option ( OptionContext  context)
inlineexplicitnoexcept
Warning
This method is for internal use of the option parser.

Member Function Documentation

◆ node()

const YAML::Node & Option::node ( ) const
inlinenoexcept
Warning
This method is for internal use of the option parser.

◆ set_node()

void Option::set_node ( YAML::Node  node)
inlinenoexcept

Sets the node and updates the context's mark to correspond to it.

Warning
This method is for internal use of the option parser.

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