00001 #include "ICommand.h"
00002
00003 ICommand::ICommand(std::string ¶ms)
00004 :myParameters(params)
00005 {
00006 }
00007
00008 ICommand::~ICommand()
00009 {
00010 }
00011
00012 std::string ICommand::getParam(Uint16 param, bool toTheEnd){
00013 std::string tmpString;
00014 std::string::size_type spos, epos;
00015
00016 tmpString = this->myParameters;
00017
00018
00019 for(int counter = 0; counter < param; counter++){
00020 spos = tmpString.find(" ");
00021 if(spos != std::string::npos)
00022 tmpString.assign(tmpString, (spos+1), tmpString.size());
00023 }
00024
00025 if(spos != std::string::npos){
00026 if(!toTheEnd){
00027 epos = tmpString.find(" ");
00028 tmpString.assign(tmpString, 0, epos);
00029 }
00030 }
00031 else
00032 tmpString = "";
00033
00034
00035 return tmpString;
00036
00037 }