string literals with lowercase changed into uppercase.

This commit is contained in:
Roland Jax
2014-10-08 16:53:07 +02:00
parent e770f94038
commit 71e1c88cd0
3 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ int calcAreas(const std::string areas)
for (std::vector<std::string>::iterator it = cmd.begin() ; it != cmd.end(); ++it)
for (int i = 0; i < Size_of_Areas; i++) {
if (strcasecmp("all", it->c_str()) == 0)
if (strcasecmp("ALL", it->c_str()) == 0)
return (pow(2, (int)Size_of_Areas) - 1);
if (strcasecmp(AreaNames[i], it->c_str()) == 0)
+8 -8
View File
@@ -75,7 +75,7 @@ void BaseLoop::start()
L.log(bas, event, ">>> %s", data.c_str());
// decode message
if (strcasecmp(data.c_str(), "stop") != 0)
if (strcasecmp(data.c_str(), "STOP") != 0)
result = decodeMessage(data);
else
result = "done";
@@ -90,7 +90,7 @@ void BaseLoop::start()
delete message;
// stop daemon
if (strcasecmp(data.c_str(), "stop") == 0)
if (strcasecmp(data.c_str(), "STOP") == 0)
return;
}
}
@@ -281,8 +281,8 @@ std::string BaseLoop::decodeMessage(const std::string& data)
break;
}
if (strcasecmp(cmd[1].c_str(), "on") == 0) m_ebusloop->dump(true);
if (strcasecmp(cmd[1].c_str(), "off") == 0) m_ebusloop->dump(false);
if (strcasecmp(cmd[1].c_str(), "ON") == 0) m_ebusloop->dump(true);
if (strcasecmp(cmd[1].c_str(), "OFF") == 0) m_ebusloop->dump(false);
result << "done";
break;
@@ -294,13 +294,13 @@ std::string BaseLoop::decodeMessage(const std::string& data)
}
// ToDo: check for possible areas and level
if (strcasecmp(cmd[1].c_str(), "areas") == 0) {
if (strcasecmp(cmd[1].c_str(), "AREAS") == 0) {
L.getSink(0)->setAreas(calcAreas(cmd[2]));
result << "done";
break;
}
if (strcasecmp(cmd[1].c_str(), "level") == 0) {
if (strcasecmp(cmd[1].c_str(), "LEVEL") == 0) {
L.getSink(0)->setLevel(calcLevel(cmd[2]));
result << "done";
break;
@@ -319,12 +319,12 @@ std::string BaseLoop::decodeMessage(const std::string& data)
}
// ToDo: ...
if (strcasecmp(cmd[1].c_str(), "list") == 0) {
if (strcasecmp(cmd[1].c_str(), "LIST") == 0) {
result << "not implemented yet";
break;
}
if (strcasecmp(cmd[1].c_str(), "reload") == 0) {
if (strcasecmp(cmd[1].c_str(), "RELOAD") == 0) {
// create Commands DB
Commands* commands = ConfigCommands(A.getParam<const char*>("p_ebusconfdir"), CSV).getCommands();
L.log(bas, debug, "ebus configuration dir: %s", A.getParam<const char*>("p_ebusconfdir"));
+8 -8
View File
@@ -59,14 +59,14 @@ private:
ClientCommand getCase(const std::string& item)
{
if (strcasecmp(item.c_str(), "get") == 0) return get;
if (strcasecmp(item.c_str(), "set") == 0) return set;
if (strcasecmp(item.c_str(), "cyc") == 0) return cyc;
if (strcasecmp(item.c_str(), "hex") == 0) return hex;
if (strcasecmp(item.c_str(), "dump") == 0) return dump;
if (strcasecmp(item.c_str(), "log") == 0) return log;
if (strcasecmp(item.c_str(), "config") == 0) return config;
if (strcasecmp(item.c_str(), "help") == 0) return help;
if (strcasecmp(item.c_str(), "GET") == 0) return get;
if (strcasecmp(item.c_str(), "SET") == 0) return set;
if (strcasecmp(item.c_str(), "CYC") == 0) return cyc;
if (strcasecmp(item.c_str(), "HEX") == 0) return hex;
if (strcasecmp(item.c_str(), "DUMP") == 0) return dump;
if (strcasecmp(item.c_str(), "LOG") == 0) return log;
if (strcasecmp(item.c_str(), "CONFIG") == 0) return config;
if (strcasecmp(item.c_str(), "HELP") == 0) return help;
return notfound;
}