OPP_Global Namespace Reference


Functions

std::string ltostr (long i)
std::string dtostr (double d)
double atod (const char *s)
unsigned long atoul (const char *s)


Function Documentation

double OPP_Global::atod ( const char *  s  ) 

Converts string to double

00039 {
00040     char *e;
00041     double d = ::strtod(s,&e);
00042     if (*e)
00043         throw cRuntimeError("invalid cast: '%s' cannot be interpreted as a double", s);
00044     return d;
00045 }

unsigned long OPP_Global::atoul ( const char *  s  ) 

Converts string to unsigned long

Referenced by RoutingTable6::configureInterfaceFromXML().

00048 {
00049     char *e;
00050     unsigned long d = ::strtoul(s,&e,10);
00051     if (*e)
00052         throw cRuntimeError("invalid cast: '%s' cannot be interpreted as an unsigned long", s);
00053     return d;
00054 }

std::string OPP_Global::dtostr ( double  d  ) 

Converts a double to string

00032 {
00033     std::ostringstream os;
00034     os << d;
00035     return os.str();
00036 }

std::string OPP_Global::ltostr ( long  i  ) 

Converts an integer to string.

00025 {
00026     std::ostringstream os;
00027     os << i;
00028     return os.str();
00029 }


Generated on Fri Mar 20 18:51:23 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5