aboutsummaryrefslogtreecommitdiffstats
path: root/remote-processor
diff options
context:
space:
mode:
Diffstat (limited to 'remote-processor')
-rw-r--r--remote-processor/RequestMessage.cpp6
-rw-r--r--remote-processor/RequestMessage.h8
2 files changed, 13 insertions, 1 deletions
diff --git a/remote-processor/RequestMessage.cpp b/remote-processor/RequestMessage.cpp
index 5dfecd0..ced2064 100644
--- a/remote-processor/RequestMessage.cpp
+++ b/remote-processor/RequestMessage.cpp
@@ -30,6 +30,8 @@
#define base CMessage
+const char* const CRequestMessage::gacDelimiters = " \t\n\v\f\r";
+
CRequestMessage::CRequestMessage(const string& strCommand) : base(ECommandRequest), _strCommand(strCommand)
{
}
@@ -152,7 +154,9 @@ string CRequestMessage::trim(const string& strToTrim)
// Trim string
string strTrimmed = strToTrim;
- strTrimmed.erase(remove_if(strTrimmed.begin(), strTrimmed.end(), ::isspace), strTrimmed.end());
+ strTrimmed.erase(strTrimmed.find_last_not_of(gacDelimiters) + 1 );
+
+ strTrimmed.erase(0, strTrimmed.find_first_not_of(gacDelimiters));
return strTrimmed;
}
diff --git a/remote-processor/RequestMessage.h b/remote-processor/RequestMessage.h
index 2b2edb7..a9567e5 100644
--- a/remote-processor/RequestMessage.h
+++ b/remote-processor/RequestMessage.h
@@ -44,6 +44,14 @@ public:
virtual const string packArguments(uint32_t uiStartArgument, uint32_t uiNbArguments) const;
private:
+
+ /**
+ * Constant character array.
+ * This value defines the delimiters used to separate the arguments
+ * in the request command.
+ */
+ static const char* const gacDelimiters;
+
// Fill data to send
virtual void fillDataToSend();
// Collect received data