Logo
~Apps~
~Projects~
~Contact~


BTInteger Class Reference

Integer value in metainfo file. More...

#include <BTInteger.h>

Inheritance diagram for BTInteger:

Inheritance graph
[legend]
Collaboration diagram for BTInteger:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BTInteger ()
 ~BTInteger ()
char Type ()
void Show ()
std::string GetValue ()
void SetValue (const std::string &str)
int64_t GetVal ()

Private Attributes

std::string m_value
int64_t m_val

Detailed Description

Integer value in metainfo file.

File ......... BTInteger.h Published .... 2005-06-14 Author ....... grymse@alhem.net

Definition at line 37 of file BTInteger.h.


Constructor & Destructor Documentation

BTInteger::BTInteger (  )  [inline]

Definition at line 40 of file BTInteger.h.

00040 : BTObject(0),m_val(0) {}

BTInteger::~BTInteger (  )  [inline]

Definition at line 41 of file BTInteger.h.

00041 {}


Member Function Documentation

char BTInteger::Type (  )  [inline, virtual]

Implements BTObject.

Definition at line 42 of file BTInteger.h.

00042 { return 'i'; }

void BTInteger::Show (  )  [inline, virtual]

Reimplemented from BTObject.

Definition at line 43 of file BTInteger.h.

References GetValue(), and BTObject::Show().

00043                     {
00044                 BTObject::Show();
00045                 printf("%s ",GetValue().c_str());
00046         }

std::string BTInteger::GetValue (  )  [inline]

Definition at line 48 of file BTInteger.h.

References m_value.

Referenced by Show().

00048                              {
00049                 return m_value;
00050         }

void BTInteger::SetValue ( const std::string &  str  )  [inline]

Definition at line 51 of file BTInteger.h.

References m_val, and m_value.

00051                                             {
00052                 m_value = str;
00053                 m_val = 0;
00054                 for (size_t i = 0; i < str.size(); i++)
00055                 {
00056                         m_val = m_val * 10 + (str[i] - 48);
00057                 }
00058         }

int64_t BTInteger::GetVal (  )  [inline]

Definition at line 59 of file BTInteger.h.

References m_val.

00059 { return m_val; }


Member Data Documentation

std::string BTInteger::m_value [private]

Definition at line 62 of file BTInteger.h.

Referenced by GetValue(), and SetValue().

int64_t BTInteger::m_val [private]

Definition at line 63 of file BTInteger.h.

Referenced by GetVal(), and SetValue().


The documentation for this class was generated from the following file:
Page, code, and content Copyright (C) 2006 by Anders Hedström
Generated on Mon Aug 29 20:21:47 2005 for C++ Sockets by  doxygen 1.4.4