diff options
Diffstat (limited to 'parameter/ComponentLibrary.cpp')
-rw-r--r-- | parameter/ComponentLibrary.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/parameter/ComponentLibrary.cpp b/parameter/ComponentLibrary.cpp index f133213..f3576e8 100644 --- a/parameter/ComponentLibrary.cpp +++ b/parameter/ComponentLibrary.cpp @@ -45,3 +45,35 @@ const CComponentType* CComponentLibrary::getComponentType(const string& strName) return static_cast<const CComponentType*>(findChild(strName)); } +bool CComponentLibrary::fromXml(const CXmlElement& xmlElement, + CXmlSerializingContext& serializingContext) +{ + CXmlElement childElement; + + CXmlElement::CChildIterator it(xmlElement); + + // XML populate all component libraries + while (it.next(childElement)) { + + // Filter component library/type set elements + if (childElement.getType() == "ComponentLibrary" || + childElement.getType() == "ComponentTypeSet") { + + if (!fromXml(childElement, serializingContext)) { + + return false; + } + } else { + // Regular child creation and populating + CElement* pChild = createChild(childElement, serializingContext); + + if (!pChild || !pChild->fromXml(childElement, serializingContext)) { + + return false; + } + } + } + + return true; +} + |