X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fgetopt.cpp;h=b8e24132b7718ad39f5e3ed63abff7635d1d260c;hb=cfc8e0b7b15ea505bd6a6a9599cbc5ce1e316963;hp=67c4d4171d1ada94d8077f461175c40878fed669;hpb=521cf1db00f8ce2d9f9494dca503d6c17d89ac2f;p=libs%2Fcore.git diff --git a/source/core/getopt.cpp b/source/core/getopt.cpp index 67c4d41..b8e2413 100644 --- a/source/core/getopt.cpp +++ b/source/core/getopt.cpp @@ -10,6 +10,12 @@ using namespace std; namespace Msp { +GetOpt::~GetOpt() +{ + for(list::iterator i=opts.begin(); i!=opts.end(); ++i) + delete *i; +} + /** Generates a single line that gives an overview about the known options. @@ -114,12 +120,6 @@ void GetOpt::operator()(unsigned argc, const char *const *argv) args.push_back(argv[i]); } -GetOpt::~GetOpt() -{ - for(list::iterator i=opts.begin(); i!=opts.end(); ++i) - delete *i; -} - GetOpt::OptBase &GetOpt::get_option(char s) { for(list::iterator i=opts.begin(); i!=opts.end(); ++i) @@ -150,7 +150,7 @@ unsigned GetOpt::process_long(const char *const *argp) // See if the argument contains an = unsigned equals=0; - for(; arg[equals] && arg[equals]!='='; ++equals); + for(; arg[equals] && arg[equals]!='='; ++equals) ; OptBase &opt=get_option(string(arg, equals));