![]() |
SUMO - Simulation of Urban MObility
|
Some static methods for string processing. More...
#include <StringUtils.h>
Static Public Member Functions | |
static std::string | charToHex (unsigned char c) |
static std::string | convertUmlaute (std::string str) |
Converts german "Umlaute" to their latin-version. More... | |
static bool | endsWith (const std::string &str, const std::string suffix) |
Checks whether a given string ends with the suffix. More... | |
static std::string | escapeXML (const std::string &orig) |
Replaces the standard escapes by their XML entities. More... | |
static unsigned char | hexToChar (const std::string &str) |
static std::string | latin1_to_utf8 (std::string str) |
Transfers from Latin 1 (ISO-8859-1) to UTF-8. More... | |
static std::string | prune (const std::string &str) |
Removes trailing and leading whitechars. More... | |
static std::string | replace (std::string str, const char *what, const char *by) |
static bool | startsWith (const std::string &str, const std::string prefix) |
Checks whether a given string starts with the prefix. More... | |
static std::string | to_lower_case (std::string str) |
Transfers the content to lower case. More... | |
static std::string | toTimeString (int time) |
Builds a time string (hh:mm:ss) from the given seconds. More... | |
static std::string | urlDecode (const std::string &encoded) |
static std::string | urlEncode (const std::string &url, const std::string encodeWhich="") |
Static Public Attributes | |
static std::string | emptyString |
An empty string. More... | |
Some static methods for string processing.
Definition at line 45 of file StringUtils.h.
|
static |
Definition at line 221 of file StringUtils.cpp.
Referenced by urlEncode().
|
static |
Converts german "Umlaute" to their latin-version.
Definition at line 95 of file StringUtils.cpp.
References replace().
Referenced by PCLoaderDlrNavteq::loadPolyFile(), NIImporter_Vissim::VissimSingleTypeParser::readName(), and NBEdge::reinit().
|
static |
Checks whether a given string ends with the suffix.
Definition at line 157 of file StringUtils.cpp.
Referenced by NIImporter_OpenStreetMap::EdgesHandler::myStartElement().
|
static |
Replaces the standard escapes by their XML entities.
The strings &, <, >, ", and ' are replaced by &, <, >, ", and '
[in] | orig | The original string |
Definition at line 167 of file StringUtils.cpp.
References replace().
Referenced by PCLoaderOSM::addPOI(), PCLoaderOSM::addPolygon(), NIImporter_OpenStreetMap::insertEdge(), RODFDetectorCon::save(), RODFDetectorCon::saveAsPOIs(), OptionsCont::writeConfiguration(), NWWriter_SUMO::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_OpenDrive::writeNetwork(), RODFDetectorCon::writeSpeedTrigger(), RODFDetectorCon::writeValidationDetectors(), PointOfInterest::writeXML(), SUMO::Polygon::writeXML(), MEInductLoop::writeXMLOutput(), and MSInductLoop::writeXMLOutput().
|
static |
Definition at line 232 of file StringUtils.cpp.
Referenced by urlDecode().
|
static |
Transfers from Latin 1 (ISO-8859-1) to UTF-8.
Definition at line 78 of file StringUtils.cpp.
Referenced by PCLoaderArcView::load().
|
static |
Removes trailing and leading whitechars.
Definition at line 56 of file StringUtils.cpp.
Referenced by ODMatrix::getNextNonCommentLine(), OptionsCont::getStringVector(), PCLoaderArcView::load(), NIImporter_ArcView::load(), PCLoaderDlrNavteq::loadPOIFile(), PCLoaderDlrNavteq::loadPolyFile(), main(), NIImporter_ITSUMO::Handler::myCharacters(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), ODMatrix::readO(), and ODMatrix::readV().
|
static |
Replaces all occurences of the second string by the third string within the first string
Definition at line 113 of file StringUtils.cpp.
Referenced by convertUmlaute(), escapeXML(), and NIImporter_ArcView::load().
|
static |
Checks whether a given string starts with the prefix.
Definition at line 151 of file StringUtils.cpp.
Referenced by NWWriter_DlrNavteq::getRoadClass(), NBHelpers::loadEdgesFromFile(), and NIImporter_OpenStreetMap::EdgesHandler::myStartElement().
|
static |
Transfers the content to lower case.
Definition at line 67 of file StringUtils.cpp.
Referenced by NamedColumnsParser::get(), NamedColumnsParser::know(), NIImporter_Vissim::VissimSingleTypeParser::myRead(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), NIImporter_Vissim::readContents(), NIImporter_Vissim::VissimSingleTypeParser::readEndSecure(), and NamedColumnsParser::reinitMap().
|
static |
Builds a time string (hh:mm:ss) from the given seconds.
Definition at line 131 of file StringUtils.cpp.
|
static |
Definition at line 204 of file StringUtils.cpp.
References hexToChar().
Referenced by OptionsCont::relocateFiles().
|
static |
Definition at line 180 of file StringUtils.cpp.
References charToHex().
Referenced by Option_FileName::getValueString().
|
static |
An empty string.
Definition at line 84 of file StringUtils.h.
Referenced by MSPerson::getNextEdge(), and GUIGlObject::getParentName().