form.cpp Migliorata indentazione
isam.* Migliorata gestione handles dei file isam aperti os_win16.cpp Migliorate le funzioni di riconoscimento del tipo di disco os_win32.cpp Semplificati calcoli di centrature icone git-svn-id: svn://10.65.10.50/trunk@6456 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
043790be92
commit
918068e758
@ -3697,10 +3697,10 @@ bool TForm::reread(
|
||||
if (key == "SE" || key == "") // ..if section or end of file...
|
||||
break;
|
||||
}
|
||||
const char secr = scanner.popkey()[0]; // Section name (GRAPH, HEAD, BODY, FOOT)
|
||||
const char secr = scanner.popkey()[0]; // Section name (GRAPH, HEAD, BODY, FOOT)
|
||||
if (secr=='\0') break;
|
||||
const pagetype pr = char2page(scanner.popkey()[0]); // Section type (odd, even, first, last)
|
||||
if (secr==sec && pr==p) ok = TRUE; // L'ha trovata...
|
||||
if (secr == sec && pr == p) ok = TRUE; // L'ha trovata...
|
||||
}
|
||||
// ...riesegue la parse della sezione leggendo dal file sorgente
|
||||
if(ok && s->parse(scanner))
|
||||
|
1604
include/isam.cpp
1604
include/isam.cpp
File diff suppressed because it is too large
Load Diff
122
include/isam.h
122
include/isam.h
@ -31,7 +31,9 @@ class TTextfile;
|
||||
|
||||
const int MAX_KEYS = 8;
|
||||
|
||||
class TBaseisamfile;
|
||||
class TLocalisamfile;
|
||||
class TRecfield;
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
||||
@ -40,23 +42,14 @@ class TLocalisamfile;
|
||||
// @base public | TSortable
|
||||
class TRectype : public TSortable
|
||||
|
||||
// @author:(INTERNAL) Sandro
|
||||
// @author:(INTERNAL) Alex
|
||||
|
||||
{
|
||||
// @cfriend TExtrectype
|
||||
friend class TExtrectype;
|
||||
// @cfriend TRecfield
|
||||
friend class TRecfield;
|
||||
// @cfriend TBaseisamfile
|
||||
friend class TBaseisamfile;
|
||||
// @cfriend TLocalisamfile
|
||||
friend class TLocalisamfile;
|
||||
// @cfriend TIsamtempfile
|
||||
friend class TIsamtempfile;
|
||||
// @cfriend TExternisamfile
|
||||
friend class TExternisamfile;
|
||||
|
||||
// @access:(INTERNAL) Private Member
|
||||
// @access Protected Member
|
||||
protected:
|
||||
|
||||
// @cmember:(INTERNAL) Puntatore all'inizio del record
|
||||
char* _rec;
|
||||
@ -69,10 +62,10 @@ class TRectype : public TSortable
|
||||
// @cmember:(INTERNAL) Indentificatore della tabella
|
||||
char _tab[5];
|
||||
// @cmember:(INTERNAL) Campo "COD" della tabella
|
||||
TRecfield * _cod;
|
||||
TBit_array * _memo_dirty;
|
||||
TString_array * _memo_data;
|
||||
TRecnotype _memo_recno;
|
||||
TRecfield* _cod;
|
||||
TBit_array* _memo_dirty;
|
||||
TString_array* _memo_data;
|
||||
TRecnotype _memo_recno;
|
||||
|
||||
// @access Protected Member
|
||||
protected:
|
||||
@ -222,7 +215,6 @@ public:
|
||||
// @cmember Assegnazione tra TRectype
|
||||
TRectype& operator =(const TBaseisamfile& f);
|
||||
|
||||
|
||||
// @cmember Ritorna il descrittore del record
|
||||
virtual RecDes * rec_des() const;
|
||||
// @cmember Ritorna il numero logico del record
|
||||
@ -241,7 +233,7 @@ public:
|
||||
{ return _rec != NULL; }
|
||||
|
||||
virtual void init_memo(const TRecnotype recno = RECORD_NON_FISICO);
|
||||
virtual void write_memo(isdef * file, const TRecnotype recno);
|
||||
virtual void write_memo(int fhnd, const TRecnotype recno);
|
||||
bool has_memo() const { return _memo_data != NULL; }
|
||||
void memo_recno (const TRecnotype recno = RECORD_NON_FISICO) { _memo_recno = recno; }
|
||||
|
||||
@ -264,41 +256,31 @@ public:
|
||||
// @base public | TObject
|
||||
class TBaseisamfile : public TObject
|
||||
|
||||
// @author:(INTERNAL) Sandro
|
||||
// @author:(INTERNAL) Alex
|
||||
|
||||
{
|
||||
// @cfriend TRectype
|
||||
friend class TRectype;
|
||||
// @cfriend TLocalisamfile
|
||||
friend class TLocalisamfile;
|
||||
// @cfriend TIsamfile
|
||||
friend class TIsamfile;
|
||||
// @cfriend TIsamtempfile
|
||||
friend class TIsamtempfile;
|
||||
// @cfriend TExternisamfile
|
||||
friend class TExternisamfile;
|
||||
// @cfriend TRecfield
|
||||
friend class TRecfield;
|
||||
// friend class TCursor;
|
||||
// friend TRecnotype __buildcursor(TFilecursor* tic, TRecnotype rp);
|
||||
// friend TRecnotype __filtercursor(TFilecursor* tic);
|
||||
// friend bool __evalcondition(TBaseisamfile* i,TString& condition);
|
||||
// friend void __readrec(TFilecursor* tic);
|
||||
// @cfriend TCursor
|
||||
friend class TCursor;
|
||||
// @cfriend TSorted_cursor
|
||||
friend class TSorted_cursor;
|
||||
|
||||
// @access Protected Member
|
||||
protected:
|
||||
|
||||
// @access:(INTERNAL) Private Member
|
||||
|
||||
// @cmember:(INTERNAL) Descrittore del file isam
|
||||
isdef* _isamfile;
|
||||
// @cmember:(INTERNAL) Numero logico del record corrente
|
||||
int _logicnum;
|
||||
// @cmember:(INTERNAL) Isam handle
|
||||
int _isam_handle;
|
||||
// @cmember:(INTERNAL) Chiave corrente
|
||||
int _curr_key;
|
||||
// @cmember:(INTERNAL) Ultimo errore
|
||||
int _lasterr;
|
||||
// @cmember:(INTERNAL) Puntatore a record corrente
|
||||
TRectype* _current;
|
||||
// @cmember:(INTERNAL) Record corrente
|
||||
TRecnotype _recno;
|
||||
// @cmember:(INTERNAL) Indica se il file possiede dei campi memo
|
||||
bool _has_memo;
|
||||
|
||||
// @access Protected Member
|
||||
protected:
|
||||
@ -309,12 +291,6 @@ protected:
|
||||
virtual int _write(const TRectype& rec);
|
||||
virtual int _rewrite(const TRectype& rec);
|
||||
virtual int _remove(const TRectype& rec);
|
||||
// @cmember Ritorna il descrittore del file isam
|
||||
isdef** ptrfilehnd() const
|
||||
{ return (isdef**) &_isamfile;}
|
||||
// @cmember Assegna NULL al descrittore del file isam
|
||||
void clearfilehnd()
|
||||
{ _isamfile = NULL;}
|
||||
|
||||
// @cmember UNUSED
|
||||
void recover();
|
||||
@ -329,7 +305,9 @@ protected:
|
||||
const char* filename() const;
|
||||
|
||||
// @cmember Costruttore per derivare TExternisamfile. <p Name> indica il file esterno da aprire.
|
||||
TBaseisamfile(const char* name);
|
||||
TBaseisamfile(const char* name, int mode, bool index);
|
||||
|
||||
int handle(int key = 0) const;
|
||||
|
||||
// @access Public Member
|
||||
public:
|
||||
@ -429,10 +407,6 @@ public:
|
||||
// @cmember Ritorna il numero di record contenuti nel file corrente
|
||||
virtual TRecnotype eod() const ;
|
||||
|
||||
// @cmember Ritorna l'handle del file isam nella tabella
|
||||
isdef* filehnd() const
|
||||
{ return (isdef*) _isamfile;}
|
||||
|
||||
// @cmember Numero di records presenti nel file
|
||||
long items() const; // n.o di records nel file
|
||||
|
||||
@ -543,7 +517,8 @@ class TIsamfile : public TBaseisamfile
|
||||
// @access Public Member
|
||||
public:
|
||||
// @cmember Aggiorna i flags associati al file
|
||||
int flags(bool updateeod = FALSE);
|
||||
// int flags(bool updateeod = FALSE);
|
||||
|
||||
// @cmember Apre un file di isam con lock (vedi <mf TBaseisamfile::_open>)
|
||||
int open(unsigned int mode = _manulock, bool index = TRUE)
|
||||
{ return _open(mode, index); }
|
||||
@ -629,13 +604,6 @@ class TLocalisamfile : public TBaseisamfile
|
||||
|
||||
// @author:(INTERNAL) Sandro
|
||||
{
|
||||
// @access:(INTERNAL) Private Member
|
||||
|
||||
// @cmember:(INTERNAL) Indica se il file e' stato aperto come Localisamfile
|
||||
bool _was_open;
|
||||
// @cmember:(INTERNAL) Vecchia chiave se il file e' gia' aperto
|
||||
int _oldkey;
|
||||
|
||||
// @access Protected Member
|
||||
protected:
|
||||
// @cmember Apre il file con lock (vedi <mf TBaseisamfile::_open>)
|
||||
@ -646,7 +614,7 @@ protected:
|
||||
// @cmember Costruttore per derivare TTempIsamfile
|
||||
TLocalisamfile(int logicnum, bool tmp);
|
||||
// @cmember Costruttore per derivare TExternisamfile. <p Name> indica il file esterno da aprire (vedi <c TBaseisamfile>).
|
||||
TLocalisamfile(const char* name);
|
||||
TLocalisamfile(const char* name, int mode, bool index);
|
||||
|
||||
// @access Public Member
|
||||
public:
|
||||
@ -676,7 +644,7 @@ public:
|
||||
// @base public | TLocalisamfile
|
||||
class TIsamtempfile : public TLocalisamfile
|
||||
|
||||
// @author:(INTERNAL) Sandro
|
||||
// @author:(INTERNAL) Alex
|
||||
{
|
||||
|
||||
// @access:(INTERNAL) Private Member
|
||||
@ -712,52 +680,24 @@ class TExternisamfile : public TLocalisamfile
|
||||
|
||||
// @author:(INTERNAL) Angelo
|
||||
{
|
||||
|
||||
// @access:(INTERNAL) Private Member
|
||||
|
||||
//@cmember:(INTERNAL) Indica il nome del file col quale e' stata instanziata la classe
|
||||
TFilename _name;
|
||||
|
||||
// @access Protected Member
|
||||
protected:
|
||||
// @cmember Apre il file. <p exclusive> indica se aprire il file in modo esclusivo
|
||||
int open(bool exclusive, bool index = TRUE);
|
||||
// @cmember Chiude il file
|
||||
int close();
|
||||
|
||||
// @access Public Member
|
||||
public:
|
||||
// @cmember Ritorna il nome del file sotto forma di stringa
|
||||
virtual const char* name() const;
|
||||
// @cmember Costruttore. <p exclusive> indica se aprire il file in modo esclusivo.
|
||||
// <p index> indica se aprire il file con indici o meno
|
||||
TExternisamfile(const char* name, bool exclusive = FALSE, bool index = TRUE);
|
||||
TExternisamfile(const char* name, int mode = _nolock, bool index = TRUE);
|
||||
// @cmember Distruttore
|
||||
virtual ~TExternisamfile();
|
||||
};
|
||||
|
||||
|
||||
// @doc EXTERNAL
|
||||
|
||||
// @class TRec_array | Classe per la definizione un array di record
|
||||
//
|
||||
// @base public | TArray
|
||||
class TRec_array : public TArray
|
||||
|
||||
// @author:(INTERNAL) Sandro
|
||||
{
|
||||
// @access Public Member
|
||||
public:
|
||||
// @cmember Costruttore.
|
||||
TRec_array(int dimension, TBaseisamfile& i);
|
||||
};
|
||||
|
||||
// @class TRecfield | Classe per la gestione dei campi di un record
|
||||
//
|
||||
// @base public | TObject
|
||||
class TRecfield : public TObject
|
||||
|
||||
// @author:(INTERNAL) Guido
|
||||
// @author:(INTERNAL) Alex
|
||||
|
||||
// @access:(INTERNAL) Private Member
|
||||
{
|
||||
|
@ -321,8 +321,8 @@ bool os_destroy_native_icon(unsigned icon)
|
||||
void os_draw_native_icon(WINDOW win, const RCT& rct, unsigned icon)
|
||||
{
|
||||
HDC hdc = (HDC)xvt_vobj_get_attr(win, ATTR_NATIVE_GRAPHIC_CONTEXT);
|
||||
int x = rct.left + (rct.right - rct.left - 32) / 2;
|
||||
int y = rct.top + (rct.bottom - rct.top - 32) / 2;
|
||||
int x = (rct.right + rct.left - 32) / 2;
|
||||
int y = (rct.bottom + rct.top - 32) / 2;
|
||||
DrawIcon(hdc, x, y, (HICON)icon);
|
||||
}
|
||||
|
||||
@ -333,7 +333,7 @@ unsigned long os_get_free_memory()
|
||||
|
||||
bool os_is_removable_drive(const char* path)
|
||||
{
|
||||
bool yes = path[1] == ':';
|
||||
bool yes = isalpha(path[0]) && path[1] == ':';
|
||||
if (yes)
|
||||
yes = GetDriveType(toupper(path[0]) - 'A') == DRIVE_REMOVABLE;
|
||||
return yes;
|
||||
@ -341,7 +341,7 @@ bool os_is_removable_drive(const char* path)
|
||||
|
||||
bool os_is_network_drive(const char* path)
|
||||
{
|
||||
bool yes = path[1] == ':';
|
||||
bool yes = isalpha(path[0]) && path[1] == ':';
|
||||
if (yes)
|
||||
yes = GetDriveType(toupper(path[0]) - 'A') == DRIVE_REMOTE;
|
||||
return yes;
|
||||
@ -349,7 +349,7 @@ bool os_is_network_drive(const char* path)
|
||||
|
||||
bool os_is_fixed_drive(const char* path)
|
||||
{
|
||||
bool yes = path[1] == ':';
|
||||
bool yes = isalpha(path[0]) && path[1] == ':';
|
||||
if (yes)
|
||||
yes = GetDriveType(toupper(path[0]) - 'A') == DRIVE_FIXED;
|
||||
return yes;
|
||||
|
@ -142,8 +142,8 @@ bool os_destroy_native_icon(unsigned icon)
|
||||
void os_draw_native_icon(WINDOW win, const RCT& rct, unsigned icon)
|
||||
{
|
||||
HDC hdc = (HDC)xvt_vobj_get_attr(win, ATTR_NATIVE_GRAPHIC_CONTEXT);
|
||||
int x = rct.left + (rct.right - rct.left - 32) / 2;
|
||||
int y = rct.top + (rct.bottom - rct.top - 32) / 2;
|
||||
int x = (rct.right + rct.left - 32) / 2;
|
||||
int y = (rct.bottom + rct.top - 32) / 2;
|
||||
DrawIcon(hdc, x, y, (HICON)icon);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user