From cec86c1904a45a7027218adb3d34c8764bdfcc38 Mon Sep 17 00:00:00 2001 From: Georges-Henri Baron Date: Tue, 4 Sep 2012 17:30:28 +0200 Subject: PFW: Add setDomainsXML command to import domains from string BZ: 55694 Unable possibility to import the configurable domains from a string Create one command that can be called through the command line of the parameter-framework. The command setDomainXML allows to import configurable domains with settings from a string provided as first argument containing the xml description. Change-Id: I6db7ccb8ba61b5e4c8ba81579a68f40e887d1534 Signed-off-by: Georges-Henri Baron Reviewed-on: http://android.intel.com:8080/65408 Reviewed-by: cactus Reviewed-by: Dixon, CharlesX Reviewed-by: Rocard, KevinX Tested-by: Dixon, CharlesX Reviewed-by: buildbot Tested-by: buildbot --- remote-processor/RequestMessage.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'remote-processor/RequestMessage.cpp') 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; } -- cgit v1.1