SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringUtils Class Reference

Some static methods for string processing. More...

#include <StringUtils.h>

Static Public Member Functions

static std::string convertUmlaute (std::string str)
 Converts german "Umlaute" to their latin-version.
static std::string escapeXML (const std::string &orig)
 Replaces the standard escapes by their XML entities.
static std::string prune (std::string str)
 Removes trailing and leading whitechars.
static std::string replace (std::string str, const char *what, const char *by)
static std::string to_lower_case (std::string str)
 Transfers the content to lower case.
static std::string toTimeString (int time)
 Builds a time string (hh:mm:ss) from the given seconds.

Static Public Attributes

static std::string emptyString
 An empty string.

Detailed Description

Some static methods for string processing.

Definition at line 45 of file StringUtils.h.


Member Function Documentation

std::string StringUtils::convertUmlaute ( std::string  str)
static

Converts german "Umlaute" to their latin-version.

Definition at line 78 of file StringUtils.cpp.

References replace().

Referenced by PCLoaderDlrNavteq::loadPolyFile(), NIImporter_Vissim::VissimSingleTypeParser::readName(), and NBEdge::reinit().

std::string StringUtils::escapeXML ( const std::string &  orig)
static

Replaces the standard escapes by their XML entities.

The strings &, <, >, ", and ' are replaced by &, <, >, ", and '

Parameters:
[in]origThe original string
Returns:
the string with the escaped sequences

Definition at line 134 of file StringUtils.cpp.

References replace().

Referenced by NIImporter_OpenStreetMap::insertEdge(), PCLoaderOSM::loadIfSet(), PCPolyContainer::save(), RODFDetectorCon::save(), RODFDetectorCon::saveAsPOIs(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), RODFDetectorCon::writeSpeedTrigger(), MSInductLoop::writeTypedXMLOutput(), and RODFDetectorCon::writeValidationDetectors().

std::string StringUtils::replace ( std::string  str,
const char *  what,
const char *  by 
)
static

Replaces all occurences of the second string by the third string within the first string

Definition at line 96 of file StringUtils.cpp.

Referenced by convertUmlaute(), escapeXML(), NIImporter_ArcView::load(), and RORDGenerator_ODAmounts::parseFlowAmountDef().

std::string StringUtils::toTimeString ( int  time)
static

Builds a time string (hh:mm:ss) from the given seconds.

Definition at line 114 of file StringUtils.cpp.


Field Documentation

std::string StringUtils::emptyString
static

An empty string.

Definition at line 75 of file StringUtils.h.


The documentation for this class was generated from the following files: