From aba7c45c2c69d402d1b6fc427cde5bfa4661a0e1 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 7 Jan 2009 16:48:35 +0000 Subject: Corrected a couple of places where std:: classes were being used and shouldn't have been. Also made the Unit tests actually use expected values, so you can mark a test as "expected fail" and it'll know. It also prints out cute reports at the end of each run. --- src/paramproc.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/paramproc.cpp') diff --git a/src/paramproc.cpp b/src/paramproc.cpp index 7aeb819..819a4da 100644 --- a/src/paramproc.cpp +++ b/src/paramproc.cpp @@ -121,13 +121,13 @@ Bu::ParamProc::ParamProc() Bu::ParamProc::~ParamProc() { - for( std::list::iterator i = lArg.begin(); + for( Bu::List::iterator i = lArg.begin(); i != lArg.end(); i++ ) { delete *i; } - for( std::list::iterator i = lBan.begin(); + for( Bu::List::iterator i = lBan.begin(); i != lBan.end(); i++ ) { delete *i; @@ -160,12 +160,12 @@ void Bu::ParamProc::addParam( const char *lpWord, char cChar, Proc proc, if( lpValue ) as->sValue = lpValue; - lArg.push_back( as ); + lArg.append( as ); - if( !lBan.empty() ) + if( !lBan.isEmpty() ) { - if( lBan.back()->pBefore == NULL ) - lBan.back()->pBefore = as; + if( lBan.last()->pBefore == NULL ) + lBan.last()->pBefore = as; } } @@ -395,8 +395,8 @@ void Bu::ParamProc::process( int argc, char *argv[] ) Bu::ParamProc::ArgSpec *Bu::ParamProc::checkWord( const char *arg ) { //printf("Checking \"%s\"...\n", arg ); - std::list::const_iterator i; - for( i = lArg.begin(); i != lArg.end(); i++ ) + Bu::List::const_iterator i = lArg.begin(); + for( ; i != lArg.end(); i++ ) { if( (*i)->sWord == "" ) continue; @@ -420,8 +420,8 @@ Bu::ParamProc::ArgSpec *Bu::ParamProc::checkWord( const char *arg ) Bu::ParamProc::ArgSpec *Bu::ParamProc::checkLetr( const char arg ) { //printf("Checking \'%c\'...\n", arg ); - std::list::const_iterator i; - for( i = lArg.begin(); i != lArg.end(); i++ ) + Bu::List::const_iterator i = lArg.begin(); + for( ; i != lArg.end(); i++ ) { if( (*i)->cChar == '\0' ) continue; @@ -449,10 +449,10 @@ int Bu::ParamProc::unknownParam( int /*argc*/, char *argv[] ) int Bu::ParamProc::help( int /*argc*/, char * /*argv*/ [] ) { - std::list::const_iterator b = lBan.begin(); - std::list::const_iterator i; + Bu::List::const_iterator b = lBan.begin(); + Bu::List::const_iterator i = lArg.begin(); int len=0; - for( i = lArg.begin(); i != lArg.end(); i++ ) + for( ; i != lArg.end(); i++ ) { if( len < (*i)->sWord.getSize() + (*i)->sExtra.getSize() ) len = (*i)->sWord.getSize() + (*i)->sExtra.getSize(); @@ -517,6 +517,6 @@ void Bu::ParamProc::addHelpBanner( const char *sHelpBanner ) Banner *pBan = new Banner; pBan->sBanner = sHelpBanner; pBan->pBefore = NULL; - lBan.push_back( pBan ); + lBan.append( pBan ); } -- cgit v1.2.3