43 const std::string& type,
const bool stringParse) {
45 std::string exceptMsg =
"";
46 std::string fileName =
"";
51 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
54 fileName =
"built in type map";
69 }
catch (
const XERCES_CPP_NAMESPACE::XMLException& toCatch) {
73 exceptMsg = std::string(toCatch.what()) +
"\n ";
79 throw ProcessError(exceptMsg +
"The " + type +
" could not be loaded from '" + fileName +
"'.");
#define WRITE_ERRORF(...)
#define PROGRESS_DONE_MESSAGE()
#define PROGRESS_BEGIN_MESSAGE(msg)
static bool isReadable(std::string path)
Checks whether the given file is readable.
void setFileName(const std::string &name)
Sets the current file name.
static bool load(SUMOSAXHandler &handler, const std::vector< std::string > &files, const std::string &type, const bool stringParse=false)
SAX-handler base for SUMO-files.
SAX-reader encapsulation containing binary reader.
void parseString(std::string content)
Parse XML from the given string.
static std::string transcode(const XMLCh *const data)
converts a 0-terminated XMLCh* array (usually UTF-16, stemming from Xerces) into std::string in UTF-8
static SUMOSAXReader * getSAXReader(SUMOSAXHandler &handler, const bool isNet=false, const bool isRoute=false)
Builds a reader and assigns the handler to it.
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false, const bool isExternal=false, const bool catchExceptions=true)
Runs the given handler on the given file; returns if everything's ok.