![]() |
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, const bool maskDoubleHyphen=false) |
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 44 of file StringUtils.h.
|
static |
Definition at line 219 of file StringUtils.cpp.
Referenced by urlEncode().
|
static |
Converts german "Umlaute" to their latin-version.
Definition at line 90 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 152 of file StringUtils.cpp.
Referenced by NIImporter_VISUM::getNamedFloat(), libsumo::Vehicle::getParameter(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), GNEApplicationWindow::onCmdSaveAsPlainXML(), and libsumo::Vehicle::setParameter().
|
static |
Replaces the standard escapes by their XML entities.
The strings &, <, >, ", and ' are replaced by &, <, >, ", and '
[in] | orig | The original string |
[in] | maskDoubleHyphen | Whether – in input shall be converted to -- (semantically equivalent but allowed in XML comments) |
Definition at line 162 of file StringUtils.cpp.
References replace().
Referenced by PCLoaderOSM::addPOI(), PCLoaderOSM::addPolygon(), NIImporter_OpenStreetMap::insertEdge(), RODFDetectorCon::save(), RODFDetectorCon::saveAsPOIs(), NBPTLine::write(), NBPTStop::write(), OptionsCont::writeConfiguration(), NWWriter_SUMO::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_OpenDrive::writeNormalEdge(), Parameterised::writeParams(), RODFDetectorCon::writeSpeedTrigger(), RODFDetectorCon::writeValidationDetectors(), SUMOPolygon::writeXML(), PointOfInterest::writeXML(), MEInductLoop::writeXMLOutput(), and MSInductLoop::writeXMLOutput().
|
static |
Definition at line 230 of file StringUtils.cpp.
Referenced by urlDecode().
|
static |
Transfers from Latin 1 (ISO-8859-1) to UTF-8.
Definition at line 73 of file StringUtils.cpp.
Referenced by PCLoaderArcView::load().
|
static |
Removes trailing and leading whitechars.
Definition at line 51 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(), GNETLSEditorFrame::onCmdPhaseEdit(), ODMatrix::readO(), and ODMatrix::readV().
|
static |
Replaces all occurences of the second string by the third string within the first string
Definition at line 108 of file StringUtils.cpp.
Referenced by convertUmlaute(), escapeXML(), NIImporter_ArcView::load(), and GNEInspectorFrame::AttributeInput::stripWhitespaceAfterComma().
|
static |
Checks whether a given string starts with the prefix.
Definition at line 146 of file StringUtils.cpp.
Referenced by libsumo::Simulation::getParameter(), libsumo::Vehicle::getParameter(), MSDevice_Routing::getParameter(), NWWriter_DlrNavteq::getRoadClass(), NBHelpers::loadEdgesFromFile(), NBHelpers::loadPrefixedIDsFomFile(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), libsumo::Vehicle::setParameter(), and MSDevice_Routing::setParameter().
|
static |
Transfers the content to lower case.
Definition at line 62 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(), NIImporter_DlrNavteq::readVersion(), and NamedColumnsParser::reinitMap().
|
static |
Builds a time string (hh:mm:ss) from the given seconds.
Definition at line 126 of file StringUtils.cpp.
|
static |
Definition at line 202 of file StringUtils.cpp.
References hexToChar().
Referenced by OptionsCont::relocateFiles().
|
static |
Definition at line 178 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().