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

Dv::Util::Int Class Reference

Class wrapper for int. More...

#include <ntostr.h>

List of all members.

Public Member Functions

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

Private Attributes

int int_


Detailed Description

Class wrapper for int.

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

  int i = Int("14");

Definition at line 124 of file ntostr.h.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
s containing string representation of integer.
base used when converting 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::Int::operator int  )  const [inline]
 

Conversion to int.

Definition at line 134 of file ntostr.h.

References int_.

int Dv::Util::Int::value  )  const [inline]
 

Return associated numeric value.

Definition at line 136 of file ntostr.h.

References int_.


Member Data Documentation

int Dv::Util::Int::int_ [private]
 

Definition at line 138 of file ntostr.h.

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


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