#include "acidlaunch.h" /*ArgList::ArgList() {}*/ void ArgList::append(const char* str) { char* arg; int j=0; arg = new char[strlen(str)]; while(1) { int i=0; /* copy a line from str to arg */ // skip the 'file:' URI header if found if(!strncmp((str + j), "file:", 5)) { j+=5; } while(str[j]!='\r' && str[j]!='\n' && str[j]!=0 && j < strlen(str)) { arg[i++]=str[j++]; } arg[i]='\0'; // terminate the arg string //cout << "arg found: " << arg << endl; while((str[j]=='\r' || str[j]=='\n') && j < strlen(str)) { j++; } _args.push_back(new string(arg)); // add the arg to the list if(str[j]=='\0') break; // return char = end of list } delete[] arg; } const string& ArgList::get(int arg) const { return *_args[arg]; } int ArgList::size() const { return _args.size(); } string ArgList::getArgString() { string arglist; int i; for(i=0; i<_args.size(); i++) { arglist+="'"; arglist+=*_args[i]; arglist+="' "; } return arglist; } ArgList::~ArgList() { int i; for(i=0; i<_args.size(); i++) { delete _args[i]; } }