23 #ifndef TCLAP_STDCMDLINEOUTPUT_H 24 #define TCLAP_STDCMDLINEOUTPUT_H 103 int secondLineOffset )
const;
113 std::cout << std::endl << progName <<
" version: " 114 << xversion << std::endl << std::endl;
119 std::cout << std::endl <<
"USAGE: " << std::endl << std::endl;
123 std::cout << std::endl << std::endl <<
"Where: " << std::endl << std::endl;
137 <<
" " << e.
error() << std::endl << std::endl;
141 std::cerr <<
"Brief USAGE: " << std::endl;
145 std::cerr << std::endl <<
"For complete USAGE and HELP type: " 146 << std::endl <<
" " << progName <<
" --help" 147 << std::endl << std::endl;
157 std::ostream& os )
const 162 std::vector< std::vector<Arg*> > xorList = xorHandler.
getXorList();
167 for (
int i = 0;
static_cast<unsigned int>(
i) < xorList.size();
i++ )
171 it != xorList[
i].end();
it++ )
172 s += (*it)->shortID() +
"|";
174 s[s.length()-1] =
'}';
180 s +=
" " + (*it)->shortID();
183 int secondLineOffset =
static_cast<int>(progName.length()) + 2;
184 if ( secondLineOffset > 75/2 )
185 secondLineOffset =
static_cast<int>(75/2);
192 std::ostream& os )
const 197 std::vector< std::vector<Arg*> > xorList = xorHandler.
getXorList();
200 for (
int i = 0;
static_cast<unsigned int>(
i) < xorList.size();
i++ )
203 it != xorList[
i].end();
207 spacePrint( os, (*it)->getDescription(), 75, 5, 0 );
209 if (
it+1 != xorList[
i].
end() )
212 os << std::endl << std::endl;
220 spacePrint( os, (*it)->getDescription(), 75, 5, 0 );
233 int secondLineOffset )
const 235 int len =
static_cast<int>(s.length());
237 if ( (len + indentSpaces > maxWidth) && maxWidth > 0 )
239 int allowedLen = maxWidth - indentSpaces;
241 while ( start < len )
247 int stringLen = min<int>( len -
start, allowedLen );
250 if ( stringLen == allowedLen )
251 while ( stringLen >= 0 &&
252 s[stringLen+start] !=
' ' &&
253 s[stringLen+start] !=
',' &&
254 s[stringLen+start] !=
'|' )
259 if ( stringLen <= 0 )
260 stringLen = allowedLen;
263 for (
int i = 0;
i < stringLen;
i++ )
264 if ( s[start+
i] ==
'\n' )
268 for (
int i = 0;
i < indentSpaces;
i++ )
274 indentSpaces += secondLineOffset;
277 allowedLen -= secondLineOffset;
280 os << s.substr(start,stringLen) << std::endl;
283 while ( s[stringLen+start] ==
' ' && start < len )
291 for (
int i = 0;
i < indentSpaces;
i++ )
293 os << s << std::endl;
virtual bool hasHelpAndVersion()=0
std::vector< std::vector< Arg * > > & getXorList()
GLenum GLuint GLenum GLsizei const GLchar * message
virtual std::string & getProgramName()=0
virtual void usage(CmdLineInterface &c)
GLsizei const GLchar *const * string
virtual std::list< Arg * > & getArgList()=0
virtual void version(CmdLineInterface &c)
void _longUsage(CmdLineInterface &c, std::ostream &os) const
void _shortUsage(CmdLineInterface &c, std::ostream &os) const
virtual std::string & getVersion()=0
virtual XorHandler & getXorHandler()=0
std::string error() const
std::list< Arg * >::iterator ArgListIterator
bool contains(const Arg *a)
std::vector< Arg * >::iterator ArgVectorIterator
virtual std::string & getMessage()=0
std::string argId() const
virtual void failure(CmdLineInterface &c, ArgException &e)
void spacePrint(std::ostream &os, const std::string &s, int maxWidth, int indentSpaces, int secondLineOffset) const