Exemple #1
0
IvwDeserializer::IvwDeserializer(std::string fileName, bool allowReference)
    : IvwSerializeBase(fileName, allowReference) {
    try {
        doc_.LoadFile();
        rootElement_ = doc_.FirstChildElement();
        storeReferences(rootElement_);
    } catch (TxException& e) {
        throw AbortException(e.what(), IvwContext);
    }
}
Exemple #2
0
void IvwDeserializer::storeReferences(TxElement* node) {
    std::string id = node->GetAttributeOrDefault("id", "");
    if (id != "") {
        referenceLookup_[id] = node;
    }
    ticpp::Iterator<ticpp::Element> child;
    for (child = child.begin(node); child != child.end(); child++) {
        storeReferences(child.Get());
    }
}
Exemple #3
0
Deserializer::Deserializer(Deserializer& s, bool allowReference)
    : SerializeBase(s.getFileName(), allowReference) {
    try {
        doc_.LoadFile();
        rootElement_ = doc_.FirstChildElement();
        storeReferences(rootElement_);
    } catch (TxException& e) {
        throw AbortException(e.what(), IvwContext);
    }
}
Exemple #4
0
IvwDeserializer::IvwDeserializer(std::istream& stream, const std::string& path, bool allowReference)
    : IvwSerializeBase(stream, path, allowReference) {
    try {
        // Base streamed in the xml data. Get the first node.
        rootElement_ = doc_.FirstChildElement();
        storeReferences(rootElement_);

    } catch (TxException& e) {
        throw AbortException(e.what(), IvwContext);
    }
}
Exemple #5
0
void IvwDeserializer::convertVersion(VersionConverter* converter) {
    converter->convert(rootElement_);
    // Re-generate the reference table
    referenceLookup_.clear();
    storeReferences(doc_.FirstChildElement());
}