Go to the documentation of this file.
15 #ifndef TCLAP_DOCBOOKOUTPUT_H
16 #define TCLAP_DOCBOOKOUTPUT_H
37 class DocBookOutput :
public CmdLineOutput
92 std::vector< std::vector<Arg*> > xorList = xorHandler.
getXorList();
95 std::cout <<
"<?xml version='1.0'?>" << std::endl;
96 std::cout <<
"<!DOCTYPE book PUBLIC \"-//Norman Walsh//DTD DocBk XML V4.2//EN\"" << std::endl;
97 std::cout <<
"\t\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\">" << std::endl << std::endl;
99 std::cout <<
"<book>" << std::endl;
100 std::cout <<
"<refentry>" << std::endl;
102 std::cout <<
"<refmeta>" << std::endl;
103 std::cout <<
"<refentrytitle>" << std::endl;
104 std::cout << progName << std::endl;
105 std::cout <<
"</refentrytitle>" << std::endl;
106 std::cout <<
"<manvolnum>1</manvolnum>" << std::endl;
107 std::cout <<
"</refmeta>" << std::endl;
109 std::cout <<
"<refnamediv>" << std::endl;
110 std::cout <<
"<refname>" << std::endl;
111 std::cout << progName << std::endl;
112 std::cout <<
"</refname>" << std::endl;
113 std::cout <<
"</refnamediv>" << std::endl;
115 std::cout <<
"<cmdsynopsis>" << std::endl;
117 std::cout <<
"<command>" << progName <<
"</command>" << std::endl;
120 for (
int i = 0; (
unsigned int)i < xorList.size(); i++ )
122 std::cout <<
"<group choice='req'>" << std::endl;
124 it != xorList[i].end(); it++ )
127 std::cout <<
"</group>" << std::endl;
132 if ( !xorHandler.
contains( (*it) ) )
135 std::cout <<
"</cmdsynopsis>" << std::endl;
137 std::cout <<
"<refsect1>" << std::endl;
138 std::cout <<
"<title>Description</title>" << std::endl;
139 std::cout <<
"<para>" << std::endl;
141 std::cout <<
"</para>" << std::endl;
142 std::cout <<
"</refsect1>" << std::endl;
144 std::cout <<
"<refsect1>" << std::endl;
145 std::cout <<
"<title>Options</title>" << std::endl;
146 std::cout <<
"<para>" << std::endl;
147 std::cout <<
"<itemizedlist>" << std::endl;
149 for (
int i = 0; (
unsigned int)i < xorList.size(); i++ )
151 std::cout <<
"<itemizedlist>" << std::endl;
152 size_t xlen = xorList.size() - 1;
155 it != xorList[i].end(); it++, xcount++ )
159 std::cout <<
"<listitem>OR</listitem>" << std::endl;
162 std::cout <<
"</itemizedlist>" << std::endl;
167 if ( !xorHandler.
contains( (*it) ) )
170 std::cout <<
"</itemizedlist>" << std::endl;
171 std::cout <<
"</para>" << std::endl;
172 std::cout <<
"</refsect1>" << std::endl;
174 std::cout <<
"<refsect1>" << std::endl;
175 std::cout <<
"<title>Version</title>" << std::endl;
176 std::cout <<
"<para>" << std::endl;
177 std::cout <<
version << std::endl;
178 std::cout <<
"</para>" << std::endl;
179 std::cout <<
"</refsect1>" << std::endl;
181 std::cout <<
"</refentry>" << std::endl;
182 std::cout <<
"</book>" << std::endl;
189 std::cout << e.what() << std::endl;
197 while ( (p = s.find_first_of(r)) != std::string::npos )
207 while ( (p = s.find_first_of(r)) != std::string::npos )
215 std::string lt =
"<";
216 std::string gt =
">";
218 std::string
id = a->shortID();
224 std::string choice =
"opt";
225 if ( a->isRequired() )
228 std::string repeat =
"norepeat";
229 if ( a->acceptsMultipleValues() )
234 std::cout <<
"<arg choice='" << choice
235 <<
"' repeat='" << repeat <<
"'>"
236 <<
id <<
"</arg>" << std::endl;
242 std::string lt =
"<";
243 std::string gt =
">";
245 std::string
id = a->
longID();
255 std::cout <<
"<simplelist>" << std::endl;
257 std::cout <<
"<member>" << std::endl;
258 std::cout <<
id << std::endl;
259 std::cout <<
"</member>" << std::endl;
261 std::cout <<
"<member>" << std::endl;
262 std::cout << desc << std::endl;
263 std::cout <<
"</member>" << std::endl;
265 std::cout <<
"</simplelist>" << std::endl;
TCLAP command line argument parser classes.
TCLAP command line argument parser classes.
virtual void version(CmdLineInterface &c)
virtual std::list< Arg * > & getArgList()=0
TCLAP command line argument parser classes.
void printShortArg(Arg *it)
virtual void usage(CmdLineInterface &c)
std::list< Arg * >::iterator ArgListIterator
virtual std::string & getVersion()=0
TClap class indirectly used by CmdLine for handling xor'd arguments.
TCLAP command line argument parser classes.
std::vector< Arg * >::iterator ArgVectorIterator
std::vector< std::vector< Arg * > > & getXorList()
virtual std::string & getMessage()=0
void printLongArg(Arg *it)
std::string getDescription() const
Virtual parent for all the different argument classes.
Defines the exception that is thrown whenever a command line is created and parsed.
void removeChar(std::string &s, char r)
virtual XorHandler & getXorHandler()=0
virtual void failure(CmdLineInterface &c, ArgException &e)
void substituteSpecialChars(std::string &s, char r, std::string &x)
Managing interface for The base class that manages the command line definition and passes along the p...
bool contains(const Arg *a)
virtual std::string longID(const std::string &valueId="val") const
virtual std::string & getProgramName()=0
ecl_command_line
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:13