Sierra Toolkit Version of the Day
stk::diag::OptionMaskParser Class Reference

#include <WriterParser.hpp>

Inheritance diagram for stk::diag::OptionMaskParser:
Collaboration diagram for stk::diag::OptionMaskParser:

List of all members.

Public Types

typedef OptionMask Mask
 Mask for this option.

Public Member Functions

 OptionMaskParser ()
virtual ~OptionMaskParser ()
const OptionMaskNameMapgetOptionMaskNameMap () const
virtual Mask parse (const char *mask) const
virtual void parseArg (const std::string &name, const std::string &arg) const
Maskoperator[] (const std::string &name)
void mask (const std::string &name, const Mask l_mask, const std::string &description)
std::ostream & describe (std::ostream &os) const

Protected Attributes

OptionMaskNameMap m_optionMaskNameMap
 Mask name vector.
OptionMask m_optionMask
 Most recently parsed mask.
bool m_status
 Result of most recent parse.

Detailed Description

Class OptionMaskParser defines a mapping between strings and bit masks and output streams.

After populating a Parser object, parse() will parse the input string. The getMask() and virtual getOutputStream() functions will return the print parsed print mask and the selected output stream.

Definition at line 255 of file WriterParser.hpp.


Constructor & Destructor Documentation

stk::diag::OptionMaskParser::OptionMaskParser ( ) [inline]

Creates a new OptionMaskParser instance.

Definition at line 265 of file WriterParser.hpp.

virtual stk::diag::OptionMaskParser::~OptionMaskParser ( ) [inline, virtual]

Destroys a OptionMaskParser instance.

Definition at line 275 of file WriterParser.hpp.


Member Function Documentation

OptionMaskParser::Mask stk::diag::OptionMaskParser::parse ( const char *  mask) const [virtual]

Member function parse parses the string

Parameters:
maska char const pointer of the string to parse.
Returns:
a Mask value of the parsed bitmask.

Reimplemented in stk::diag::WriterParser.

Definition at line 97 of file WriterParser.cpp.

void stk::diag::OptionMaskParser::parseArg ( const std::string &  name,
const std::string &  arg 
) const [virtual]

Member function parseArg parses the argument and its argument values.

Parameters:
namea std::string const reference to the argument name.
arga std::string const reference to the argument values.

Reimplemented in stk::diag::WriterParser.

Definition at line 175 of file WriterParser.cpp.

Mask& stk::diag::OptionMaskParser::operator[] ( const std::string &  name) [inline]

Member function operator[] returns the print mask with the specified name. If the name is not found, a new entry is added.

Parameters:
namea std::string const reference of the name of the mask.
Returns:
a Mask reference of the print mask associated with the print mask name.

Definition at line 312 of file WriterParser.hpp.

void stk::diag::OptionMaskParser::mask ( const std::string &  name,
const Mask  l_mask,
const std::string &  description 
) [inline]

Member function mask adds a named mask to the parser. The mask can also be given a description which is displayed using the describe() function.

Parameters:
namea std::string const reference of the name of the mask.
maska Mask value to associate with the name
descriptiona std::string const reference which describes the mask.

Definition at line 329 of file WriterParser.hpp.

std::ostream & stk::diag::OptionMaskParser::describe ( std::ostream &  os) const [virtual]

Member function describe ...

Parameters:
osa std::ostream variable ...
Returns:
a std::ostream ...

Implements stk::diag::OptionDescription.

Definition at line 194 of file WriterParser.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends