- token_start = line.find_first_not_of(" ", 0);
- token_end = line.find_first_of(" ", token_start);
- token = line.substr(token_start, token_end - token_start);
+ vector <string> tokens = split(line,' ');
+
+ string command="", argument="", str_value="";
+ if (tokens.size() > 0) {
+ command = to_lower(tokens[0]);
+ if (tokens.size() > 1) {
+ argument = trim(tokens[1]);
+ if (tokens.size() > 2) {
+ str_value = trim(tokens[2]);
+ }
+ }
+ }