From 6ba361d96bc2581667b3400f87ff89fae6449e1f Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Wed, 31 Aug 2011 11:23:24 +0200 Subject: parameter-framework: improvements and corrections BZ: 6721 - Bug correction concerning selection criteria display (inclusive type) - Adapted XML format to allow for only on parameter to be associated to a domain - Removed unused files in parameter project Change-Id: I9f42d08ff8cb60354714fe3d6b0f0b321ad0a7bf Orig-Change-Id: I837e553070f5acf2d275082c986ba29433493e31 Signed-off-by: Patrick Benavoli Reviewed-on: http://android.intel.com:8080/16878 Reviewed-by: Mahe, Erwan Tested-by: Barthes, FabienX Reviewed-by: buildbot Tested-by: buildbot --- remote-processor/RemoteCommand.h | 1 + remote-processor/RequestMessage.cpp | 27 +++++++++++++++++++++++++++ remote-processor/RequestMessage.h | 1 + 3 files changed, 29 insertions(+) (limited to 'remote-processor') diff --git a/remote-processor/RemoteCommand.h b/remote-processor/RemoteCommand.h index 8409468..e55d3cb 100644 --- a/remote-processor/RemoteCommand.h +++ b/remote-processor/RemoteCommand.h @@ -43,4 +43,5 @@ public: virtual void addArgument(const std::string& strArgument) = 0; virtual uint32_t getArgumentCount() const = 0; virtual const std::string& getArgument(uint32_t uiArgument) const = 0; + virtual const std::string packArguments(uint32_t uiStartArgument, uint32_t uiNbArguments) const = 0; }; diff --git a/remote-processor/RequestMessage.cpp b/remote-processor/RequestMessage.cpp index 6f71b8a..8c6c2a3 100644 --- a/remote-processor/RequestMessage.cpp +++ b/remote-processor/RequestMessage.cpp @@ -73,6 +73,33 @@ const string& CRequestMessage::getArgument(uint32_t uiArgument) const return _argumentVector[uiArgument]; } +const string CRequestMessage::packArguments(uint32_t uiStartArgument, uint32_t uiNbArguments) const +{ + string strPackedArguments; + + assert(uiStartArgument + uiNbArguments <= _argumentVector.size()); + + // Pack arguments, separating them with a space + uint32_t uiArgument; + + bool bFirst = true; + + for (uiArgument = uiStartArgument; uiArgument < uiStartArgument + uiNbArguments; uiArgument++) { + + if (!bFirst) { + + strPackedArguments += " "; + } else { + + bFirst = false; + } + + strPackedArguments += _argumentVector[uiArgument]; + } + + return strPackedArguments; +} + // Fill data to send void CRequestMessage::fillDataToSend() { diff --git a/remote-processor/RequestMessage.h b/remote-processor/RequestMessage.h index c0b2183..8428aad 100644 --- a/remote-processor/RequestMessage.h +++ b/remote-processor/RequestMessage.h @@ -47,6 +47,7 @@ public: virtual void addArgument(const string& strArgument); virtual uint32_t getArgumentCount() const; virtual const string& getArgument(uint32_t uiArgument) const; + virtual const string packArguments(uint32_t uiStartArgument, uint32_t uiNbArguments) const; private: // Fill data to send -- cgit v1.1