Aggiunto metodo TBaseisamfile::is_valid(). Ritorna NOERR se il file e'
Ok. git-svn-id: svn://10.65.10.50/trunk@2155 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
80e600f803
commit
169a54a270
@ -1056,6 +1056,18 @@ int TBaseisamfile::_close()
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TBaseisamfile::is_valid()
|
||||||
|
{ // Ritorna 0 se il file puo' essere aperto senza errori
|
||||||
|
CHECKS(filehnd() == NULL, "File already open ", (const char*)filename());
|
||||||
|
int err = NOERR;
|
||||||
|
getisfd(_isamfile,num());
|
||||||
|
if ((filehnd()->fhnd = DB_open(filehnd()->d->SysName,0)) >= 0)
|
||||||
|
DB_close(filehnd()->fhnd);
|
||||||
|
else
|
||||||
|
err = get_error(filehnd()->fhnd);
|
||||||
|
relisfd(_isamfile);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TLocalisamfile
|
// TLocalisamfile
|
||||||
|
@ -208,7 +208,7 @@ protected:
|
|||||||
|
|
||||||
void recover();
|
void recover();
|
||||||
int _open(unsigned int mode = _manulock); // Apre isam file con lock
|
int _open(unsigned int mode = _manulock); // Apre isam file con lock
|
||||||
int _close();
|
int _close();
|
||||||
const char* filename() const;
|
const char* filename() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -245,6 +245,7 @@ public:
|
|||||||
void indexon(); // Accende gli indici
|
void indexon(); // Accende gli indici
|
||||||
void indexoff(); // Spegne gli indici
|
void indexoff(); // Spegne gli indici
|
||||||
int status() const { return _lasterr; } // Ritorna _lasterr
|
int status() const { return _lasterr; } // Ritorna _lasterr
|
||||||
|
int is_valid(); // Ritorna 0 se il file e' valido
|
||||||
TRectype& curr() const {return *_current;} // Ritorna puntatore a record corrente
|
TRectype& curr() const {return *_current;} // Ritorna puntatore a record corrente
|
||||||
bool eof() const { return status() == _iseof || status() == _isemptyfile;} // Vero se siamo a fine file
|
bool eof() const { return status() == _iseof || status() == _isemptyfile;} // Vero se siamo a fine file
|
||||||
bool bof() const { return status() == _isbof || status() == _isemptyfile;} // Vero se siamo a inizio file
|
bool bof() const { return status() == _isbof || status() == _isemptyfile;} // Vero se siamo a inizio file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user