SUMO - Simulation of Urban MObility
TplConvert Class Reference

#include <TplConvert.h>

Static Public Member Functions

template<class E >
static bool _2bool (const E *const data)
 
template<class E >
static bool _2boolSec (const E *const data, bool def)
 
template<class E >
static int _2int (const E *const data)
 
template<class E >
static int _2intSec (const E *const data, int def)
 
template<class E >
static SUMOLong _2long (const E *const data)
 
template<class E >
static SUMOLong _2longSec (const E *const data, long def)
 
template<class E >
static std::string _2str (const E *const data)
 
static std::string _2str (const char *const data)
 
template<class E >
static std::string _2str (const E *const data, unsigned length)
 
static std::string _2str (const char *const data, unsigned length)
 
template<class E >
static std::string _2strSec (const E *const data, const std::string &def)
 
template<class E >
static std::string _2strSec (const E *const data, int length, const std::string &def)
 
template<class E >
static SUMOReal _2SUMOReal (const E *const data)
 
template<class E >
static SUMOReal _2SUMORealSec (const E *const data, SUMOReal def)
 
template<class E >
static int _hex2int (const E *const data)
 
template<class E >
static SUMOLong _hex2long (const E *const data)
 
template<class E >
static unsigned getLength (const E *const data)
 

Detailed Description

TplConvert Some methods that convert 0-terminated char-arrays of any type into other values (numerical/boolean) or into std::strings

Definition at line 51 of file TplConvert.h.

Member Function Documentation

template<class E >
static bool TplConvert::_2bool ( const E *const  data)
inlinestatic

converts a 0-terminated char-type array into the boolean value described by it returns true if the data* is one of the following (case insensitive): '1', 'x', 'true', 'yes', 'on' returns false if the data* is one of the following (case insensitive): '0', '-', 'false', 'no', 'off' throws an EmptyData - exception if the given string is empty or 0 pointer throws a BoolFormatException in any other case

Definition at line 282 of file TplConvert.h.

References _2str().

Referenced by _2boolSec(), MSDevice::equippedByDefaultAssignmentOptions(), SUMOSAXAttributesImpl_Xerces::getBool(), NIImporter_VISUM::getWeightedBool(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), GUISettingsHandler::myStartElement(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_TrafficLights(), GUISettingsHandler::parseSizeSettings(), GUISettingsHandler::parseTextSettings(), and Option_Bool::set().

template<class E >
static bool TplConvert::_2boolSec ( const E *const  data,
bool  def 
)
inlinestatic

converts a 0-terminated char-type array into the SUMOReal value described by it returns true if the data* is one of the following (case insensitive): '1', 'x', 'true', 'yes', 'on' returns false if the data* is one of the following (case insensitive): '0', '-', 'false', 'no', 'off' returns the default value if the data is empty

Definition at line 352 of file TplConvert.h.

References _2bool().

template<class E >
static int TplConvert::_2int ( const E *const  data)
inlinestatic

converts a char-type array into the integer value described by it throws an EmptyData - exception if the given string is empty throws a NumberFormatException - exception when the string does not contain an integer

Definition at line 114 of file TplConvert.h.

References _2long(), max, min, and SUMOLong.

Referenced by _2intSec(), _2SUMOReal(), NIXMLEdgesHandler::addSplit(), MFXAddEditTypedTable::getControlForItem(), OutputDevice::getDevice(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), SUMOSAXAttributesImpl_Xerces::getInt(), NINavTeqHelper::getLaneNumber(), NINavTeqHelper::getSpeed(), NIImporter_SUMO::interpretLaneID(), PCLoaderVisum::load(), NIImporter_ITSUMO::Handler::myEndElement(), GUISettingsHandler::myStartElement(), NIImporter_MATSim::EdgesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), NIVissimSingleTypeParser_Kantensperrung::parse(), NIVissimSingleTypeParser_Knotendefinition::parse(), NIVissimSingleTypeParser_Streckendefinition::parse(), NIVissimSingleTypeParser_VWunschentscheidungsdefinition::parse(), NIVissimSingleTypeParser_Fahrzeugklassendefinition::parse(), NIVissimSingleTypeParser_Fahrzeugtypdefinition::parse(), NIVissimSingleTypeParser_Verbindungsdefinition::parse(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Types(), SUMOVehicleParameter::parseArrivalLane(), NIImporter_Vissim::VissimSingleTypeParser::parseAssignedVehicleTypes(), RGBColor::parseColor(), SUMOVehicleParameter::parseDepartLane(), NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition::parsePos(), ODMatrix::parseSingleTime(), ODMatrix::parseTimeLine(), NIImporter_Vissim::VissimSingleTypeParser::readExtEdgePointDef(), ODMatrix::readO(), ODMatrix::readV(), NIImporter_DlrNavteq::EdgesHandler::report(), Option_Integer::set(), Option_IntVector::set(), and RODFDetector::writeEmitterDefinition().

template<class E >
static int TplConvert::_2intSec ( const E *const  data,
int  def 
)
inlinestatic

converts a 0-terminated char-type array into the integer value described by it returns the default value if the data is empty

Definition at line 312 of file TplConvert.h.

References _2int().

Referenced by RODFDetectorHandler::myStartElement(), NIImporter_VISUM::parse_Edges(), and NIXMLConnectionsHandler::parseDeprecatedLaneDefinition().

template<class E >
static SUMOLong TplConvert::_2long ( const E *const  data)
inlinestatic

converts a char-type array into the long value described by it throws an EmptyData - exception if the given string is empty throws a NumberFormatException - exception when the string does not contain a long

Definition at line 142 of file TplConvert.h.

References SUMOLong.

Referenced by _2int(), _2longSec(), SUMOSAXAttributesImpl_Xerces::getLong(), PCLoaderVisum::load(), NIImporter_VISUM::parse_AreaSubPartElement(), NIImporter_VISUM::parse_Districts(), NIImporter_VISUM::parse_Kante(), NIImporter_VISUM::parse_PartOfArea(), and NIImporter_VISUM::parse_Point().

template<class E >
static SUMOLong TplConvert::_2longSec ( const E *const  data,
long  def 
)
inlinestatic

converts a 0-terminated char-type array into the long value described by it returns the default value if the data is empty

Definition at line 324 of file TplConvert.h.

References _2long().

static std::string TplConvert::_2str ( const char *const  data)
inlinestatic

converts a 0-terminated char array into std::string throws an EmptyData - exception if the given pointer is 0

Definition at line 63 of file TplConvert.h.

template<class E >
static std::string TplConvert::_2str ( const E *const  data,
unsigned  length 
)
inlinestatic

converts a char-type array into std::string considering the given length throws an EmptyData - exception if the given pointer is 0

Definition at line 75 of file TplConvert.h.

static std::string TplConvert::_2str ( const char *const  data,
unsigned  length 
)
inlinestatic

converts a char array into std::string considering the given length throws an EmptyData - exception if the given pointer is 0

Definition at line 101 of file TplConvert.h.

template<class E >
static std::string TplConvert::_2strSec ( const E *const  data,
const std::string &  def 
)
inlinestatic

converts a 0-terminated char-type array into std::string returns the default value if the data is empty

Definition at line 302 of file TplConvert.h.

References getLength().

Referenced by SUMOSAXAttributesImpl_Xerces::getStringSecure().

template<class E >
static std::string TplConvert::_2strSec ( const E *const  data,
int  length,
const std::string &  def 
)
inlinestatic

converts a char-type array into std::string considering the given length returns the default value if the data is empty

Definition at line 364 of file TplConvert.h.

References _2str().

template<class E >
static SUMOReal TplConvert::_2SUMOReal ( const E *const  data)
inlinestatic

converts a char-type array into the SUMOReal value described by it throws an EmptyData - exception if the given string is empty throws a NumberFormatException - exception when the string does not contain a SUMOReal

Definition at line 223 of file TplConvert.h.

References _2int(), SUMOLong, and SUMOReal.

Referenced by _2SUMORealSec(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), NBEdgeCont::applyOptions(), MSDevice_Example::buildVehicleDevices(), SUMOSAXAttributesImpl_Xerces::getBoundary(), MFXAddEditTypedTable::getControlForItem(), SUMOSAXAttributesImpl_Xerces::getFloat(), SUMOSAXAttributesImpl_Binary::getFloat(), NIImporter_VISUM::getNamedFloat(), SUMOSAXAttributesImpl_Xerces::getShape(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), getTurningDefaults(), NIImporter_VISUM::getWeightedFloat(), PCLoaderVisum::load(), PCLoaderDlrNavteq::loadPolyFile(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), NIImporter_ITSUMO::Handler::myEndElement(), GUISettingsHandler::myStartElement(), NIImporter_OpenStreetMap::NodesHandler::myStartElement(), NIImporter_OpenStreetMap::EdgesHandler::myStartElement(), GUIDialog_ViewSettings::onCmdEditTable(), NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition::parse(), NIVissimSingleTypeParser_Laengenverteilungsdefinition::parse(), NIVissimSingleTypeParser_Simdauer::parse(), NIVissimSingleTypeParser_Streckendefinition::parse(), NIVissimSingleTypeParser_Zeitenverteilungsdefinition::parse(), NIVissimSingleTypeParser_Verbindungsdefinition::parse(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_Point(), SUMOVehicleParameter::parseArrivalPos(), SUMOVehicleParameter::parseArrivalSpeed(), GeomConvHelper::parseBoundaryReporting(), RGBColor::parseColor(), SUMOVehicleParameter::parseDepartPos(), SUMOVehicleParameter::parseDepartSpeed(), GeomConvHelper::parseShapeReporting(), GUISettingsHandler::parseSizeSettings(), GUISettingsHandler::parseTextSettings(), ODMatrix::parseTimeLine(), RODFDetFlowLoader::read(), ODMatrix::readFactor(), ODMatrix::readO(), ODMatrix::readV(), NIImporter_DlrNavteq::EdgesHandler::report(), Option_Float::set(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), and RODFDetector::writeEmitterDefinition().

template<class E >
static SUMOReal TplConvert::_2SUMORealSec ( const E *const  data,
SUMOReal  def 
)
inlinestatic

converts a 0-terminated char-type array into the SUMOReal value described by it returns the default value if the data is empty

Definition at line 336 of file TplConvert.h.

References _2SUMOReal().

Referenced by MSRouteHandler::openRouteDistribution(), and NIImporter_VISUM::parse_Edges().

template<class E >
static int TplConvert::_hex2int ( const E *const  data)
inlinestatic

converts a char-type array with a hex value into the integer value described by it throws an EmptyData - exception if the given string is empty throws a NumberFormatException - exception when the string does not contain an integer

Definition at line 128 of file TplConvert.h.

References _hex2long(), max, min, and SUMOLong.

Referenced by RGBColor::parseColor().

template<class E >
static SUMOLong TplConvert::_hex2long ( const E *const  data)
inlinestatic

converts a char-type array with a hex value into the long value described by it throws an EmptyData - exception if the given string is empty throws a NumberFormatException - exception when the string does not contain a long

Definition at line 177 of file TplConvert.h.

References SUMOLong.

Referenced by _hex2int().

template<class E >
static unsigned TplConvert::getLength ( const E *const  data)
inlinestatic

returns the length of the string (the position of the 0-character)

Definition at line 375 of file TplConvert.h.

Referenced by _2str(), and _2strSec().


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