예제 #1
0
파일: Vpz.cpp 프로젝트: SJasson/vle
void Vpz::parseMemory(const std::string& buffer)
{
    m_filename.clear();

    vpz::SaxParser saxparser(*this);
    try {
        saxparser.parseMemory(buffer);
    } catch(const std::exception& sax) {
        try {
            validateMemory(buffer);
        } catch(const std::exception& dom) {
            throw utils::SaxParserError(fmt(_("%2%\n\n%1%")) % dom.what() %
                                        sax.what());
        }
        throw utils::SaxParserError(sax.what());
    }
}
예제 #2
0
void Vpz::parseMemory(const std::string &buffer)
{
    clear();
    project().experiment().conditions().deleteValueSet();
    m_filename.clear();

    vpz::SaxParser saxparser(*this);
    saxparser.parseMemory(buffer);

    auto &cnd = project().experiment().conditions().get(
        Experiment::defaultSimulationEngineCondName());

    if (cnd.getSetValues("begin").empty()) {
        cnd.getSetValues("begin").emplace_back(new value::Double(0));
        cnd.getSetValues("duration").emplace_back(new value::Double(100));
    }
}
예제 #3
0
파일: Vpz.cpp 프로젝트: SJasson/vle
void Vpz::parseFile(const std::string& filename)
{
    m_filename.assign(filename);
    vpz::SaxParser saxparser(*this);

    try {
        saxparser.parseFile(filename);
    } catch(const std::exception& sax) {
        try {
            validateFile(filename);
        } catch(const std::exception& dom) {
            saxparser.clearParserState();
            throw utils::SaxParserError(fmt(_("%2%\n\n%1%")) % dom.what() %
                                        sax.what());
        }
        throw utils::SaxParserError(sax.what());
    }
}