tConfItemLine Class Reference

#include <tConfiguration.h>

Inheritance diagram for tConfItemLine:

Inheritance graph
[legend]
Collaboration diagram for tConfItemLine:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 tConfItemLine (const char *title, const char *help, tString &s, callbackFunc *cb=0)
virtual ~tConfItemLine ()
 tConfItemLine (const char *title, tString &s, callbackFunc *cb=0)
virtual void ReadVal (std::istream &s)
virtual void WriteVal (std::ostream &s)


Detailed Description

Definition at line 338 of file tConfiguration.h.


Constructor & Destructor Documentation

tConfItemLine::tConfItemLine ( const char *  title,
const char *  help,
tString s,
callbackFunc *  cb = 0 
) [inline]

Definition at line 340 of file tConfiguration.h.

virtual tConfItemLine::~tConfItemLine (  )  [inline, virtual]

Definition at line 343 of file tConfiguration.h.

00343 {}

tConfItemLine::tConfItemLine ( const char *  title,
tString s,
callbackFunc *  cb = 0 
) [inline]

Definition at line 345 of file tConfiguration.h.


Member Function Documentation

void tConfItemLine::ReadVal ( std::istream &  s  )  [virtual]

Implements tConfItemBase.

Definition at line 868 of file tConfiguration.cpp.

References tConfItemBase::changed, tColoredString::ColorString(), con, tConfItemBase::ExecuteCallback(), tConfItemBase::printChange, tString::ReadLine(), tOutput::SetTemplateParameter(), tConfItem< tString >::target, and tConfItemBase::title.

00868                                         {
00869     tString dummy;
00870     dummy.ReadLine(s, true);
00871     if(strcmp(dummy,*target)){
00872         if (printChange)
00873         {
00874             tColoredString oldval;
00875             oldval << *target << tColoredString::ColorString(1,1,1);
00876             tColoredString newval;
00877             newval << dummy << tColoredString::ColorString(1,1,1);
00878             tOutput o;
00879             o.SetTemplateParameter(1, title);
00880             o.SetTemplateParameter(2, oldval);
00881             o.SetTemplateParameter(3, newval);
00882             o << "$config_value_changed";
00883             con << o;
00884         }
00885         *target=dummy;
00886         changed=true;
00887 
00888         ExecuteCallback();
00889     }
00890 
00891     *target=dummy;
00892 }

Here is the call graph for this function:

void tConfItemLine::WriteVal ( std::ostream &  s  )  [virtual]

Implements tConfItemBase.

Definition at line 895 of file tConfiguration.cpp.

References tString::Len(), tConfItem< tString >::target, and tConfItem< T >::WriteVal().

00895                                          {
00896     tConfItem<tString>::WriteVal(s);
00897 
00898     // double trailing backslash so it is read back as a single backslash, not
00899     // a continued line (HACK: this would actually be the job of the calling function)
00900     if ( target->Len() >= 2 &&
00901             target->operator()(target->Len() - 2) == '\\' )
00902         s << "\\";
00903 }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:55:37 2008 for Armagetron Advanced by  doxygen 1.5.4