array.cpp Tolte alcune righe vuote

assoc.cpp     Stessa roba
object.h      Aggiunti distruttori virtuali
printapp.cpp  Sostituito == -1 con < 0 nei metodi set/get_cursor
relation.cpp  Riportate modifiche suggerite da Angelo
string.*      Aggiunti distruttori virtuali


git-svn-id: svn://10.65.10.50/trunk@3740 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-10-09 14:18:33 +00:00
parent c0919496e6
commit 51236253f8
8 changed files with 34 additions and 13 deletions

View File

@ -217,7 +217,6 @@ TArray& TArray::operator= (const TArray& a)
}
TArray::~TArray()
{
if (ok())
{
@ -226,7 +225,6 @@ TArray::~TArray()
}
}
const char* TArray::class_name() const
{
return "Array";

View File

@ -243,7 +243,7 @@ bool TAssoc_array::is_key(
bool isnew = FALSE;
THash_object* o = ((TAssoc_array *)this)->_lookup(key,isnew);
return o != NULL;
}
}
// @doc EXTERNAL

View File

@ -103,6 +103,9 @@ public:
virtual const char* class_name() const;
// @cmember Ritorna l'id della classe
virtual word class_id() const;
// @cmember Distruttore
virtual ~TSortable()
{}
};

View File

@ -442,13 +442,13 @@ TString& fill_str (TString & t, char f)
void TPrint_application::select_cursor (int c)
{
if (c == -1) _cur = NULL;
if (c < 0) _cur = NULL;
else _cur = (TCursor *) & _cursors[c];
}
TCursor* TPrint_application::get_cursor (int c)
{
if (c == -1) return NULL;
if (c < 0) return NULL;
else return (TCursor *) & _cursors[c];
}

View File

@ -1340,8 +1340,9 @@ bool TCursor::is_first_match(int ln)
// TSorted_cursor
///////////////////////////////////////////////////////////
typedef struct {
char f[512];
typedef struct
{
char f[256];
TRecnotype p;
} El_To_Sort;
@ -1489,15 +1490,18 @@ TRecnotype TSorted_cursor::buildcursor(TRecnotype rp)
ap += pagecnt;
}
_sort->endsort();
pagecnt=0;
ap = 0;
pagecnt = 0;
while ((Element=(El_To_Sort *)_sort->retrieve()) != NULL)
{
page[pagecnt++]=Element->p;
if (pagecnt==CMAXELPAGE)
{
page[pagecnt++]=Element->p;
if (pagecnt==CMAXELPAGE)
{
fwrite(page,sizeof(TRecnotype),pagecnt,_f);
pagecnt=0;
}
ap++;
}
if (pagecnt)
fwrite(page,sizeof(TRecnotype),pagecnt,_f);
@ -1505,6 +1509,7 @@ TRecnotype TSorted_cursor::buildcursor(TRecnotype rp)
delete page;
if (_sort) delete _sort;
fclose (_f);
return ap;
}
@ -1816,6 +1821,10 @@ TRecord_array::TRecord_array(const TRecord_array& a)
: TArray(a), _file(a._file), _offset(a._offset), _num(a._num)
{}
TRecord_array::~TRecord_array()
{
}
void TRecord_array::set_key(TRectype* r)
{
CHECK(r != NULL, "TRecord_array can't have a null key");

View File

@ -322,6 +322,8 @@ public:
TRecord_array(int logicnum, const char* numfield, int first = 1);
// @cmember Costruttore
TRecord_array(const TRecord_array& a);
// @cmember Distruttore
virtual ~TRecord_array();
};

View File

@ -1092,6 +1092,11 @@ const TFilename& TFilename::temp(
// Token string
///////////////////////////////////////////////////////////
// Certified 100%
TToken_string::~TToken_string()
{
}
// Certified 100%
TToken_string::TToken_string(const char* s, char separator)
: TString(s), _separator(separator)

View File

@ -429,7 +429,6 @@ public:
class TToken_string : public TString
// @author:(INTERNAL) Guido
{
// @access:(INTERNAL) Private Member
// @cmember:(INTERNAL) Carattere separatore
@ -452,6 +451,8 @@ public:
TToken_string(int n, char separator = '|');
// @cmember Costruttore
TToken_string(const TToken_string& s);
// @cmember Distruttore
~TToken_string();
// @cmember Setta il carattere separatore a s
void separator(char s);
@ -523,6 +524,10 @@ protected:
public:
// @cmember Costruttore
TParagraph_string(const char* s, int width);
// @cmember Distruttore
virtual ~TParagraph_string() { }
// @cmember Assegna una stringa
const TString& operator =(const char* s);
// @cmember Assegna un oggetto stringa
@ -545,7 +550,6 @@ public:
class TString_array : public TArray
// @author:(INTERNAL) Guido
{
// @access Public Member
public:
// @cmember Ritorna la stringa n dell'array (se non c'e' ritorna errore)