A class that isolates any output from the CmdLine object so that it may be easily modified.
Definition at line 50 of file StdOutput.h.
#include <mrpt/otherlibs/tclap/StdOutput.h>
Public Member Functions | |
StdOutput (std::ostream &desired_out=std::cout) | |
Prints the usage to stdout. More... | |
virtual void | usage (CmdLineInterface &c) |
Prints the usage to stdout. More... | |
virtual void | version (CmdLineInterface &c) |
Prints the version to stdout. More... | |
virtual void | failure (CmdLineInterface &c, ArgException &e) |
Prints (to stderr) an error message, short usage Can be overridden to produce alternative behavior. More... | |
Protected Member Functions | |
void | _shortUsage (CmdLineInterface &c, std::ostream &os) const |
Writes a brief usage message with short args. More... | |
void | _longUsage (CmdLineInterface &c, std::ostream &os) const |
Writes a longer usage message with long and short args, provides descriptions and prints message. More... | |
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. More... | |
Protected Attributes | |
std::ostream & | m_my_output |
By JLBC for MRPT. More... | |
|
inline |
Prints the usage to stdout.
Can be overridden to produce alternative behavior.
c | - The CmdLine object the output is generated for. |
Definition at line 61 of file StdOutput.h.
References _longUsage(), _shortUsage(), exprtk::details::numeric::constant::e, failure(), spacePrint(), usage(), and version().
|
inlineprotected |
Writes a longer usage message with long and short args, provides descriptions and prints message.
c | - The CmdLine object the output is generated for. |
os | - The stream to write the message to. |
Definition at line 206 of file StdOutput.h.
References begin(), TCLAP::XorHandler::contains(), end(), TCLAP::CmdLineInterface::getArgList(), TCLAP::CmdLineInterface::getMessage(), TCLAP::CmdLineInterface::getXorHandler(), TCLAP::XorHandler::getXorList(), and spacePrint().
Referenced by StdOutput(), and usage().
|
inlineprotected |
Writes a brief usage message with short args.
c | - The CmdLine object the output is generated for. |
os | - The stream to write the message to. |
Definition at line 172 of file StdOutput.h.
References begin(), TCLAP::XorHandler::contains(), TCLAP::CmdLineInterface::getArgList(), TCLAP::CmdLineInterface::getProgramName(), TCLAP::CmdLineInterface::getXorHandler(), TCLAP::XorHandler::getXorList(), m_my_output, and spacePrint().
Referenced by failure(), StdOutput(), and usage().
|
inlinevirtual |
Prints (to stderr) an error message, short usage Can be overridden to produce alternative behavior.
c | - The CmdLine object the output is generated for. |
e | - The ArgException that caused the failure. |
Implements TCLAP::CmdLineOutput.
Definition at line 149 of file StdOutput.h.
References _shortUsage(), TCLAP::ArgException::argId(), TCLAP::ArgException::error(), TCLAP::CmdLineInterface::getProgramName(), TCLAP::CmdLineInterface::hasHelpAndVersion(), and usage().
Referenced by StdOutput().
|
inlineprotected |
This function inserts line breaks and indents long strings according the params input.
It will only break lines at spaces, commas and pipes.
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. |
Definition at line 244 of file StdOutput.h.
References exprtk::details::numeric::min().
Referenced by _longUsage(), _shortUsage(), and StdOutput().
|
inlinevirtual |
Prints the usage to stdout.
Can be overridden to produce alternative behavior.
c | - The CmdLine object the output is generated for. |
Implements TCLAP::CmdLineOutput.
Definition at line 135 of file StdOutput.h.
References _longUsage(), _shortUsage(), and m_my_output.
Referenced by failure(), and StdOutput().
|
inlinevirtual |
Prints the version to stdout.
Can be overridden to produce alternative behavior.
c | - The CmdLine object the output is generated for. |
Implements TCLAP::CmdLineOutput.
Definition at line 126 of file StdOutput.h.
References TCLAP::CmdLineInterface::getProgramName(), TCLAP::CmdLineInterface::getVersion(), and m_my_output.
Referenced by StdOutput().
|
protected |
By JLBC for MRPT.
Definition at line 53 of file StdOutput.h.
Referenced by _shortUsage(), usage(), and version().
Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Sun Nov 26 00:44:48 UTC 2017 |