 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
44 const std::string& type,
const bool stringParse) {
46 std::string exceptMsg =
"";
49 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
58 WRITE_ERROR(
"Could not open " + type +
"-file '" + *file +
"'.");
59 exceptMsg =
"Process Error";
66 }
catch (
const XERCES_CPP_NAMESPACE::XMLException& toCatch) {
68 +
"\n The " + type +
" could not be loaded from '" + handler->
getFileName() +
"'.";
71 std::string(toCatch.what()) +
"\n The " + type +
" could not be loaded from '" + handler->
getFileName() +
"'.";
73 exceptMsg =
"The " + type +
" could not be loaded from '" + handler->
getFileName() +
"'.";
76 if (exceptMsg !=
"") {
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
SAX-handler base for SUMO-files.
SAX-reader encapsulation containing binary reader.
static void load(SUMOSAXHandler *handler, const std::vector< std::string > &files, const std::string &type, const bool stringParse=false)
void parseString(std::string content)
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
#define PROGRESS_BEGIN_MESSAGE(msg)
const std::string & getFileName() const
returns the current file name
#define PROGRESS_DONE_MESSAGE()
static bool isReadable(std::string path)
Checks whether the given file is readable.
static SUMOSAXReader * getSAXReader(SUMOSAXHandler &handler)
Builds a reader and assigns the handler to it.
void setFileName(const std::string &name)
Sets the current file name.