|
@@ -285,16 +285,18 @@ bool TCLCommand::ParseCommandsFromXml(std::string strFileOrString, std::vector<C
|
|
|
cmdparam.nOption = CMDOPT_Write;
|
|
|
}
|
|
|
|
|
|
- if (_tcsicmp(pAttr->Name(), "head") == 0) {
|
|
|
- cmdparam.head = pAttr->Value();
|
|
|
- }
|
|
|
-
|
|
|
- if (_tcsicmp(pAttr->Name(), "cmd") == 0) {
|
|
|
- cmdparam.cmd = pAttr->Value();
|
|
|
- }
|
|
|
-
|
|
|
- if (_tcsicmp(pAttr->Name(), "param") == 0) {
|
|
|
- cmdparam.param = pAttr->Value();
|
|
|
+ if (_tcsicmp(pAttr->Name(), "head") == 0 || _tcsicmp(pAttr->Name(), "cmd") == 0 || _tcsicmp(pAttr->Name(), "param") == 0)
|
|
|
+ {
|
|
|
+ std::string strValue = pAttr->Value();
|
|
|
+ // È¥³ý¿Õ¸ñ;
|
|
|
+#if _MSC_VER > 1900
|
|
|
+ strValue.erase(std::remove_if(strValue.begin(), strValue.end(), [](unsigned char x) {return std::isspace(x); }), strValue.end()); //C++17
|
|
|
+#else
|
|
|
+ for (std::string::iterator it = strValue.begin(); it != strValue.end();) {
|
|
|
+ !isspace(*it) ? it++ : it = it = strValue.erase(it);
|
|
|
+ }
|
|
|
+#endif
|
|
|
+ cmdparam.head = strValue;
|
|
|
}
|
|
|
|
|
|
if (_tcsicmp(pAttr->Name(), "returnParam") == 0) {
|