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>
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 @@
// 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 @@
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