VR-Link API Documentation for HLA 1.3
List of all members | Public Member Functions | Protected Member Functions
DtCmdLine::StdOutput Class Reference

A class that isolates any output from the CmdLine object so that it may be easily modified. More...

+ Inheritance diagram for DtCmdLine::StdOutput:
+ Collaboration diagram for DtCmdLine::StdOutput:

Public Member Functions

virtual ~StdOutput ()
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.
- Public Member Functions inherited from DtCmdLine::CmdLineOutput
 CmdLineOutput ()
virtual ~CmdLineOutput ()

Protected Member Functions

void _shortUsage (CmdLineInterface &c, std::ostream &os) const
 Writes a brief usage message with short args.
void _longUsage (CmdLineInterface &c, std::ostream &os) const
 Writes a longer usage message with long and short args, provides descriptions and prints message.
void spacePrint (std::ostream &os, const std::string &s, int maxWidth, int indentSpaces, int secondLineOffset) const
 This function inserts line breaks and indents long strings according the params input.

Detailed Description

A class that isolates any output from the CmdLine object so that it may be easily modified.

Constructor & Destructor Documentation

virtual DtCmdLine::StdOutput::~StdOutput ( )
inlinevirtual

Member Function Documentation

void DtCmdLine::StdOutput::_longUsage ( CmdLineInterface c,
std::ostream &  os 
) const
inlineprotected

Writes a longer usage message with long and short args, provides descriptions and prints message.

Parameters
c- The CmdLine object the output is generated for.
os- The stream to write the message to.

References DtCmdLine::XorHandler::contains(), DtCmdLine::CmdLineInterface::getArgList(), DtCmdLine::CmdLineInterface::getMessage(), DtCmdLine::CmdLineInterface::getXorHandler(), and DtCmdLine::XorHandler::getXorList().

void DtCmdLine::StdOutput::_shortUsage ( CmdLineInterface c,
std::ostream &  os 
) const
inlineprotected

Writes a brief usage message with short args.

Parameters
c- The CmdLine object the output is generated for.
os- The stream to write the message to.

References DtCmdLine::XorHandler::contains(), DtCmdLine::CmdLineInterface::getArgList(), DtCmdLine::CmdLineInterface::getProgramName(), DtCmdLine::CmdLineInterface::getXorHandler(), and DtCmdLine::XorHandler::getXorList().

void DtCmdLine::StdOutput::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 DtCmdLine::CmdLineOutput.

References DtCmdLine::ArgException::argId(), DtNotifyLevel, DtWarn, DtCmdLine::ArgException::error(), and DtCmdLine::CmdLineInterface::getProgramName().

void DtCmdLine::StdOutput::spacePrint ( std::ostream &  os,
const std::string &  s,
int  maxWidth,
int  indentSpaces,
int  secondLineOffset 
) const
inlineprotected

This function inserts line breaks and indents long strings according the params input.

It will only break lines at spaces, commas and pipes.

Parameters
os- The stream to be printed to.
s- The string to be printed.
maxWidth- The maxWidth allowed for the output line.
indentSpaces- The number of spaces to indent the first line.
secondLineOffset- The number of spaces to indent the second and all subsequent lines in addition to indentSpaces.
void DtCmdLine::StdOutput::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 DtCmdLine::CmdLineOutput.

References DtInfo, and DtNotifyLevel.

void DtCmdLine::StdOutput::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 DtCmdLine::CmdLineOutput.

References DtInfo, DtNotifyLevel, DtCmdLine::CmdLineInterface::getProgramName(), and DtCmdLine::CmdLineInterface::getVersion().


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

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)