Public Member Functions | Protected Attributes | Private Member Functions

xmlstorage::XMLInt Class Reference

type converter for integer data More...

Collaboration diagram for xmlstorage::XMLInt:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 this (int value)
 this (in char[] value, int def=0)
 this (XMLNode node, char[] attr_name, int def=0)
int opCast ()
char[] str ()

Protected Attributes

int _value

Private Member Functions

void opAssign (XMLInt)

Detailed Description

type converter for integer data

Definition at line 1329 of file xmlstorage.d.


Constructor & Destructor Documentation

xmlstorage::XMLInt::this ( int  value ) [inline]

Definition at line 1332 of file xmlstorage.d.

    {
        _value = value;
    }
xmlstorage::XMLInt::this ( in char[]  value,
int  def = 0 
) [inline]

Definition at line 1337 of file xmlstorage.d.

    {
        if (value && *value)
            _value = cast(int)atoi(value);
        else
            _value = def;
    }
xmlstorage::XMLInt::this ( XMLNode  node,
char[]  attr_name,
int  def = 0 
) [inline]

Definition at line 1345 of file xmlstorage.d.

    {
        char[] value = node.get(attr_name);

        if (value.length)
            _value = cast(int)atoi(value);
        else
            _value = def;
    }

Member Function Documentation

void xmlstorage::XMLInt::opAssign ( XMLInt   ) [private]
int xmlstorage::XMLInt::opCast (  ) [inline]

Definition at line 1355 of file xmlstorage.d.

    {
        return _value;
    }
char [] xmlstorage::XMLInt::str (  ) [inline]

Definition at line 1360 of file xmlstorage.d.

References xmlstorage::XS_INTFMT.

    {
        return format(XS_INTFMT, _value);
    }

Member Data Documentation

int xmlstorage::XMLInt::_value [protected]

Definition at line 1366 of file xmlstorage.d.


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