diff options
author | Guillaume Denneulin <guillaume.denneulin@intel.com> | 2014-01-31 15:09:42 +0100 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-13 16:08:59 +0100 |
commit | 3ba083ee0b0ff7e01caeb3bc7395377071e20fe6 (patch) | |
tree | d639c767d5308ee2658db9d1fc0f946067a74c94 /parameter/Element.cpp | |
parent | 7613e74a97d67c392a241ad3a62c6533b31f48ab (diff) | |
download | external_parameter-framework-3ba083ee0b0ff7e01caeb3bc7395377071e20fe6.zip external_parameter-framework-3ba083ee0b0ff7e01caeb3bc7395377071e20fe6.tar.gz external_parameter-framework-3ba083ee0b0ff7e01caeb3bc7395377071e20fe6.tar.bz2 |
In structure XML files, implement component library files inclusion
BZ: 168727
In the PFW structure file, it is not possible to include a component
library from another XML file.
Implement the possibility to import component from another XML file
that would be included in a structure XML file and that would
describe a component library.
Change-Id: Id6125140de1c8e9882375d01199f695b929f45e2
Signed-off-by: Guillaume Denneulin <guillaume.denneulin@intel.com>
Diffstat (limited to 'parameter/Element.cpp')
-rwxr-xr-x | parameter/Element.cpp | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/parameter/Element.cpp b/parameter/Element.cpp index b68205b..43f1c57 100755 --- a/parameter/Element.cpp +++ b/parameter/Element.cpp @@ -263,15 +263,9 @@ bool CElement::fromXml(const CXmlElement& xmlElement, CXmlSerializingContext& se } else { // Child needs creation - pChild = elementSerializingContext.getElementLibrary()->createElement(childElement); + pChild = createChild(childElement, serializingContext); - if (pChild) { - - // Store created child! - addChild(pChild); - } else { - - elementSerializingContext.setError("Unable to create XML element " + childElement.getPath()); + if (!pChild) { return false; } @@ -403,6 +397,29 @@ CElement* CElement::getLastChild() return _childArray[uiNbChildren - 1]; } +CElement* CElement::createChild(const CXmlElement& childElement, + CXmlSerializingContext& serializingContext) +{ + // Context + CXmlElementSerializingContext& elementSerializingContext = + static_cast<CXmlElementSerializingContext&>(serializingContext); + + // Child needs creation + CElement* pChild = elementSerializingContext.getElementLibrary()->createElement(childElement); + + if (!pChild) { + + elementSerializingContext.setError( + "Unable to create XML element " + childElement.getPath()); + + return NULL; + } + // Store created child! + addChild(pChild); + + return pChild; +} + bool CElement::removeChild(CElement* pChild) { ChildArrayIterator it; |