22 #ifndef TCLAP_DOCBOOKOUTPUT_H
23 #define TCLAP_DOCBOOKOUTPUT_H
97 std::vector< std::vector<Arg*> > xorList = xorHandler.
getXorList();
100 std::cout <<
"<?xml version='1.0'?>" << std::endl;
101 std::cout <<
"<!DOCTYPE book PUBLIC \"-//Norman Walsh//DTD DocBk XML V4.2//EN\"" << std::endl;
102 std::cout <<
"\t\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\">" << std::endl << std::endl;
104 std::cout <<
"<book>" << std::endl;
105 std::cout <<
"<refentry>" << std::endl;
107 std::cout <<
"<refmeta>" << std::endl;
108 std::cout <<
"<refentrytitle>" << std::endl;
109 std::cout << progName << std::endl;
110 std::cout <<
"</refentrytitle>" << std::endl;
111 std::cout <<
"<manvolnum>1</manvolnum>" << std::endl;
112 std::cout <<
"</refmeta>" << std::endl;
114 std::cout <<
"<refnamediv>" << std::endl;
115 std::cout <<
"<refname>" << std::endl;
116 std::cout << progName << std::endl;
117 std::cout <<
"</refname>" << std::endl;
118 std::cout <<
"</refnamediv>" << std::endl;
120 std::cout <<
"<cmdsynopsis>" << std::endl;
122 std::cout <<
"<command>" << progName <<
"</command>" << std::endl;
125 for (
int i = 0; (
unsigned int)i < xorList.size(); i++ )
127 std::cout <<
"<group choice='req'>" << std::endl;
129 it != xorList[i].end(); it++ )
132 std::cout <<
"</group>" << std::endl;
137 if ( !xorHandler.
contains( (*it) ) )
140 std::cout <<
"</cmdsynopsis>" << std::endl;
142 std::cout <<
"<refsect1>" << std::endl;
143 std::cout <<
"<title>Description</title>" << std::endl;
144 std::cout <<
"<para>" << std::endl;
146 std::cout <<
"</para>" << std::endl;
147 std::cout <<
"</refsect1>" << std::endl;
149 std::cout <<
"<refsect1>" << std::endl;
150 std::cout <<
"<title>Options</title>" << std::endl;
151 std::cout <<
"<para>" << std::endl;
152 std::cout <<
"<itemizedlist>" << std::endl;
154 for (
int i = 0; (
unsigned int)i < xorList.size(); i++ )
156 std::cout <<
"<itemizedlist>" << std::endl;
157 size_t xlen = xorList.size() - 1;
160 it != xorList[i].end(); it++, xcount++ )
164 std::cout <<
"<listitem>OR</listitem>" << std::endl;
167 std::cout <<
"</itemizedlist>" << std::endl;
172 if ( !xorHandler.
contains( (*it) ) )
175 std::cout <<
"</itemizedlist>" << std::endl;
176 std::cout <<
"</para>" << std::endl;
177 std::cout <<
"</refsect1>" << std::endl;
179 std::cout <<
"<refsect1>" << std::endl;
180 std::cout <<
"<title>Version</title>" << std::endl;
181 std::cout <<
"<para>" << std::endl;
182 std::cout << version << std::endl;
183 std::cout <<
"</para>" << std::endl;
184 std::cout <<
"</refsect1>" << std::endl;
186 std::cout <<
"</refentry>" << std::endl;
187 std::cout <<
"</book>" << std::endl;
194 std::cout << e.
what() << std::endl;
202 while ( (p = s.find_first_of(r)) != std::string::npos )
212 while ( (p = s.find_first_of(r)) != std::string::npos )
220 std::string lt =
"<";
221 std::string gt =
">";
229 std::string choice =
"opt";
233 std::string repeat =
"norepeat";
239 std::cout <<
"<arg choice='" << choice
240 <<
"' repeat='" << repeat <<
"'>"
241 <<
id <<
"</arg>" << std::endl;
247 std::string lt =
"<";
248 std::string gt =
">";
250 std::string
id = a->
longID();
260 std::cout <<
"<simplelist>" << std::endl;
262 std::cout <<
"<member>" << std::endl;
263 std::cout <<
id << std::endl;
264 std::cout <<
"</member>" << std::endl;
266 std::cout <<
"<member>" << std::endl;
267 std::cout << desc << std::endl;
268 std::cout <<
"</member>" << std::endl;
270 std::cout <<
"</simplelist>" << std::endl;