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:
parent
d123edcf34
commit
fb4851514a
@ -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))
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user