PFW: Add two commands to print xml settings and structure
BZ: 44910
Creates two commands that can be called through the command
line of the parameter-framework. First command getDomainXML
returns a string containing the xml structure of the
domains, configurations and settings. Second command
getSystemClassXML returns a string containing the xml
structure of all the instantiated parameter with their
attributes.
Change-Id: I9a35333802049a2177b8fc416754fdb67e6efff0
Signed-off-by: Georges-Henri Baron <georges-henrix.baron@intel.com>
Reviewed-on: http://android.intel.com:8080/55155
Reviewed-by: Rocard, KevinX <kevinx.rocard@intel.com>
Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com>
Tested-by: Mendi, EduardoX <eduardox.mendi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/parameter/XmlFileIncluderElement.cpp b/parameter/XmlFileIncluderElement.cpp
index 6e93721..89e5c14 100644
--- a/parameter/XmlFileIncluderElement.cpp
+++ b/parameter/XmlFileIncluderElement.cpp
@@ -23,7 +23,8 @@
* UPDATED: 2011-07-27
*/
#include "XmlFileIncluderElement.h"
-#include "XmlParser.h"
+#include "XmlFileDocSource.h"
+#include "XmlMemoryDocSink.h"
#include "XmlElementSerializingContext.h"
#include "ElementLibrary.h"
#include <assert.h>
@@ -52,17 +53,13 @@
// Instantiate parser
string strIncludedElementType = getIncludedElementType();
- CXmlParser parser(strPath, elementSerializingContext.getXmlSchemaPathFolder() + "/" + strIncludedElementType + ".xsd", strIncludedElementType, elementSerializingContext);
-
- if (!parser.open()) {
-
- return false;
- }
+ // Use a doc source that load data from a file
+ CXmlFileDocSource fileDocSource(strPath, elementSerializingContext.getXmlSchemaPathFolder() + "/" + strIncludedElementType + ".xsd", strIncludedElementType);
// Get top level element
CXmlElement childElement;
- parser.getRootElement(childElement);
+ fileDocSource.getRootElement(childElement);
// Create child element
CElement* pChild = elementSerializingContext.getElementLibrary()->createElement(childElement);
@@ -78,7 +75,10 @@
return false;
}
- if (!parser.parse(pChild)) {
+ // Use a doc sink that instantiate the structure from the doc source
+ CXmlMemoryDocSink memorySink(pChild);
+
+ if (!memorySink.process(fileDocSource, elementSerializingContext)) {
return false;
}