Aggiunti metodi ai Trecord_array
git-svn-id: svn://10.65.10.50/trunk@1249 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d87a2cfd29
commit
1f56500d97
@ -1,4 +1,4 @@
|
||||
/* $Id: relation.h,v 1.13 1995-04-10 15:27:53 guy Exp $ */
|
||||
/* $Id: relation.h,v 1.14 1995-04-14 12:14:16 guy Exp $ */
|
||||
// join.h
|
||||
// fv 12/8/93
|
||||
// join class for isam files
|
||||
@ -148,31 +148,34 @@ public:
|
||||
|
||||
class TRecord_array : private TArray
|
||||
{
|
||||
int _file;
|
||||
TString16 _num;
|
||||
int _file; // Numero logico del file principale
|
||||
TString16 _num; // Nome del campo col numero di riga
|
||||
|
||||
private:
|
||||
int rec2row(const TRectype& r) const;
|
||||
int rec2row(const TRectype& r) const; // Estrae il numero riga di un record
|
||||
const TRectype& key() const { return (const TRectype&)operator[](0); }
|
||||
|
||||
protected:
|
||||
virtual bool destroy_row(int n);
|
||||
|
||||
public:
|
||||
int rows() const { return items()-1; }
|
||||
int last_row() const { return last(); }
|
||||
int rows() const { return items()-1; } // Numero di righe presenti
|
||||
int last_row() const { return last(); } // Ultima riga
|
||||
|
||||
const TRectype& row(int r) const
|
||||
{ CHECKD(r > 0, "Bad record number ", r); return (TRectype&)operator[](r); }
|
||||
const TRectype& row(int r) const // Ennesima riga costante
|
||||
{ CHECKD(r > 0, "Bad record number ", r); return (const TRectype&)operator[](r); }
|
||||
|
||||
virtual int add_row(const TRectype& r);
|
||||
virtual bool destroy_row(const TRectype& r) { return destroy_row(rec2row(r)); }
|
||||
void destroy_rows();
|
||||
TRectype& row(int r, bool create); // Ennesima riga
|
||||
|
||||
virtual bool read(const TRectype& r);
|
||||
virtual bool write(bool re = FALSE);
|
||||
virtual bool rewrite() { return write(TRUE); }
|
||||
virtual bool remove();
|
||||
virtual int add_row(const TRectype& r); // Aggiungi/cambia una riga
|
||||
virtual bool destroy_row(int n, bool pack = FALSE); // Cancella una riga
|
||||
virtual bool destroy_row(const TRectype& r, bool pack = FALSE) { return destroy_row(rec2row(r), pack); }
|
||||
void destroy_rows(); // Cancella tutte le righe
|
||||
|
||||
bool renum_key(const char* field, const TString& num);
|
||||
bool renum_key(const char* field, long num); // Rinumera campo chiave in seguito a reinsert
|
||||
|
||||
virtual int read(const TRectype& r); // Leggi tutto l'array da file
|
||||
virtual int write(bool re = FALSE); // Aggiorna il file
|
||||
virtual int rewrite() { return write(TRUE); }
|
||||
virtual int remove(); // Cancella tutti i record dal file
|
||||
|
||||
TRecord_array(const TRectype& r, const char* numfield);
|
||||
TRecord_array(int logicnum, const char* numfield);
|
||||
@ -268,7 +271,7 @@ public:
|
||||
void save_status () { _if->save_status(); }
|
||||
void restore_status () { _if->restore_status(); }
|
||||
|
||||
TCursor(TRelation* f, const char* filter = "", int key = 1, TRectype* from = NULL, TRectype* to = NULL);
|
||||
TCursor(TRelation* f, const char* filter = "", int key = 1, const TRectype* from = NULL, const TRectype* to = NULL);
|
||||
virtual ~TCursor();
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user