diff --git a/include/files.cpp b/include/files.cpp index 9667da2bc..c14236ce9 100755 --- a/include/files.cpp +++ b/include/files.cpp @@ -289,6 +289,42 @@ void TDir::zero () zerofdes (_dir); } +void TDir::print_on (ostream & out) const + +{ + CHECK(_dir,"Can't print a NULL _dir"); + out << _num << '\n'; + out << (int)_com << '\n'; + out << _dir->SysName << '|'; + out << _dir->EOD << '|'; + out << _dir->EOX << '|'; + out << _dir->LenR << '|'; + out << _dir->Flags << '|'; + out << _dir->Des << '|'; + out << _dir->FCalc << '|'; + out << _dir->GenPrompt << '|' << '\n'; +} + +void TDir::read_from (istream & in) + +{ + CHECK(_dir,"Can't read into a NULL _dir"); + in.getline (_files_tmp_string, sizeof (_files_tmp_string), '\n'); + _num = atoi(_files_tmp_string); + in.getline (_files_tmp_string, sizeof (_files_tmp_string), '\n'); + _com = (bool) atoi(_files_tmp_string); + in.getline (_files_tmp_string, sizeof (_files_tmp_string), '\n'); + TToken_string line(_files_tmp_string,'|'); + line.restart(); + strcpy(_dir->SysName,line.get()); + _dir->EOD = line.get_long(); + _dir->EOX = line.get_long(); + _dir->LenR = line.get_int(); + _dir->Flags = line.get_long(); + strcpy(_dir->Des,line.get()); + strcpy(_dir->FCalc,line.get()); + strcpy(_dir->GenPrompt,line.get()); +} // @doc EXTERNAL @@ -583,9 +619,9 @@ void TTrec::read_from (istream & in) t = _files_tmp_string; const int itms = t.items(); + update_fielddef (i, _files_tmp_string); if (_des && itms == 5) // La descrizione viene caricata solo se esiste _des->set(_rec->Fd[i].Name, t.get(itms-1)); - update_fielddef (i, _files_tmp_string); } int nkeys; diff --git a/include/files.h b/include/files.h index 56eb9282b..31685ac44 100755 --- a/include/files.h +++ b/include/files.h @@ -118,6 +118,11 @@ public: // @cmember Setta il file con i parametri passati void set (const char * name, const RecNoType eod, const RecNoType flag, const char * des, const char * calc); + // @cmember Stampa la descrizione del direttorio sull'output selezionato + virtual void print_on(ostream& out) const; + // @cmember Legge la descrizione del direttorio dall' input selezionato + virtual void read_from(istream& in); + // @cmember Ritorna il nome del file selezionato const char* name() const; // @cmember Ritorna il nome dei file dati selezionato