Logo Search packages:      
Sourcecode: passwordmaker-cli version File versions  Download package

void TCLAP::StdOutput::_longUsage ( CmdLineInterface c,
std::ostream &  os 
) const [inline, protected]

Writes a longer usage message with long and short args, provides descriptions and prints message.

Parameters:
c- The CmdLine object the output is generated for.
os- The stream to write the message to.

Definition at line 182 of file StdOutput.h.

References TCLAP::XorHandler::contains(), TCLAP::CmdLineInterface::getArgList(), TCLAP::CmdLineInterface::getMessage(), TCLAP::CmdLineInterface::getXorHandler(), and spacePrint().

Referenced by usage().

{
      std::list<Arg*> argList = _cmd.getArgList();
      std::string message = _cmd.getMessage();
      XorHandler xorHandler = _cmd.getXorHandler();
      std::vector< std::vector<Arg*> > xorList = xorHandler.getXorList();

      // first the xor 
      for ( int i = 0; (unsigned int)i < xorList.size(); i++ )
      {
            for ( ArgVectorIterator it = xorList[i].begin(); 
                    it != xorList[i].end(); 
                    it++ )
            {
                  spacePrint( os, (*it)->longID(), 75, 3, 3 );
                  spacePrint( os, (*it)->getDescription(), 75, 5, 0 );

                  if ( it+1 != xorList[i].end() )
                        spacePrint(os, "-- OR --", 75, 9, 0);
            }
            os << std::endl << std::endl;
      }

      // then the rest
      for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
            if ( !xorHandler.contains( (*it) ) )
            {
                  spacePrint( os, (*it)->longID(), 75, 3, 3 ); 
                  spacePrint( os, (*it)->getDescription(), 75, 5, 0 ); 
                  os << std::endl;
            }

      os << std::endl;

      spacePrint( os, message, 75, 3, 0 );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index