Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Entry Class Reference

stores one inifile entry. More...

#include <inifile.h>

Inheritance diagram for rs::ini::Entry:

Inheritance graph
[legend]
Collaboration diagram for Entry:

Collaboration graph
[legend]
List of all members.

Public Methods

 Entry (const std::string &name_, const std::string &content_, unsigned long line_number=UNDEFINED_FILEPOSITION)
 create a new Entry. More...

virtual ~Entry ()
const SectionmySection () const
 get pointer to my Section. More...

bool changesMade () const
 test if Entry was changed. More...

const std::string & getName () const
 get name of entry. More...

const std::string & getContent () const
 get current value of the entry. More...

void setContent (const std::string &content_)
 set new value. More...

double getNumericContent () const
 get current value of the entry as numeric value. More...

long getIntegerContent () const
 get current value of the entry as numeric integer value. More...

void setNumericContent (double content_)
 sets the value of the Entry to a numeric value. More...

void mark_obsolete ()
 comment out obsolete entry. More...

bool operator< (const Entry &other) const
 compare two Entry's. More...

void dump (std::ostream &out) const
 write Entry to stream. More...

void throw_Error (const std::string &message) const
 throws an error referring the entry. More...


Private Methods

void set_changed ()
 mark entry as 'changed'. More...


Private Attributes

std::string name
std::string content
bool changed
Sectionmy_section

Friends

class Section

Detailed Description

stores one inifile entry.

Definition at line 158 of file inifile.h.


Constructor & Destructor Documentation

Entry const std::string &    name_,
const std::string &    content_,
unsigned long    line_number = UNDEFINED_FILEPOSITION
[inline]
 

create a new Entry.

Parameters:
content_  default content
name_  name of the Entry
line_number  line number in the inifile

Definition at line 177 of file inifile.h.

virtual ~Entry   [inline, virtual]
 

Definition at line 180 of file inifile.h.


Member Function Documentation

void set_changed   [inline, private]
 

mark entry as 'changed'.

Definition at line 166 of file inifile.h.

const Section* mySection   const [inline]
 

get pointer to my Section.

Returns:
pointer to my Section (or NULL if Entry was not yet inserted into a Section)

Definition at line 185 of file inifile.h.

Referenced by Entry::throw_Error().

bool changesMade   const [inline]
 

test if Entry was changed.

Returns:
true if Entry was changed

Definition at line 190 of file inifile.h.

const std::string& getName   const [inline]
 

get name of entry.

Returns:
the name of the Entry

Definition at line 195 of file inifile.h.

Referenced by Entry::throw_Error().

const std::string& getContent   const [inline]
 

get current value of the entry.

Definition at line 198 of file inifile.h.

void setContent const std::string &    content_ [inline]
 

set new value.

Definition at line 201 of file inifile.h.

double getNumericContent   const
 

get current value of the entry as numeric value.

Exceptions:
Error  if value is non-numeric

Definition at line 78 of file inifile.cpp.

long getIntegerContent   const
 

get current value of the entry as numeric integer value.

Exceptions:
Error  if value is non-numeric

Definition at line 95 of file inifile.cpp.

void setNumericContent double    content_ [inline]
 

sets the value of the Entry to a numeric value.

Parameters:
content_  the numeric value

Definition at line 222 of file inifile.h.

void mark_obsolete   [inline]
 

comment out obsolete entry.

Definition at line 227 of file inifile.h.

bool operator< const Entry &    other const [inline]
 

compare two Entry's.

Definition at line 230 of file inifile.h.

void dump std::ostream &    out const [inline]
 

write Entry to stream.

Reimplemented from Commentable.

Definition at line 233 of file inifile.h.

void throw_Error const std::string &    message const
 

throws an error referring the entry.

Definition at line 113 of file inifile.cpp.

Referenced by Entry::getIntegerContent(), and Entry::getNumericContent().


Friends And Related Function Documentation

friend class Section [friend]
 

Definition at line 168 of file inifile.h.


Member Data Documentation

std::string name [private]
 

Definition at line 160 of file inifile.h.

Referenced by Entry::operator<().

std::string content [private]
 

Definition at line 161 of file inifile.h.

Referenced by Entry::getIntegerContent(), and Entry::getNumericContent().

bool changed [private]
 

Definition at line 162 of file inifile.h.

Section* my_section [private]
 

Definition at line 163 of file inifile.h.


The documentation for this class was generated from the following files:
Contact me in case of errors or questions.
This documentation is powered by Doxygen.
(C) 2000-2002 Doxygen