Eclipse 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) |
char to hexadecimal | |
static std::string | convertUmlaute (std::string str) |
Converts german "Umlaute" to their latin-version. | |
static bool | endsWith (const std::string &str, const std::string suffix) |
Checks whether a given string ends with the suffix. | |
static std::string | escapeXML (const std::string &orig, const bool maskDoubleHyphen=false) |
Replaces the standard escapes by their XML entities. | |
template<typename T , typename... Targs> | |
static const std::string | format (const std::string &format, T value, Targs... Fargs) |
adds a new formatted message | |
static unsigned char | hexToChar (const std::string &str) |
hexadecimal to char | |
static int | hexToInt (const std::string &sData) |
converts a string with a hex value into the integer value described by it by calling the char-type converter | |
static std::string | latin1_to_utf8 (std::string str) |
Transfers from Latin 1 (ISO-8859-1) to UTF-8. | |
static std::string | padFront (const std::string &str, int length, char padding) |
static double | parseDist (const std::string &sData) |
parse a distance, length or width value with a unit | |
static double | parseSpeed (const std::string &sData, const bool defaultKmph=true) |
parse a speed value with a unit | |
static std::string | prune (const std::string &str) |
Removes trailing and leading whitechars. | |
static std::string | pruneZeros (const std::string &str, int max) |
Removes trailing zeros (at most 'max') | |
static std::string | replace (std::string str, const std::string &what, const std::string &by) |
Replaces all occurrences of the second string by the third string within the first string. | |
static void | resetTranscoder () |
must be called when shutting down the xml subsystem | |
static bool | startsWith (const std::string &str, const std::string prefix) |
Checks whether a given string starts with the prefix. | |
static std::string | substituteEnvironment (const std::string &str, const std::chrono::time_point< std::chrono::system_clock > *const timeRef=nullptr) |
Replaces an environment variable with its value (similar to bash); syntax for a variable is ${NAME}. | |
static std::string | to_lower_case (const std::string &str) |
Transfers the content to lower case. | |
static bool | toBool (const std::string &sData) |
converts a string into the bool value described by it by calling the char-type converter | |
static double | toDouble (const std::string &sData) |
converts a string into the double value described by it by calling the char-type converter | |
static double | toDoubleSecure (const std::string &sData, const double def) |
converts a string into the integer value described by it | |
static int | toInt (const std::string &sData) |
converts a string into the integer value described by it by calling the char-type converter, which | |
static int | toIntSecure (const std::string &sData, int def) |
converts a string into the integer value described by it | |
static long long int | toLong (const std::string &sData) |
converts a string into the long value described by it by calling the char-type converter, which | |
static MMVersion | toVersion (const std::string &sData) |
parse a (network) version 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 std::string | transcode (const XMLCh *const data, int length) |
converts a 0-terminated XMLCh* array (usually UTF-16, stemming from Xerces) into std::string in UTF-8 considering the given length | |
static std::string | transcodeFromLocal (const std::string &localString) |
convert a string from the local codepage to UTF-8 | |
static std::string | transcodeToLocal (const std::string &utf8String) |
convert a string from UTF-8 to the local codepage | |
static std::string | trim (const std::string s, const std::string &t=" \t\n") |
remove leading and trailing whitespace | |
static std::string | trim_left (const std::string s, const std::string &t=" \t\n") |
remove leading whitespace from string | |
static std::string | trim_right (const std::string s, const std::string &t=" \t\n") |
remove trailing whitespace from string | |
static std::string | urlDecode (const std::string &encoded) |
decode url (stem from http://bogomip.net/blog/cpp-url-encoding-and-decoding/) | |
static std::string | urlEncode (const std::string &url, const std::string encodeWhich="") |
encode url (stem from http://bogomip.net/blog/cpp-url-encoding-and-decoding/) | |
static std::string | wrapText (const std::string s, int width) |
remove leading and trailing whitespace | |
Static Public Attributes | |
static std::string | emptyString |
An empty string. | |
Static Private Member Functions | |
static void | _format (const char *format, std::ostringstream &os) |
template<typename T , typename... Targs> | |
static void | _format (const char *format, std::ostringstream &os, T value, Targs... Fargs) |
adds a new formatted message | |
Static Private Attributes | |
static XERCES_CPP_NAMESPACE::XMLLCPTranscoder * | myLCPTranscoder = nullptr |
Some static methods for string processing.
Definition at line 40 of file StringUtils.h.
|
inlinestaticprivate |
Definition at line 193 of file StringUtils.h.
References format().
Referenced by _format(), and format().
|
inlinestaticprivate |
adds a new formatted message
Definition at line 200 of file StringUtils.h.
|
static |
char to hexadecimal
Definition at line 292 of file StringUtils.cpp.
Referenced by urlEncode().
|
static |
Converts german "Umlaute" to their latin-version.
Definition at line 106 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 218 of file StringUtils.cpp.
Referenced by NIImporter_VISUM::getNamedFloat(), MSBaseVehicle::getPrefixedParameter(), LandmarkLookupTable< E, V >::LandmarkLookupTable(), NIImporter_Vissim::load(), and 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 |
[in] | maskDoubleHyphen | Whether – in input shall be converted to -- (semantically equivalent but allowed in XML comments) |
Definition at line 234 of file StringUtils.cpp.
References replace().
Referenced by NBPTStop::addLine(), PCLoaderOSM::addPOI(), PCLoaderOSM::addPolygon(), NIImporter_OpenStreetMap::insertEdge(), MSStageDriving::routeOutput(), MSStageTranship::routeOutput(), MSStageWaiting::routeOutput(), MSStageWalking::routeOutput(), RODFDetectorCon::save(), RODFDetectorCon::saveAsPOIs(), NBPTLine::write(), NBPTStop::write(), MSFCDExport::write(), GNEBusStop::writeAdditional(), GNEChargingStation::writeAdditional(), GNEContainerStop::writeAdditional(), GNEMultiEntryExitDetector::writeAdditional(), GNEParkingArea::writeAdditional(), GNEParkingSpace::writeAdditional(), GNERerouter::writeAdditional(), GNEVaporizer::writeAdditional(), GNEVariableSpeedSign::writeAdditional(), OptionsCont::writeConfiguration(), GNEDetector::writeDetectorValues(), NWWriter_SUMO::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_SUMO::writeJunction(), NWWriter_XML::writeNodes(), NWWriter_OpenDrive::writeNormalEdge(), Parameterised::writeParams(), NWWriter_OpenDrive::writeRoadObjectPOI(), NWWriter_OpenDrive::writeRoadObjectPoly(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_SUMO::writeTrafficLight(), RODFDetectorCon::writeValidationDetectors(), SUMOPolygon::writeXML(), PointOfInterest::writeXML(), MEInductLoop::writeXMLOutput(), and MSInductLoop::writeXMLOutput().
|
inlinestatic |
adds a new formatted message
Definition at line 185 of file StringUtils.h.
References _format(), format(), and gPrecision.
Referenced by _format(), _format(), SUMORTree::addAdditionalGLObject(), GNEAdditional::checkChildAdditionalRestriction(), GNEDemandElement::checkChildDemandElementRestriction(), GNEAttributeCarrier::fillContainerTranshipElements(), GNEAttributeCarrier::fillContainerTransportElements(), GNEAttributeCarrier::fillPersonPlanRides(), GNEAttributeCarrier::fillPersonPlanTrips(), GNEAttributeCarrier::fillPersonPlanWalks(), format(), MsgHandler::informf(), and SUMORTree::removeAdditionalGLObject().
|
static |
hexadecimal to char
Definition at line 304 of file StringUtils.cpp.
Referenced by urlDecode().
|
static |
converts a string with a hex value into the integer value described by it by calling the char-type converter
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain an integer |
Definition at line 361 of file StringUtils.cpp.
Referenced by NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::myEndElement(), and RGBColor::parseColor().
|
static |
Transfers from Latin 1 (ISO-8859-1) to UTF-8.
Definition at line 89 of file StringUtils.cpp.
Referenced by PCLoaderArcView::load(), NIImporter_VISUM::parse_Edges(), and NIImporter_VISUM::parse_stopPoints().
|
static |
Definition at line 228 of file StringUtils.cpp.
References MAX2().
Referenced by GUITLLogicPhasesTrackerWindow::drawValues().
|
static |
parse a distance, length or width value with a unit
Definition at line 436 of file StringUtils.cpp.
References KM_PER_MILE, and prune().
Referenced by NIImporter_OpenStreetMap::NodesHandler::myStartElement(), and NIImporter_OpenStreetMap::EdgesHandler::myStartElement().
|
static |
parse a speed value with a unit
Definition at line 484 of file StringUtils.cpp.
References KM_PER_MILE, and prune().
Referenced by NIImporter_OpenStreetMap::EdgesHandler::EdgesHandler(), and NIImporter_OpenStreetMap::EdgesHandler::interpretSpeed().
|
static |
Removes trailing and leading whitechars.
Definition at line 58 of file StringUtils.cpp.
Referenced by MSRailSignalConstraint_Predecessor::getDescription(), ODMatrix::getNextNonCommentLine(), PCLoaderArcView::load(), PCLoaderDlrNavteq::loadPOIFile(), PCLoaderDlrNavteq::loadPolyFile(), main(), NIImporter_ITSUMO::Handler::myCharacters(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), GUIDialog_Breakpoints::onCmdEditTable(), parseDist(), parseSpeed(), ODMatrix::readO(), ODMatrix::readV(), Option_StringVector::set(), GNETLSEditorFrame::TLSPhases::setEarliestEnd(), GNETLSEditorFrame::TLSPhases::setLatestEnd(), GNETLSEditorFrame::TLSPhases::setMaxDur(), GNETLSEditorFrame::TLSPhases::setMinDur(), GNETLSEditorFrame::TLSPhases::setRed(), GNETLSEditorFrame::TLSPhases::setVehExt(), and GNETLSEditorFrame::TLSPhases::setYellow().
|
static |
Removes trailing zeros (at most 'max')
Definition at line 69 of file StringUtils.cpp.
References MAX2().
Referenced by SUMOVehicleParameter::getDepartPos(), SUMOVehicleParameter::getDepartPosLat(), and SUMOVehicleParameter::getDepartSpeed().
|
static |
Replaces all occurrences of the second string by the third string within the first string.
Definition at line 123 of file StringUtils.cpp.
Referenced by AStarRouter< E, V >::compute(), convertUmlaute(), escapeXML(), GeoConvHelper::getLoadedPlain(), PHEMlightdllV5::Correction::GetMileage(), PHEMlightdllV5::Correction::IniDETfactor(), PHEMlightdllV5::Correction::IniTNOxfactor(), NIImporter_ArcView::load(), GNESelectorFrame::SelectionOperation::loadFromFile(), GUISelectedStorage::loadIDs(), GNEApplicationWindowHelper::GNENeteditConfigHandler::loadNeteditConfig(), GNEApplicationWindowHelper::GNESumoConfigHandler::loadSumoConfig(), GUIApplicationWindow::onCmdEditChosen(), GNEApplicationWindow::onCmdSaveNeteditConfig(), GNEApplicationWindow::onCmdSavePlainXMLAs(), GNEApplicationWindow::onCmdSaveSumoConfig(), GUIGLObjectPopupMenu::onCmdShowCursorGeoPositionOnline(), GNEFrameAttributeModules::AttributesEditorRow::stripWhitespaceAfterComma(), substituteEnvironment(), and GNEAttributeCarrier::writeAttributeHelp().
|
static |
must be called when shutting down the xml subsystem
Definition at line 632 of file StringUtils.cpp.
References myLCPTranscoder.
Referenced by XMLSubSys::close().
|
static |
Checks whether a given string starts with the prefix.
Definition at line 212 of file StringUtils.cpp.
Referenced by NLHandler::addEdgeLaneMeanData(), MSDevice_Taxi::compatibleLine(), NBNodeCont::customTLID(), GUISUMOAbstractView::displayColorLegend(), EnergyParams::EnergyParams(), EnergyParams::EnergyParams(), MSDevice_Tripinfo::getGlobalParameter(), MSDevice_Routing::getParameter(), MSActuatedTrafficLightLogic::getParameter(), NEMALogic::getParameter(), LIBSUMO_NAMESPACE::Simulation::getParameter(), MSBaseVehicle::getPrefixedParameter(), NWWriter_DlrNavteq::getRoadClass(), MSActuatedTrafficLightLogic::init(), MSDevice_SSM::initEdgeFilter(), MSDevice_FCD::initOnce(), MSBaseVehicle::initTransientModelParams(), NIImporter_OpenStreetMap::interpretDistance(), MSDevice_Taxi::isReservation(), NBHelpers::loadEdgesFromFile(), GNESelectorFrame::SelectionOperation::loadFromFile(), GUISelectedStorage::loadIDs(), NIImporter_ArcView::loadNetwork(), NBHelpers::loadPrefixedIDsFomFile(), GUISettingsHandler::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), GUIDialog_ViewSettings::onCmdSaveSetting(), NBEdgeCont::remapIDs(), NBNodeCont::remapIDs(), SUMOSAXReader::LocalSchemaResolver::resolveEntity(), MSDevice_Routing::setParameter(), MSActuatedTrafficLightLogic::setParameter(), NEMALogic::setParameter(), NIImporter_OpenStreetMap::usableType(), and OptionsCont::writeConfiguration().
|
static |
Replaces an environment variable with its value (similar to bash); syntax for a variable is ${NAME}.
Definition at line 138 of file StringUtils.cpp.
References replace(), and toString().
Referenced by OutputDevice::getDevice(), GUISettingsHandler::myStartElement(), and OptionsCont::set().
|
static |
Transfers the content to lower case.
Definition at line 79 of file StringUtils.cpp.
Referenced by NamedColumnsParser::get(), HelpersPHEMlight::getClassByName(), HelpersPHEMlight5::getClassByName(), PollutantsInterface::Helper::getClassByName(), GNEOptionsDialogElements::InputOption::getDescriptionLower(), GNEOptionsDialogElements::InputOption::getNameLower(), NIImporter_VISUM::getPermissions(), GUIMessageWindow::GUIMessageWindow(), HelpersHBEFA3::HelpersHBEFA3(), NamedColumnsParser::know(), MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), NIImporter_Vissim::VissimSingleTypeParser::myRead(), GUISettingsHandler::myStartElement(), RGBColor::parseColor(), OptionsCont::printHelp(), NIImporter_Vissim::readContents(), NIImporter_Vissim::VissimSingleTypeParser::readEndSecure(), NIImporter_Vissim::VissimSingleTypeParser::readEndSecure(), NIImporter_DlrNavteq::readVersion(), NamedColumnsParser::reinitMap(), toBool(), GNEOptionsDialog::updateVisibleEntriesBySearch(), GNEAttributeCarrier::writeAttributeHelp(), OptionsCont::writeConfiguration(), and OptionsCont::writeSchema().
|
static |
converts a string into the bool value described by it by calling the char-type converter
EmptyData | - exception if the given string is empty |
BoolFormatException | in any other case |
Definition at line 414 of file StringUtils.cpp.
References to_lower_case().
Referenced by NBRailwayTopologyAnalyzer::addBidiEdgesForBufferStops(), MSVehicleType::check(), MSDevice::equippedByDefaultAssignmentOptions(), SUMOSAXAttributes::fromString(), SUMOSAXAttributes::getBool(), SUMOTrafficObject::getBoolParam(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), GUIVehicle::getColorValue(), GNELane::getColorValue(), GUIEdge::getColorValue(), GUILane::getColorValue(), GUIBaseVehicle::getScaleValue(), NIImporter_VISUM::getWeightedBool(), NEMALogic::init(), MSSOTLTrafficLightLogic::isDecayThresholdActivated(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSDelayBasedTrafficLightLogic::MSDelayBasedTrafficLightLogic(), MSSimpleTrafficLightLogic::MSSimpleTrafficLightLogic(), PCTypeDefHandler::myStartElement(), GUISettingsHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), NEMALogic::NEMALogic(), GNEOptionsDialogElements::InputBool::onCmdResetOption(), GNEAttributeCarrier::parse(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_TrafficLights(), SUMOVehicleParameter::parseParkingType(), GUISettingsHandler::parseRainbowSettings(), GUISettingsHandler::parseSizeSettings(), SUMOVehicleParameter::parseStopTriggers(), GUISettingsHandler::parseTextSettings(), MSDevice_SSM::requestsTrajectories(), Option_Bool::set(), Option_BoolExtended::set(), MSDevice_ToC::setParameter(), MSActuatedTrafficLightLogic::setParameter(), MSRailSignal::setParameter(), MSSimpleTrafficLightLogic::setParameter(), LIBSUMO_NAMESPACE::Vehicle::setStopParameter(), TemplateHandler::startElement(), MSDevice_SSM::useGeoCoords(), MSDevice_SSM::writeLanesPositions(), and MSDevice_SSM::writePositions().
|
static |
converts a string into the double value described by it by calling the char-type converter
an | EmptyData - exception if the given string is empty |
a | NumberFormatException - exception when the string does not contain a double |
Definition at line 385 of file StringUtils.cpp.
Referenced by MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), NIXMLPTHandler::addPTLine(), NBEdgeCont::applyOptions(), MSDevice_ElecHybrid::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), ROEdge::cacheParamRestrictions(), SUMOVTypeParameter::cacheParamRestrictions(), MSFrame::checkOptions(), MSDevice::equippedByDefaultAssignmentOptions(), MSActuatedTrafficLightLogic::evalAtomicExpression(), MSPModel_JuPedSim::execute(), LIBSUMO_NAMESPACE::Simulation::findIntermodalRoute(), SUMOSAXAttributes::fromString(), MSSwarmTrafficLightLogic::getBetaNo(), MSSwarmTrafficLightLogic::getBetaSp(), SUMOVTypeParameter::getCFParam(), MSSwarmTrafficLightLogic::getChangePlanProbability(), GUIVehicle::getColorValue(), GNEEdgeData::getColorValue(), GNEEdgeRelData::getColorValue(), GNETAZRelData::getColorValue(), GNELane::getColorValue(), GUIEdge::getColorValue(), GUILane::getColorValue(), MSSOTLTrafficLightLogic::getDecayConstant(), MSDevice_SSM::getDetectionRange(), NGNet::getDistribution(), Parameterised::getDouble(), Parameterised::getDoubles(), MSDevice_SSM::getExtraTime(), SUMOSAXAttributesImpl_Cached::getFloat(), SUMOSAXAttributesImpl_Xerces::getFloat(), SUMOSAXAttributes::getFloat(), MSSwarmTrafficLightLogic::getForgettingCox(), MSSwarmTrafficLightLogic::getGammaNo(), MSSwarmTrafficLightLogic::getGammaSp(), MSSOTLTrafficLightLogic::getInputSensorsLength(), SUMOVTypeParameter::getJMParam(), SUMOVTypeParameter::getLCParam(), MSSwarmTrafficLightLogic::getLearningCox(), MSDevice_SSM::getMDRAC_PRT(), MSDevice_SSM::getMeasuresAndThresholds(), NIImporter_VISUM::getNamedFloat(), NIImporter_VISUM::getNamedFloat(), MSSOTLTrafficLightLogic::getOutputSensorsLength(), MSSwarmTrafficLightLogic::getPheroMaxVal(), GUIBaseVehicle::getScaleValue(), MSSOTLTrafficLightLogic::getSpeedThreshold(), MSSwarmTrafficLightLogic::getThetaInit(), MSSwarmTrafficLightLogic::getThetaMax(), MSSwarmTrafficLightLogic::getThetaMin(), getTurningDefaults(), MSCFModel_Rail::getValueTable(), LinearApproxHelpers::getValueTable(), MSStoppingPlaceRerouter::getWeight(), NIImporter_VISUM::getWeightedFloat(), MSRailCrossing::init(), MSSwarmTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), PushButtonLogic::init(), SigmoidLogic::init(), SUMOVTypeParameter::initRailVisualizationParameters(), NIImporter_OpenStreetMap::interpretDistance(), LandmarkLookupTable< E, V >::LandmarkLookupTable(), PCLoaderVisum::load(), PCLoaderDlrNavteq::loadPolyFile(), main(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSDelayBasedTrafficLightLogic::MSDelayBasedTrafficLightLogic(), MSSimpleTrafficLightLogic::MSSimpleTrafficLightLogic(), MSSOTLPolicy::MSSOTLPolicy(), NIImporter_ITSUMO::Handler::myEndElement(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NIImporter_Vissim::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition::myEndElement(), GUISettingsHandler::myStartElement(), NEMALogic::NEMALogic(), MSDevice_GLOSA::notifyEnter(), MFXDecalsTable::onCmdEditRowString(), Distribution_Parameterized::parse(), GNEAttributeCarrier::parse(), NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition::parse(), NIVissimSingleTypeParser_Laengenverteilungsdefinition::parse(), NIVissimSingleTypeParser_Simdauer::parse(), NIVissimSingleTypeParser_Streckendefinition::parse(), NIVissimSingleTypeParser_Verbindungsdefinition::parse(), NIVissimSingleTypeParser_Zeitenverteilungsdefinition::parse(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_Point(), NIImporter_VISUM::parse_stopPoints(), NLTriggerBuilder::parseAndBuildRerouter(), SUMOVehicleParameter::parseArrivalPos(), SUMOVehicleParameter::parseArrivalPosLat(), SUMOVehicleParameter::parseArrivalSpeed(), GeomConvHelper::parseBoundaryReporting(), SUMOVehicleParserHelper::parseCFMParams(), RGBColor::parseColor(), SUMOVehicleParameter::parseDepartPos(), SUMOVehicleParameter::parseDepartPosLat(), SUMOVehicleParameter::parseDepartSpeed(), GNEOptionsDialogElements::InputFloat::parseFloat(), SUMOVehicleParserHelper::parseFlowAttributes(), SUMOVehicleParserHelper::parseJMParams(), SUMOVTypeParameter::parseLatAlignment(), SUMOVehicleParserHelper::parseLCParams(), GenericEngineModel::parseParameter(), GUISettingsHandler::parseRainbowSettings(), GeomConvHelper::parseShapeReporting(), GUISettingsHandler::parseSizeSettings(), GUISettingsHandler::parseTextSettings(), ODMatrix::parseTimeLine(), RODFDetFlowLoader::read(), ODMatrix::readFactor(), ODMatrix::readO(), MSDevice_Battery::readParameterValue(), ODMatrix::readV(), NIImporter_DlrNavteq::readVersion(), GNENet::replaceIncomingEdge(), NIImporter_DlrNavteq::EdgesHandler::report(), Option_Float::set(), MSFrame::setMSGlobals(), MSDevice_Battery::setParameter(), MSDevice_Bluelight::setParameter(), MSDevice_DriverState::setParameter(), MSDevice_ElecHybrid::setParameter(), MSDevice_Example::setParameter(), MSDevice_Friction::setParameter(), MSDevice_GLOSA::setParameter(), MSDevice_Routing::setParameter(), MSDevice_SSM::setParameter(), MSDevice_StationFinder::setParameter(), MSDevice_Taxi::setParameter(), MSTransportableDevice_Routing::setParameter(), MSRailCrossing::setParameter(), MSDevice_ToC::setParameter(), MSLCM_LC2013::setParameter(), MSLCM_SL2015::setParameter(), MSActuatedTrafficLightLogic::setParameter(), NEMALogic::setParameter(), MSCFModel_CC::setParameter(), LIBSUMO_NAMESPACE::Vehicle::setStopParameter(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), string2time(), toDoubleSecure(), toVersion(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::WAUTSwitchProcedure_Stretch(), and RODFDetector::writeEmitterDefinition().
|
static |
converts a string into the integer value described by it
Definition at line 405 of file StringUtils.cpp.
References toDouble().
Referenced by MSRouteHandler::openRouteDistribution(), MSRouteHandler::openVehicleTypeDistribution(), RORouteHandler::openVehicleTypeDistribution(), and NWWriter_OpenDrive::writeRoadObjectPoly().
|
static |
converts a string into the integer value described by it by calling the char-type converter, which
an | EmptyData - exception if the given string is empty |
NumberFormatException | - exception when the string does not contain an integer |
Definition at line 318 of file StringUtils.cpp.
References toLong(), and toString().
Referenced by NIXMLPTHandler::addPTLine(), NIXMLEdgesHandler::addSplit(), FareModul::addStop(), NBOwnTLDef::buildNemaPhases(), NEMALogic::constructTimingAndPhaseDefs(), MSActuatedTrafficLightLogic::evalAtomicExpression(), SUMOSAXAttributes::fromString(), OutputDevice::getDevice(), SUMOXMLDefinitions::getIndexFromLane(), SUMOSAXAttributes::getInt(), NBEdge::getLaneIndexFromLaneID(), NINavTeqHelper::getLaneNumber(), MSSwarmTrafficLightLogic::getMaxCongestionDuration(), MSSOTLRequestPolicy::getMinDecisionalPhaseDuration(), MSSOTLTrafficLightLogic::getMode(), MSSwarmTrafficLightLogic::getReinforcementMode(), NINavTeqHelper::getSpeed(), MSSOTLTrafficLightLogic::getThreshold(), MSSwarmTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), SUMOVTypeParameter::initRailVisualizationParameters(), MSBaseVehicle::initTransientModelParams(), NBHelpers::interpretLaneID(), PCLoaderVisum::load(), NIImporter_OpenDrive::loadNetwork(), NIImporter_ITSUMO::Handler::myEndElement(), NIImporter_OpenDrive::myEndElement(), NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(), NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::myEndElement(), MSStateHandler::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), GUISettingsHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), GNEOptionsDialogElements::InputIntVector::onCmdSetOption(), GNEAttributeCarrier::parse(), NIVissimSingleTypeParser_Fahrzeugklassendefinition::parse(), NIVissimSingleTypeParser_Fahrzeugtypdefinition::parse(), NIVissimSingleTypeParser_Kantensperrung::parse(), NIVissimSingleTypeParser_Knotendefinition::parse(), NIVissimSingleTypeParser_Streckendefinition::parse(), NIVissimSingleTypeParser_Verbindungsdefinition::parse(), NIVissimSingleTypeParser_VWunschentscheidungsdefinition::parse(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Types(), SUMOVehicleParserHelper::parseAngleTimesMap(), SUMOVehicleParameter::parseArrivalLane(), NIImporter_Vissim::VissimSingleTypeParser::parseAssignedVehicleTypes(), RGBColor::parseColor(), SUMOVehicleParameter::parseDepartLane(), GenericEngineModel::parseParameter(), NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition::parsePos(), SUMOVehicleParameter::parseRouteIndex(), ODMatrix::parseSingleTime(), NIImporter_DlrNavteq::readDate(), NIImporter_Vissim::VissimSingleTypeParser::readExtEdgePointDef(), ODMatrix::readO(), ODMatrix::readV(), NIImporter_DlrNavteq::EdgesHandler::report(), NIImporter_DlrNavteq::ConnectedLanesHandler::report(), Option_Integer::set(), Option_IntVector::set(), MSCFModel_CC::setParameter(), NIVissimConflictArea::setPriorityRegulation(), LIBSUMO_NAMESPACE::Vehicle::setStopParameter(), MSSOTLE2Sensors::setVehicleWeigths(), GUIMainWindow::setWindowSizeAndPos(), toIntSecure(), toVersion(), NWWriter_SUMO::writeInternalNodes(), and NWWriter_DlrNavteq::writeLinksUnsplitted().
|
static |
converts a string into the integer value described by it
Definition at line 328 of file StringUtils.cpp.
References toInt().
Referenced by NIXMLConnectionsHandler::parseDeprecatedLaneDefinition().
|
static |
converts a string into the long value described by it by calling the char-type converter, which
an | EmptyData - exception if the given string is empty |
NumberFormatException | - exception when the string does not contain a long integer |
Definition at line 337 of file StringUtils.cpp.
Referenced by SUMOSAXAttributes::fromString(), SUMOSAXAttributes::getLong(), NIImporter_OpenStreetMap::insertEdge(), PCLoaderVisum::load(), MSDevice_Vehroutes::loadState(), MSStateHandler::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_VISUM::parse_AreaSubPartElement(), NIImporter_VISUM::parse_Districts(), NIImporter_VISUM::parse_Kante(), NIImporter_VISUM::parse_PartOfArea(), NIImporter_VISUM::parse_Point(), NBEdgeCont::remapIDs(), NBNodeCont::remapIDs(), and toInt().
|
static |
parse a (network) version string
Definition at line 429 of file StringUtils.cpp.
References StringTokenizer::getVector(), toDouble(), and toInt().
Referenced by NIImporter_SUMO::myStartElement(), NLHandler::myStartElement(), and RONetHandler::myStartElement().
|
inlinestatic |
converts a 0-terminated XMLCh* array (usually UTF-16, stemming from Xerces) into std::string in UTF-8
an | EmptyData - exception if the given pointer is 0 |
Definition at line 152 of file StringUtils.h.
References transcode().
Referenced by OptionsLoader::characters(), GenericHandler::characters(), GenericSAXHandler::characters(), SUMOSAXAttributesImpl_Xerces::clone(), GenericHandler::endElement(), GenericSAXHandler::endElement(), TemplateHandler::error(), OptionsLoader::error(), TemplateHandler::fatalError(), OptionsLoader::fatalError(), SUMOSAXAttributesImpl_Xerces::getAttributeNames(), SUMOSAXAttributesImpl_Xerces::getFloat(), OptionsIO::getRoot(), SUMOSAXAttributesImpl_Xerces::getString(), SUMOSAXAttributesImpl_Xerces::getStringSecure(), XMLSubSys::init(), NITypeLoader::load(), OptionsIO::loadConfiguration(), GNEOptionsDialog::loadConfiguration(), GNEPythonTool::loadConfiguration(), GNEApplicationWindowHelper::GNENeteditConfigHandler::loadNeteditConfig(), GNEApplicationWindowHelper::GNESumoConfigHandler::loadSumoConfig(), main(), TemplateHandler::parseTemplate(), SUMOSAXReader::LocalSchemaResolver::resolveEntity(), XMLSubSys::runParser(), SUMOSAXAttributesImpl_Xerces::serialize(), TemplateHandler::startElement(), OptionsLoader::startElement(), GenericHandler::startElement(), GenericSAXHandler::startElement(), transcode(), transcodeFromLocal(), TemplateHandler::warning(), and OptionsLoader::warning().
|
static |
converts a 0-terminated XMLCh* array (usually UTF-16, stemming from Xerces) into std::string in UTF-8 considering the given length
EmptyData | if the given pointer is 0 |
Definition at line 517 of file StringUtils.cpp.
|
static |
convert a string from the local codepage to UTF-8
Definition at line 541 of file StringUtils.cpp.
References myLCPTranscoder, and transcode().
Referenced by OptionsIO::setArgs().
|
static |
convert a string from UTF-8 to the local codepage
Definition at line 557 of file StringUtils.cpp.
References myLCPTranscoder.
Referenced by OptionsIO::getRoot(), FileHelpers::isDirectory(), FileHelpers::isReadable(), OptionsIO::loadConfiguration(), GNEOptionsDialog::loadConfiguration(), GNEPythonTool::loadConfiguration(), GNEApplicationWindowHelper::GNENeteditConfigHandler::loadNeteditConfig(), GNEApplicationWindowHelper::GNESumoConfigHandler::loadSumoConfig(), GUIApplicationWindow::onCmdSaveConfig(), GNEApplicationWindow::onCmdSaveNeteditConfig(), GNEOptionsDialog::onCmdSaveOptions(), GNEApplicationWindow::onCmdSaveSumoConfig(), OutputDevice_File::OutputDevice_File(), SUMOSAXReader::parse(), SUMOSAXReader::parseFirst(), OptionsCont::processMetaOptions(), GNERunNetgenerate::run(), GNERunPythonTool::run(), and SysUtils::runHiddenCommand().
|
static |
remove leading and trailing whitespace
Definition at line 588 of file StringUtils.cpp.
References trim_left(), and trim_right().
Referenced by GNENet::createEdge().
|
static |
remove leading whitespace from string
Definition at line 574 of file StringUtils.cpp.
Referenced by trim().
|
static |
remove trailing whitespace from string
Definition at line 581 of file StringUtils.cpp.
Referenced by trim().
|
static |
decode url (stem from http://bogomip.net/blog/cpp-url-encoding-and-decoding/)
Definition at line 275 of file StringUtils.cpp.
References hexToChar().
Referenced by MSDevice_SSM::getOutputFilename(), and OptionsCont::relocateFiles().
|
static |
encode url (stem from http://bogomip.net/blog/cpp-url-encoding-and-decoding/)
Definition at line 250 of file StringUtils.cpp.
References charToHex().
Referenced by OptionsCont::writeConfiguration().
|
static |
remove leading and trailing whitespace
Definition at line 594 of file StringUtils.cpp.
References StringTokenizer::getVector().
Referenced by GUILane::getParameterWindow(), and GUIVehicle::getStopInfo().
|
static |
An empty string.
Definition at line 86 of file StringUtils.h.
Referenced by MSPerson::getNextEdge(), and GUIGlObject::getParentName().
|
staticprivate |
Definition at line 211 of file StringUtils.h.
Referenced by resetTranscoder(), transcodeFromLocal(), and transcodeToLocal().