DeveloperConsole::Consume for strings

This commit is contained in:
2015-12-29 22:54:07 +01:00
parent c5b4ea84a0
commit c0b31dc92c
+10 -6
View File
@@ -39,21 +39,25 @@ public:
}; };
} }
static void Consume(std::istream& stream) static void Consume(const std::string& command)
{ {
std::string input; if (command.empty()) {
std::getline(stream, input);
if (input.empty()) {
return; return;
} }
boost::char_separator<char> argumentSeparator(" "); boost::char_separator<char> argumentSeparator(" ");
tokenizer tokens(input, argumentSeparator); tokenizer tokens(command, argumentSeparator);
for (tokenizer::const_iterator it = tokens.begin(); it != tokens.end(); it++) { for (tokenizer::const_iterator it = tokens.begin(); it != tokens.end(); it++) {
consumeToken(it, tokens.end()); consumeToken(it, tokens.end());
} }
}
static void Consume(std::istream& stream)
{
std::string input;
std::getline(stream, input);
Consume(input);
/*if (stream.peek() == '\n') { /*if (stream.peek() == '\n') {
printValue(key); printValue(key);