SUMO - Simulation of Urban MObility
TplConvert< E > Class Template Reference

#include <TplConvert.h>

Static Public Member Functions

static bool _2bool (const E *const data)
static bool _2bool (const E *const data, unsigned length)
static char * _2charp (const E *const data)
static char * _2charp (const E *const data, int length)
static int _2int (const E *const data)
static int _2int (const E *const data, unsigned length)
static long _2long (const E *const data)
static long _2long (const E *const data, unsigned length)
static std::string _2str (const E *const data)
static std::string _2str (const E *const data, unsigned length)
static SUMOReal _2SUMOReal (const E *const data)
static SUMOReal _2SUMOReal (const E *const data, unsigned length)
static unsigned getLength (const E *const data)

Detailed Description

template<class E>
class TplConvert< E >

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< E >::_2bool ( const E *const  data) [inline, static]

converts a 0-terminated char-type array into the SUMOReal value described by it returns true when the first char is one of the following: '1', 'x', 't', 'T' throws an EmptyData - exception if the given string is empty

Definition at line 96 of file TplConvert.h.

Referenced by SUMOSAXAttributesImpl_Xerces::getBool().

template<class E>
static bool TplConvert< E >::_2bool ( const E *const  data,
unsigned  length 
) [inline, static]

converts a char-type array into the SUMOReal value described by it considering the given length returns true when the first char is one of the following: '1', 'x', 't', 'T' throws an EmptyData - exception if the given string is empty

Definition at line 282 of file TplConvert.h.

template<class E>
static char* TplConvert< E >::_2charp ( const E *const  data) [inline, static]

converts a 0-terminated char-type array into a 0-terminated 0-terminated c-char-string throws an EmptyData - exception if the given string is empty

Definition at line 104 of file TplConvert.h.

References TplConvert< E >::getLength().

template<class E>
static char* TplConvert< E >::_2charp ( const E *const  data,
int  length 
) [inline, static]

converts a char-type array into a 0-terminated 0-terminated c-char-string considering the given length throws an EmptyData - exception if the given string is empty

Definition at line 300 of file TplConvert.h.

template<class E>
static int TplConvert< E >::_2int ( const E *const  data) [inline, static]

converts a 0-terminated 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 66 of file TplConvert.h.

Referenced by TplConvert< E >::_2SUMOReal(), SUMOSAXAttributesImpl_Xerces::getInt(), getVehicleEmissionTypeID(), parseSingleTime(), parseTimeLine(), RODFDetFlowLoader::read(), readO(), and readV().

template<class E>
static int TplConvert< E >::_2int ( const E *const  data,
unsigned  length 
) [inline, static]

converts a char-type array into the integer value described by it considering the given length 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 141 of file TplConvert.h.

template<class E>
static long TplConvert< E >::_2long ( const E *const  data) [inline, static]

converts a 0-terminated 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 76 of file TplConvert.h.

Referenced by SUMOSAXAttributesImpl_Xerces::getLong().

template<class E>
static long TplConvert< E >::_2long ( const E *const  data,
unsigned  length 
) [inline, static]

converts a char-type array into the long value described by it considering the given length 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 175 of file TplConvert.h.

template<class E>
static std::string TplConvert< E >::_2str ( const E *const  data) [inline, static]

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

Definition at line 56 of file TplConvert.h.

References TplConvert< E >::getLength().

Referenced by SUMOSAXAttributesImpl_Xerces::getString().

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

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

Definition at line 113 of file TplConvert.h.

template<class E>
static SUMOReal TplConvert< E >::_2SUMOReal ( const E *const  data) [inline, static]

converts a 0-terminated 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 86 of file TplConvert.h.

Referenced by SUMOSAXAttributesImpl_Xerces::getFloat(), NIImporter_VISUM::getNamedFloat(), getTurningDefaults(), RGBColor::parseColor(), parseTimeLine(), RODFDetFlowLoader::read(), readFactor(), readO(), and readV().

template<class E>
static SUMOReal TplConvert< E >::_2SUMOReal ( const E *const  data,
unsigned  length 
) [inline, static]

converts a char-type array into the SUMOReal value described by it considering the given length 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 209 of file TplConvert.h.

References TplConvert< E >::_2int(), and SUMOReal.

template<class E>
static unsigned TplConvert< E >::getLength ( const E *const  data) [inline, static]

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

Definition at line 315 of file TplConvert.h.

Referenced by TplConvert< E >::_2charp(), and TplConvert< E >::_2str().


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines