aboutsummaryrefslogtreecommitdiffstats
path: root/remote-processor
diff options
context:
space:
mode:
authorGeorges-Henri Baron <georges-henrix.baron@intel.com>2012-09-04 17:30:28 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:03:57 +0100
commitcec86c1904a45a7027218adb3d34c8764bdfcc38 (patch)
tree218f0204920c09d264e9caa9ade0ba92cd74ac51 /remote-processor
parentd7e4844d85db591a2ea235dd1b081c76e2f5cb9d (diff)
downloadexternal_parameter-framework-cec86c1904a45a7027218adb3d34c8764bdfcc38.zip
external_parameter-framework-cec86c1904a45a7027218adb3d34c8764bdfcc38.tar.gz
external_parameter-framework-cec86c1904a45a7027218adb3d34c8764bdfcc38.tar.bz2
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 <georges-henrix.baron@intel.com> Reviewed-on: http://android.intel.com:8080/65408 Reviewed-by: cactus <cactus@intel.com> Reviewed-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: Rocard, KevinX <kevinx.rocard@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
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