summaryrefslogtreecommitdiffstats
path: root/src/Client
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-27 01:55:44 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-27 01:55:44 +0200
commite1d8490f0654a3da0b900407d80d91d8d0da68c8 (patch)
treed65b4bd4a596a98061e094120b6a1aed388d1c89 /src/Client
parentd88c486ae403bee8f4b16e4bdf9daf19f8915eed (diff)
downloadmad-e1d8490f0654a3da0b900407d80d91d8d0da68c8.tar
mad-e1d8490f0654a3da0b900407d80d91d8d0da68c8.zip
Use libicu to support unicode properly; migrated ConfigManager to UnicodeString
Diffstat (limited to 'src/Client')
-rw-r--r--src/Client/CommandParser.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp
index 3f1850c..a271860 100644
--- a/src/Client/CommandParser.cpp
+++ b/src/Client/CommandParser.cpp
@@ -213,19 +213,26 @@ void CommandParser::exitCommand(const std::vector<std::string> &/*args*/) {
}
bool CommandParser::parse(const std::string &cmd) {
- std::vector<std::string> splitCmd;
+ std::vector<Core::UnicodeString> splitCmd;
- Core::Tokenizer::tokenize(cmd, splitCmd);
+ Core::Tokenizer::tokenize(cmd.c_str(), splitCmd);
if(splitCmd.empty())
return true;
- const Command* command = findCommand(splitCmd[0]);
+ const Command* command = findCommand(splitCmd[0].extract());
- if(command)
- command->function(this, splitCmd);
- else
- std::cerr << "Unknown command '" << splitCmd[0] << "'." << std::endl;
+ if(command) {
+ std::vector<std::string> strings;
+
+ for(std::vector<Core::UnicodeString>::iterator it = splitCmd.begin(); it != splitCmd.end(); ++it)
+ strings.push_back(it->extract());
+
+ command->function(this, strings);
+ }
+ else {
+ std::cerr << "Unknown command '" << splitCmd[0].extract() << "'." << std::endl;
+ }
return true;
}