cleaned up iterator names

This commit is contained in:
mes5k 2004-12-01 03:11:25 +00:00
parent d584e762ce
commit e02172004f
4 changed files with 19 additions and 10 deletions

View File

@ -332,11 +332,21 @@ class Arg
}; };
/** /**
* Typedef of a list iterator. * Typedef of an Arg list iterator.
*/
typedef std::list<Arg*>::iterator ArgListIterator;
/**
* Typedef of an Arg vector iterator.
*/ */
typedef std::list<Arg*>::iterator ArgIterator;
typedef std::vector<Arg*>::iterator ArgVectorIterator; typedef std::vector<Arg*>::iterator ArgVectorIterator;
/**
* Typedef of a Visitor list iterator.
*/
typedef std::list<Visitor*>::iterator VisitorListIterator;
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
//BEGIN Arg.cpp //BEGIN Arg.cpp
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -278,8 +278,8 @@ inline CmdLine::CmdLine(const std::string& m,
inline CmdLine::~CmdLine() inline CmdLine::~CmdLine()
{ {
std::list<Arg*>::iterator argIter; ArgListIterator argIter;
std::list<Visitor*>::iterator visIter; VisitorListIterator visIter;
for( argIter = _argDeleteOnExitList.begin(); for( argIter = _argDeleteOnExitList.begin();
argIter != _argDeleteOnExitList.end(); argIter != _argDeleteOnExitList.end();
@ -354,8 +354,8 @@ inline void CmdLine::add( Arg& a )
inline void CmdLine::add( Arg* a ) inline void CmdLine::add( Arg* a )
{ {
for( ArgIterator iter = _argList.begin(); iter != _argList.end(); iter++ ) for( ArgListIterator it = _argList.begin(); it != _argList.end(); it++ )
if ( *a == *(*iter) ) if ( *a == *(*it) )
throw( SpecificationException( throw( SpecificationException(
"Argument with same flag/name already exists!", "Argument with same flag/name already exists!",
a->longID() ) ); a->longID() ) );
@ -382,7 +382,7 @@ inline void CmdLine::parse(int argc, char** argv)
for (int i = 0; (unsigned int)i < args.size(); i++) for (int i = 0; (unsigned int)i < args.size(); i++)
{ {
bool matched = false; bool matched = false;
for (ArgIterator it = _argList.begin(); it != _argList.end(); it++) for (ArgListIterator it = _argList.begin(); it != _argList.end(); it++)
{ {
if ( (*it)->processArg( &i, args ) ) if ( (*it)->processArg( &i, args ) )
{ {

View File

@ -27,7 +27,6 @@
#include <vector> #include <vector>
#include <list> #include <list>
#include <iostream> #include <iostream>
#include <ostream>
#include <iomanip> #include <iomanip>
#include <algorithm> #include <algorithm>

View File

@ -167,7 +167,7 @@ inline void StdOutput::_shortUsage( CmdLineInterface& _cmd,
} }
// then the rest // then the rest
for (ArgIterator it = argList.begin(); it != argList.end(); it++) for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
if ( !xorHandler.contains( (*it) ) ) if ( !xorHandler.contains( (*it) ) )
s += " " + (*it)->shortID(); s += " " + (*it)->shortID();
@ -199,7 +199,7 @@ inline void StdOutput::_longUsage( CmdLineInterface& _cmd,
} }
// then the rest // then the rest
for (ArgIterator it = argList.begin(); it != argList.end(); it++) for (ArgListIterator it = argList.begin(); it != argList.end(); it++)
if ( !xorHandler.contains( (*it) ) ) if ( !xorHandler.contains( (*it) ) )
{ {
spacePrint( os, (*it)->longID(), 75, 3, 3 ); spacePrint( os, (*it)->longID(), 75, 3, 3 );