Public Member Functions | Protected Member Functions | List of all members
ecl::StdOutput Class Reference

TClap class indirectly used to handle CmdLine arguments. More...

#include <std_output.hpp>

Inheritance diagram for ecl::StdOutput:
Inheritance graph
[legend]

Public Member Functions

virtual void failure (CmdLineInterface &c, ArgException &e)
 
virtual void usage (CmdLineInterface &c)
 
virtual void version (CmdLineInterface &c)
 
- Public Member Functions inherited from ecl::CmdLineOutput
virtual ~CmdLineOutput ()
 

Protected Member Functions

void _longUsage (CmdLineInterface &c, std::ostream &os) const
 
void _shortUsage (CmdLineInterface &c, std::ostream &os) const
 
void spacePrint (std::ostream &os, const std::string &s, int maxWidth, int indentSpaces, int secondLineOffset) const
 

Detailed Description

TClap class indirectly used to handle CmdLine arguments.

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

Definition at line 38 of file std_output.hpp.

Member Function Documentation

◆ _longUsage()

void ecl::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.

Definition at line 184 of file std_output.hpp.

◆ _shortUsage()

void ecl::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.

Definition at line 149 of file std_output.hpp.

◆ failure()

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

Definition at line 126 of file std_output.hpp.

◆ spacePrint()

void ecl::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.

Definition at line 222 of file std_output.hpp.

◆ usage()

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

Definition at line 112 of file std_output.hpp.

◆ version()

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

Definition at line 103 of file std_output.hpp.


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


ecl_command_line
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:18:23