1
0
Fork 0

Added findstring remain function to shell and removed fullstring

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@471
This commit is contained in:
Sjoerd van der Berg 2002-10-31 15:18:39 +00:00
parent b226986fc3
commit 0485d33490
2 changed files with 13 additions and 10 deletions

View file

@ -37,8 +37,8 @@ public:
bool FindString(char * name,std::string & value,bool remove=false);
bool FindCommand(int which,std::string & value);
bool FindStringBegin(char * begin,std::string & value, bool remove=false);
bool FindStringRemain(char * name,std::string & value);
int GetCount(void);
void CommandLine::GetFullLine( char * in);
private:
typedef std::list<std::string>::iterator cmd_it;
std::list<std::string> cmds;

View file

@ -325,6 +325,18 @@ bool CommandLine::FindStringBegin(char * begin,std::string & value, bool remove)
return false;
}
bool CommandLine::FindStringRemain(char * name,std::string & value) {
cmd_it it;value="";
if (!FindEntry(name,it)) return false;
it++;
for (;it!=cmds.end();it++) {
value+=" ";
value+=(*it);
}
return true;
}
int CommandLine::GetCount(void) {
return cmds.size();
}
@ -370,12 +382,3 @@ CommandLine::CommandLine(char * name,char * cmdline) {
if (inword || inquote) cmds.push_back(str);
}
void CommandLine::GetFullLine(char * in) {
cmd_it it;
*in=0;
char spatie[2]={' ',0};
for (it=cmds.begin();it!=cmds.end();it++) {
strcat(in,spatie);
strcat(in,(*it).c_str());
}
}