std::string SUMOSAXAttributes::getInternal(const int attr) const {
    const std::string ret = getString(attr);
    if (ret == "") {
        throw EmptyData();
    }
    return ret;
}
Exemple #2
0
std::string
SUMOSAXAttributes::getStringReporting(int attr, const char *objectid,
                                      bool &ok, bool report) const throw() {
    if (!hasAttribute(attr)) {
        if (report) {
            emitUngivenError(getName(attr), objectid);
        }
        ok = false;
        return "";
    }
    try {
        std::string ret = getString(attr);
        if (ret=="") {
            throw EmptyData();
        }
        return ret;
    } catch (EmptyData &) {
        if (report) {
            emitEmptyError(getName(attr), objectid);
        }
    }
    ok = false;
    return "";
}