Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

Dv::Util::Long Class Reference

Class wrapper for long. More...

#include <ntostr.h>

List of all members.

Public Member Functions

 Long (const std::string &s, int base=0) throw (std::domain_error)
 Constructor.
 operator long () const
 Conversion to int.
long value () const
 Return associated numeric value.

Private Attributes

long long_


Detailed Description

Class wrapper for long.

This class is useful for automatic conversion of a string to an long.

  long l = Long("14909090");

Definition at line 147 of file ntostr.h.


Constructor & Destructor Documentation

Dv::Util::Long::Long const std::string &  s,
int  base = 0
throw (std::domain_error)
 

Constructor.

Parameters:
s containing string representation of integer.
base used to convert s. The default is 0, in which case the function reads decimal or octal (if the string starts with 0) numbers.
Warning:
If decimal is necessary, specify base 10 explicitely!


Member Function Documentation

Dv::Util::Long::operator long  )  const [inline]
 

Conversion to int.

Definition at line 157 of file ntostr.h.

References long_.

long Dv::Util::Long::value  )  const [inline]
 

Return associated numeric value.

Definition at line 159 of file ntostr.h.

References long_.


Member Data Documentation

long Dv::Util::Long::long_ [private]
 

Definition at line 161 of file ntostr.h.

Referenced by operator long(), and value().


The documentation for this class was generated from the following file:
dvutil-0.13.15 [30 December, 2004]