archives.cpp Sistemata giustificazione

array.h         Aggiunto default al metodo TPointer_array::add
assoc.h         Aggiunta macro di iterazione


git-svn-id: svn://10.65.10.50/trunk@6652 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1998-05-13 15:01:03 +00:00
parent 6ba60a03f1
commit e69efac5d4
4 changed files with 26 additions and 13 deletions

View File

@ -40,8 +40,6 @@ public:
~TProgress_win();
};
#endif
///////////////////////////////////////////////////////////
// TArchive
///////////////////////////////////////////////////////////
@ -102,6 +100,8 @@ FILE* TArchive::ask_disk(
return f;
}
#endif
long TArchive::fsize(FILE* f) const
{
CHECK(f, "Can't measure NULL file");
@ -178,6 +178,8 @@ int TArchive::build_restore_list(
return fl.items();
}
#if XVT_OS == XVT_OS_WIN
// @doc EXTERNAL
// @mfunc Spezza il file in modo da farlo stare sul dischetto
@ -545,7 +547,6 @@ bool TArchive::restore(long firm, char floppy, bool temp)
return ok;
}
#if XVT_OS == XVT_OS_WIN
void TArchive::stop_job()
{

View File

@ -26,16 +26,23 @@ class TArchive : public TObject
// @access:(INTERNAL) Private Member
{
#if XVT_OS == XVT_OS_WIN
// @ccost:(INTERNAL) BUFSIZE | 4096*7 | Dimensione del buffer di lettura/scrittura su dischetto
enum { BUFSIZE = 4096*7 };
// @cmember:(INTERNAL) Oggetto per la gestione di archivi (vedi <c ALArchive>)
ALArchive* _arc;
// @access Protected Member
protected:
// @cmember Funzione per richiedere all'utente il dischetto e per controllare la
// corretta sequenza dei dischetti da inserire
FILE* ask_disk(TFilename& name, int disk, char floppy, bool lettura) const;
// @cmember Spezza il file in modo da farlo stare sul dischetto
bool fsplit(const char* filename, char floppy, const char* desc = "") const;
// @cmember Ricostruisce il file spezzato
bool fbuild(const char* filename, char floppy) const;
#endif
// @access Protected Member
protected:
// @cmember Ritorna la dimensione del file <p f>
long fsize(FILE* f) const;
@ -43,14 +50,9 @@ protected:
// @cmember Sposta il file nella directory dir
bool move_file(const TFilename& file, const char* dir) const;
// @cmember Spezza il file in modo da farlo stare sul dischetto
bool fsplit(const char* filename, char floppy, const char* desc = "") const;
// @cmember Spezza il file.zip in modo da farlo stare sul dischetto
bool fsplit_zip(const char* filename, char floppy, const char* desc = "") const;
// @cmember Ricostruisce il file spezzato
bool fbuild(const char* filename, char floppy) const;
// @cmember Ricostruisce la lista dei file contenuti nel backup
int build_backup_list(long firm, TString_array& fl) const;
// @cmember Costruisce la lista delle directory da scompattare
@ -62,6 +64,8 @@ protected:
// @access Public Member
public:
#if XVT_OS == XVT_OS_WIN
// @cmember Effettua il backup della directory
bool backup(const char* dir, char floppy, const char* desc);
// @cmember Effettua il backup della ditta
@ -74,6 +78,7 @@ public:
// @cmember Interrompe le operazioni
void stop_job();
#endif
// @cmember Effettua il backup della directory
bool zip(const char* dir, char floppy, const char* desc);

View File

@ -220,8 +220,8 @@ class TPointer_array : public TArray
{
public:
virtual bool destroy(int index = -1, bool pack = FALSE);
virtual int add(TObject* object, int index);
virtual int add(const TObject& object, int index);
virtual int add(TObject* object, int index = -1);
virtual int add(const TObject& object, int index = -1);
virtual int insert(const TObject& object, int index = 0, bool force = FALSE);
virtual TPointer_array& operator= (const TArray& a);

View File

@ -153,6 +153,13 @@ public:
#define FOR_EACH_ASSOC_STRING(__ass, __obj, __key, __str) \
const char *__key, *__str; __ass.restart(); \
for (THash_object* __obj = __ass.get_hashobj(); \
__obj && ((__str = (const TString&)__obj->obj()) != NULL, (__key = __obj->key()) != NULL); \
__obj && ((__str = (const TString&)__obj->obj()) != NULL, __obj && (__key = __obj->key()) != NULL); \
__obj = __ass.get_hashobj())
#define FOR_EACH_ASSOC_OBJECT(__ass, __obj, __key, __itm) \
const char *__key; TObject* __itm; __ass.restart(); \
for (THash_object* __obj = __ass.get_hashobj(); \
__obj && (__itm = &__obj->obj()) != NULL, __obj && (__key = __obj->key()) != NULL; \
__obj = __ass.get_hashobj())
#endif