예제 #1
0
void CElement::setXmlDescriptionAttribute(CXmlElement &xmlElement) const
{
    const string &description = getDescription();
    if (!description.empty()) {
        xmlElement.setAttribute(gDescriptionPropertyName, description);
    }
}
// From IXmlSource
void CStringParameterType::toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const
{
    // MaxLength
    xmlElement.setAttribute("MaxLength", _uiMaxLength);

    base::toXml(xmlElement, serializingContext);
}
// From IXmlSource
void CBitParameterBlockType::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const
{
    // Size
    xmlElement.setAttribute("Size", _uiSize * 8);

    base::toXml(xmlElement, serializingContext);
}
// From IXmlSource
void CConfigurableDomains::toXml(CXmlElement &xmlElement,
                                 CXmlSerializingContext &serializingContext) const
{
    // Set attribute
    xmlElement.setAttribute("SystemClassName", getName());

    base::childrenToXml(xmlElement, serializingContext);
}
// From IXmlSource
void CSelectionCriterionRule::toXml(CXmlElement &xmlElement, CXmlSerializingContext & /*ctx*/) const
{
    assert(_pSelectionCriterion);

    // Set selection criterion
    xmlElement.setAttribute("SelectionCriterion", _pSelectionCriterion->getName());

    // Set MatchesWhen
    xmlElement.setAttribute("MatchesWhen", _astMatchesWhen[_eMatchesWhen].pcMatchesWhen);

    // Set Value
    string strValue;

    _pSelectionCriterion->getCriterionType()->getLiteralValue(_iMatchValue, strValue);

    xmlElement.setAttribute("Value", strValue);
}
// From IXmlSource
void CEnumParameterType::toXml(CXmlElement &xmlElement,
                               CXmlSerializingContext &serializingContext) const
{
    // Size
    xmlElement.setAttribute("Size", getSize() * 8);

    base::toXml(xmlElement, serializingContext);
}
// From IXmlSource
void CConfigurableDomain::toXml(CXmlElement &xmlElement,
                                CXmlSerializingContext &serializingContext) const
{
    base::toXml(xmlElement, serializingContext);

    // Sequence awareness
    xmlElement.setAttribute("SequenceAware", _bSequenceAware);
}
예제 #8
0
// From IXmlSource
void CTypeElement::toXml(CXmlElement &xmlElement, CXmlSerializingContext &serializingContext) const
{
    if (!isScalar()) {

        xmlElement.setAttribute("ArrayLength", getArrayLength());
    }

    base::toXml(xmlElement, serializingContext);
}
// From IXmlSource
void CSelectionCriterionType::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const
{
    // Type Kind
    xmlElement.setAttribute("Kind", isTypeInclusive() ? "Inclusive" : "Exclusive");

    // Value pairs as children
    NumToLitMapConstIt it;

    for (it = _numToLitMap.begin(); it != _numToLitMap.end(); ++it) {

        CXmlElement childValuePairElement;

        xmlElement.createChild(childValuePairElement, "ValuePair");
        // Literal
        childValuePairElement.setAttribute("Literal", it->first);
        // Numerical
        childValuePairElement.setAttribute("Numerical", it->second);
    }

    base::toXml(xmlElement, serializingContext);
}
// XML configuration settings composing
void CDomainConfiguration::composeSettings(CXmlElement &xmlConfigurationSettingsElement,
                                           CXmlDomainExportContext &context) const
{
    // Go through all are configurations
    for (auto &areaConfiguration : mAreaConfigurationList) {

        // Retrieve configurable element
        const CConfigurableElement *pConfigurableElement =
            areaConfiguration->getConfigurableElement();

        // Create configurable element child element
        CXmlElement xmlConfigurableElementSettingsElement;

        xmlConfigurationSettingsElement.createChild(xmlConfigurableElementSettingsElement,
                                                    "ConfigurableElement");

        // Set Path attribute
        xmlConfigurableElementSettingsElement.setAttribute("Path", pConfigurableElement->getPath());

        // Delegate composing to area configuration
        exportOneConfigurableElementSettings(areaConfiguration.get(),
                                             xmlConfigurableElementSettingsElement, context);
    }
}
void CConfigurableDomain::composeConfigurableElements(CXmlElement &xmlElement) const
{
    // Create ConfigurableElements element
    CXmlElement xmlConfigurableElementsElement;

    xmlElement.createChild(xmlConfigurableElementsElement, "ConfigurableElements");

    // Serialize out all configurable elements settings
    ConfigurableElementListIterator it;

    for (it = _configurableElementList.begin(); it != _configurableElementList.end(); ++it) {

        const CConfigurableElement *pConfigurableElement = *it;

        // Create corresponding XML child element
        CXmlElement xmlChildConfigurableElement;

        xmlConfigurableElementsElement.createChild(xmlChildConfigurableElement,
                                                   "ConfigurableElement");

        // Set Path attribute
        xmlChildConfigurableElement.setAttribute("Path", pConfigurableElement->getPath());
    }
}