Riportate modifiche per membro _write_protect e relativi metodi.

git-svn-id: svn://10.65.10.50/trunk@6031 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1998-01-26 10:29:26 +00:00
parent d123edcf34
commit fb4851514a
2 changed files with 19 additions and 7 deletions

View File

@ -98,6 +98,9 @@ void TConfig::_write_paragraph(
void TConfig::_write_file()
{
if (_write_protected)
return;
ifstream in(_file);
TFilename temp;
temp.temp("cnf");
@ -537,6 +540,7 @@ void TConfig::init(
_file = fn;
_paragraph = pa;
_dirty = FALSE;
_write_protected = FALSE;
if (!fexist(_file))
{

View File

@ -56,6 +56,8 @@ class TConfig : public TObject
TFilename _file;
// @cmember:(INTERNAL) Indica se il paragrafo e' stato modificato (TRUE se esiste)
bool _dirty;
// @cmember:(INTERNAL) Indica se proteggere il TConfig da scrittura
bool _write_protected;
// @cmember:(INTERNAL) Indica se il paragrafo e' presente (TRUE se esiste)
bool _ispresent;
// @cmember:(INTERNAL) Nome del paragrafo attivo
@ -145,6 +147,12 @@ public:
// @cmember Ritorna il nome del file di configurazione
const TFilename& name() const { return _file; }
// @cmember Setta il valore del flag di protezione da scrittura
void write_protect(const bool b = TRUE) { _write_protected = b; }
// @cmember Ritorna il valore del flag di protezione da scrittura
const bool is_write_protected() const { return _write_protected; }
// @cmember Costruttore (il paragrafo iniziale e' il modulo corrente
// salvo diversa indicazione)
TConfig(int which_config = CONFIG_GENERAL, const char* paragraph = NULL);