summaryrefslogtreecommitdiffstats
path: root/xmlserializer
diff options
context:
space:
mode:
authorPatrick Benavoli <patrickx.benavoli@intel.com>2011-10-24 18:50:03 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-10 17:14:57 +0100
commit63499d4763e42d76bfd39b79871f611381d2d164 (patch)
tree3f16d13707ec60a8ff2bb320ffce0a0e0cc6d91e /xmlserializer
parentcfb64dd41410d363fe2e24faf6cd33c9e846b401 (diff)
downloadexternal_parameter-framework-63499d4763e42d76bfd39b79871f611381d2d164.zip
external_parameter-framework-63499d4763e42d76bfd39b79871f611381d2d164.tar.gz
external_parameter-framework-63499d4763e42d76bfd39b79871f611381d2d164.tar.bz2
parameter-framework: Sequence
BZ: 13152 - Introduced sequence notion in configurations: Sequences are configuration specific and are controlled from the Settings related XML files (order of settings appearance) as well as from the tuning interface (new commands available to set and get the sequence (setElementSequence / getElementSequence). Notes: - sequences will only matter for domains which new "SequenceAware" attribute is set to true (false by default). This attribute is also controlable through the tuning interface (setSequenceAware / getSequenceAware commands). - sequence unaware domain configurations will be applied before sequence aware ones. To allow for such functionality, the XML for settings format had to be reworked, leading to an unfortunate compatibility break. However, one benefit is that now a clear Settings section appears at the bottom of the domain description, which is easier to maintain than the previous structure where the settings appeared as sub-nodes of associated elements. Change-Id: Ic93552fd510ed8847f9c8e7d9d6164f7ea3c8c45 Signed-off-by: Patrick Benavoli <patrickx.benavoli@intel.com> Reviewed-on: http://android.intel.com:8080/22558 Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com> Tested-by: Barthes, FabienX <fabienx.barthes@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com> Reviewed-on: http://android.intel.com:8080/26780 Reviewed-by: Barthes, FabienX <fabienx.barthes@intel.com>
Diffstat (limited to 'xmlserializer')
-rw-r--r--xmlserializer/XmlComposer.cpp4
-rw-r--r--xmlserializer/XmlComposer.h2
-rw-r--r--xmlserializer/XmlElement.cpp6
-rw-r--r--xmlserializer/XmlElement.h1
4 files changed, 10 insertions, 3 deletions
diff --git a/xmlserializer/XmlComposer.cpp b/xmlserializer/XmlComposer.cpp
index 2cdd5dc..ff607dd 100644
--- a/xmlserializer/XmlComposer.cpp
+++ b/xmlserializer/XmlComposer.cpp
@@ -80,7 +80,7 @@ bool CXmlComposer::close()
}
// Composing contents
-void CXmlComposer::compose(const IXmlSource* pXmlSource)
+void CXmlComposer::compose(const IXmlSource* pXmlSource, const string& strProduct, const string& strVersion)
{
// Compose document
CXmlElement docElement(_pRootNode);
@@ -92,7 +92,7 @@ void CXmlComposer::compose(const IXmlSource* pXmlSource)
docElement.setAttributeString("xsi:noNamespaceSchemaLocation", _strXmlSchemaFile);
// Comment for date/time
- docElement.setComment(string(" Exported on ") + getTimeAsString() + " from parameter-framework ");
+ docElement.setComment(string(" Exported on ") + getTimeAsString() + " from " + strProduct + " version " + strVersion + " ");
pXmlSource->toXml(docElement, _serializingContext);
}
diff --git a/xmlserializer/XmlComposer.h b/xmlserializer/XmlComposer.h
index 2f5090f..4b5b822 100644
--- a/xmlserializer/XmlComposer.h
+++ b/xmlserializer/XmlComposer.h
@@ -47,7 +47,7 @@ public:
virtual bool close();
// Composing contents
- void compose(const IXmlSource* pXmlSource);
+ void compose(const IXmlSource* pXmlSource, const string& strProduct, const string& strVersion);
private:
static string getTimeAsString();
diff --git a/xmlserializer/XmlElement.cpp b/xmlserializer/XmlElement.cpp
index 11b9a94..a16a31e 100644
--- a/xmlserializer/XmlElement.cpp
+++ b/xmlserializer/XmlElement.cpp
@@ -194,6 +194,12 @@ bool CXmlElement::getParentElement(CXmlElement& parentElement) const
}
// Setters
+void CXmlElement::setAttributeBoolean(const string& strAttributeName, bool bValue)
+{
+ setAttributeString(strAttributeName, bValue ? "true" : "false");
+}
+
+
void CXmlElement::setAttributeString(const string& strAttributeName, const string& strValue)
{
xmlNewProp(_pXmlElement, BAD_CAST strAttributeName.c_str(), BAD_CAST strValue.c_str());
diff --git a/xmlserializer/XmlElement.h b/xmlserializer/XmlElement.h
index 1028d60..ed040ad 100644
--- a/xmlserializer/XmlElement.h
+++ b/xmlserializer/XmlElement.h
@@ -68,6 +68,7 @@ public:
bool getParentElement(CXmlElement& parentElement) const;
// Setters
+ void setAttributeBoolean(const string& strAttributeName, bool bValue);
void setAttributeString(const string& strAttributeName, const string& strValue);
void setNameAttribute(const string& strValue);
void setTextContent(const string& strContent);