15 #ifndef TCLAP_DOCBOOKOUTPUT_H 16 #define TCLAP_DOCBOOKOUTPUT_H 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 =
">";
224 std::string choice =
"opt";
228 std::string repeat =
"norepeat";
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;
void printShortArg(Arg *it)
virtual void version(CmdLineInterface &c)
TCLAP command line argument parser classes.
virtual std::string shortID(const std::string &valueId="val") const
virtual bool isRequired() const
virtual std::string & getVersion()=0
virtual void usage(CmdLineInterface &c)
void printLongArg(Arg *it)
Tclap class indirectly used by children for standardising outputs.
Managing interface for The base class that manages the command line definition and passes along the p...
Virtual parent for all the different argument classes.
std::list< Arg * >::iterator ArgListIterator
virtual std::list< Arg * > & getArgList()=0
virtual void failure(CmdLineInterface &c, ArgException &e)
std::vector< std::vector< Arg * > > & getXorList()
void removeChar(std::string &s, char r)
Defines the exception that is thrown whenever a command line is created and parsed.
virtual XorHandler & getXorHandler()=0
std::vector< Arg * >::iterator ArgVectorIterator
virtual std::string & getMessage()=0
TCLAP command line argument parser classes.
TCLAP command line argument parser classes.
TClap class indirectly used by CmdLine for handling xor'd arguments.
virtual std::string longID(const std::string &valueId="val") const
std::string getDescription() const
bool contains(const Arg *a)
TCLAP command line argument parser classes.
TClap class used for generating docbook output.
virtual bool acceptsMultipleValues()
void substituteSpecialChars(std::string &s, char r, std::string &x)
const char * what() const
virtual std::string & getProgramName()=0