tclap 1.4.0
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
TCLAP::DocBookOutput Class Reference

A class that generates DocBook output for usage() method for the given CmdLine and its Args. More...

#include <DocBookOutput.h>

Inheritance diagram for TCLAP::DocBookOutput:
Inheritance graph
[legend]
Collaboration diagram for TCLAP::DocBookOutput:
Collaboration graph
[legend]

Public Member Functions

virtual void usage (CmdLineInterface &c)
 Prints the usage to stdout.
 
virtual void version (CmdLineInterface &c)
 Prints the version to stdout.
 
virtual void failure (CmdLineInterface &c, ArgException &e)
 Prints (to stderr) an error message, short usage Can be overridden to produce alternative behavior.
 
 DocBookOutput ()
 
- Public Member Functions inherited from TCLAP::CmdLineOutput
virtual ~CmdLineOutput ()
 Virtual destructor.
 

Protected Member Functions

void substituteSpecialChars (std::string &s, char r, const std::string &x) const
 Substitutes the char r for string x in string s.
 
void removeChar (std::string &s, char r) const
 
void printShortGroup (const ArgGroup &group, bool labelsOnly)
 
void printShortArg (Arg *it, bool required)
 
void printLongArg (const ArgGroup &it) const
 

Static Protected Member Functions

static std::string escapeXml (const std::string &text)
 
static std::string valueLabel (const Arg &arg)
 
static bool hasVisiblePositional (const ArgGroup &group)
 

Protected Attributes

char theDelimiter
 

Detailed Description

A class that generates DocBook output for usage() method for the given CmdLine and its Args.

Definition at line 44 of file DocBookOutput.h.

Constructor & Destructor Documentation

◆ DocBookOutput()

TCLAP::DocBookOutput::DocBookOutput ( )
inline

Definition at line 68 of file DocBookOutput.h.

Member Function Documentation

◆ escapeXml()

static std::string TCLAP::DocBookOutput::escapeXml ( const std::string &  text)
inlinestaticprotected

Definition at line 72 of file DocBookOutput.h.

Referenced by printShortArg(), and usage().

◆ failure()

void TCLAP::DocBookOutput::failure ( CmdLineInterface &  c,
ArgException &  e 
)
inlinevirtual

Prints (to stderr) an error message, short usage Can be overridden to produce alternative behavior.

Parameters
c- The CmdLine object the output is generated for.
e- The ArgException that caused the failure.

Implements TCLAP::CmdLineOutput.

Definition at line 268 of file DocBookOutput.h.

References TCLAP::ArgException::what().

Here is the call graph for this function:

◆ hasVisiblePositional()

static bool TCLAP::DocBookOutput::hasVisiblePositional ( const ArgGroup &  group)
inlinestaticprotected

Definition at line 114 of file DocBookOutput.h.

References TCLAP::ArgGroup::begin(), and TCLAP::ArgGroup::end().

Here is the call graph for this function:

◆ printLongArg()

void TCLAP::DocBookOutput::printLongArg ( const ArgGroup &  it) const
inlineprotected

Definition at line 317 of file DocBookOutput.h.

References TCLAP::ArgGroup::begin(), TCLAP::CountVisibleArgs(), TCLAP::ArgGroup::end(), TCLAP::ArgGroup::isRequired(), and TCLAP::Arg::visibleInHelp().

Referenced by usage().

Here is the call graph for this function:

◆ printShortArg()

void TCLAP::DocBookOutput::printShortArg ( Arg *  it,
bool  required 
)
inlineprotected

◆ printShortGroup()

void TCLAP::DocBookOutput::printShortGroup ( const ArgGroup &  group,
bool  labelsOnly 
)
inlineprotected

◆ removeChar()

void TCLAP::DocBookOutput::removeChar ( std::string &  s,
char  r 
) const
inlineprotected

Definition at line 283 of file DocBookOutput.h.

◆ substituteSpecialChars()

void TCLAP::DocBookOutput::substituteSpecialChars ( std::string &  s,
char  r,
const std::string &  x 
) const
inlineprotected

Substitutes the char r for string x in string s.

Parameters
s- The string to operate on.
r- The char to replace.
x- What to replace r with.

Definition at line 274 of file DocBookOutput.h.

◆ usage()

void TCLAP::DocBookOutput::usage ( CmdLineInterface &  c)
inlinevirtual

Prints the usage to stdout.

Can be overridden to produce alternative behavior.

Parameters
c- The CmdLine object the output is generated for.

Implements TCLAP::CmdLineOutput.

Definition at line 168 of file DocBookOutput.h.

References escapeXml(), TCLAP::CmdLineInterface::getArgGroups(), TCLAP::CmdLineInterface::getDelimiter(), TCLAP::CmdLineInterface::getMessage(), TCLAP::CmdLineInterface::getProgramName(), TCLAP::CmdLineInterface::getVersion(), printLongArg(), and theDelimiter.

Here is the call graph for this function:

◆ valueLabel()

static std::string TCLAP::DocBookOutput::valueLabel ( const Arg &  arg)
inlinestaticprotected

Definition at line 87 of file DocBookOutput.h.

References TCLAP::Arg::flagStartString(), TCLAP::Arg::getFlag(), TCLAP::Arg::getName(), TCLAP::Arg::nameStartString(), and TCLAP::Arg::shortID().

Here is the call graph for this function:

◆ version()

void TCLAP::DocBookOutput::version ( CmdLineInterface &  c)
inlinevirtual

Prints the version to stdout.

Can be overridden to produce alternative behavior.

Parameters
c- The CmdLine object the output is generated for.

Implements TCLAP::CmdLineOutput.

Definition at line 136 of file DocBookOutput.h.

References TCLAP::CmdLineInterface::getVersion().

Here is the call graph for this function:

Member Data Documentation

◆ theDelimiter

char TCLAP::DocBookOutput::theDelimiter
protected

Definition at line 123 of file DocBookOutput.h.

Referenced by usage().


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