From ed744eb61b3fced13193fb59f728f26847748179 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Thu, 4 Dec 2014 18:38:52 +0100 Subject: New remote command for exporting a single domain The command is used as follows: getDomainWithSettingsXML and outputs the requested domain to the standard output. In that end, the const version of CConfigurableDomains::findConfigurableDomain is made public. This somewhat breaks encapsulation but since the returned domain is const, this has limited impact. Change-Id: I9b854040a5d59913b9b405c8e38d29a3018a6079 Signed-off-by: David Wagner --- parameter/ParameterMgr.h | 53 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) (limited to 'parameter/ParameterMgr.h') diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 9e4a3fb..cd1c468 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -250,23 +250,54 @@ public: bool importDomainsXml(const std::string& strXmlSource, bool bWithSettings, bool bFromFile, std::string& strError); + + /** + * Export an element object to an Xml destination. + * + * + * @param[in,out] strXmlDest a string containing an xml description or a path to an xml file. + * @param[in] xmlSerializingContext the serializing context + * @param[in] bToFile a boolean that determines if the destination is an xml description in + * strXmlDest or contained in a file. In that case strXmlDest is just the file path. + * @param[in] element object to be serialized. + * @param[out] strError is used as the error output. + * + * @return false if any error occurs, true otherwise. + */ + bool serializeElement(std::string& strXmlDest, CXmlSerializingContext& xmlSerializingContext, + bool bToFile, const CElement& element, std::string& strError) const; + /** * Method that exports Configurable Domains to an Xml destination. - * If bToFile is false, the xml description from the xml document will be written - * in strXmlDest. Otherwise it will be written in a file located at the path in strXmlDest * - * @param[in:out] strXmlDest a std::string containing an xml description or a path to an xml file + * @param[in,out] strXmlDest a string containing an xml description or a path to an xml file * @param[in] bWithSettings a boolean that determines if the settings should be used in the * xml description * @param[in] bToFile a boolean that determines if the destination is an xml description in * strXmlDest or contained in a file. In that case strXmlDest is just the file path. * @param[out] strError is used as the error output * - * @return false if any error occures + * @return false if any error occurs, true otherwise. */ bool exportDomainsXml(std::string& strXmlDest, bool bWithSettings, bool bToFile, std::string& strError) const; + /** + * Method that exports a given Configurable Domain to an Xml destination. + * + * @param[in,out] strXmlDest a string containing an xml description or a path to an xml file + * @param[in] strDomainName the name of the domain to be exported + * @param[in] bWithSettings a boolean that determines if the settings should be used in the + * xml description + * @param[in] bToFile a boolean that determines if the destination is an xml description in + * strXmlDest or contained in a file. In that case strXmlDest is just the file path. + * @param[out] strError is used as the error output + * + * @return false if any error occurs, true otherwise. + */ + bool exportSingleDomainXml(std::string& strXmlDest, const std::string& strDomainName, + bool bWithSettings, bool bToFile, std::string& strError) const; + // Binary Import/Export bool importDomainsBinary(const std::string& strFileName, std::string& strError); bool exportDomainsBinary(const std::string& strFileName, std::string& strError); @@ -371,7 +402,7 @@ private: CCommandHandler::CommandStatus importSettingsCommmandProcess(const IRemoteCommand& remoteCommand, std::string& strResult); /** - * Command handler method for getConfigurableDomainWithSettings command. + * Command handler method for getConfigurableDomainsWithSettings command. * * @param[in] remoteCommand contains the arguments of the received command. * @param[out] strResult a std::string containing the result of the command @@ -383,6 +414,18 @@ private: const IRemoteCommand& remoteCommand, std::string& strResult); /** + * Command handler method for getConfigurableDomainWithSettings command. + * + * @param[in] remoteCommand contains the arguments of the received command. + * @param[out] strResult a string containing the result of the command + * + * @return CCommandHandler::ESucceeded if command succeeded or CCommandHandler::EFailed + * in the other case + */ + CCommandHandler::CommandStatus getConfigurableDomainWithSettingsXMLCommmandProcess( + const IRemoteCommand& remoteCommand, std::string& strResult); + + /** * Command handler method for setConfigurableDomainWithSettings command. * * @param[in] remoteCommand contains the arguments of the received command. -- cgit v1.1