22 #ifndef DtCmdLine_DOCBOOKOUTPUT_H
23 #define DtCmdLine_DOCBOOKOUTPUT_H
40 #ifdef DtUSE_UTILITIES_NAMESPACE
41 namespace DtUSE_UTILITIES_NAMESPACE
88 void substituteSpecialChars( std::string& s,
char r, std::string& x );
102 std::vector< std::vector<Arg*> > xorList = xorHandler.
getXorList();
105 std::cout <<
"<?xml version='1.0'?>" << std::endl;
106 std::cout <<
"<!DOCTYPE book PUBLIC \"-//Norman Walsh//DTD DocBk XML V4.2//EN\"" << std::endl;
107 std::cout <<
"\t\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\">" << std::endl << std::endl;
109 std::cout <<
"<book>" << std::endl;
110 std::cout <<
"<cmdsynopsis>" << std::endl;
112 std::cout <<
"<command>" << progName <<
"</command>" << std::endl;
114 std::string lt =
"<";
115 std::string gt =
">";
118 for (
int i = 0; (
unsigned int)i < xorList.size(); i++ )
120 std::cout <<
"<group>" << std::endl;
122 it != xorList[i].end(); it++ )
124 std::string
id = (*it)->shortID();
125 substituteSpecialChars(
id,
'<',lt);
126 substituteSpecialChars(
id,
'>',gt);
127 std::cout <<
"<arg>" <<
id <<
"</arg>" << std::endl;
130 std::cout <<
"</group>" << std::endl;
134 if ( !xorHandler.
contains( (*it) ) )
136 std::string
id = (*it)->shortID();
137 substituteSpecialChars(
id,
'<',lt);
138 substituteSpecialChars(
id,
'>',gt);
139 std::cout <<
"<arg>" <<
id <<
"</arg>" << std::endl;
142 std::cout <<
"</cmdsynopsis>" << std::endl;
143 std::cout <<
"</book>" << std::endl;
150 std::cout << e.
what() << std::endl;
153 inline void DocBookOutput::substituteSpecialChars( std::string& s,
158 while ( (p = s.find_first_of(r)) != std::string::npos )
167 #ifdef DtUSE_UTILITIES_NAMESPACE