relation.cpp Modificata la generazione dei nomi degli indici dei cursori
relation.h Migliorata spaziatura scanner.cpp Corretta apertura e chiusura dello stream scanner.h Corretto test di errore git-svn-id: svn://10.65.10.50/trunk@6587 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5ef993980d
commit
cc4fd2a9da
@ -934,7 +934,11 @@ FILE* TCursor::open_index(
|
|||||||
{
|
{
|
||||||
_last_created = create;
|
_last_created = create;
|
||||||
if (create || _indexname.empty())
|
if (create || _indexname.empty())
|
||||||
_indexname.temp("ci");
|
{
|
||||||
|
TString16 radix;
|
||||||
|
radix.format("c%d_", file().num());
|
||||||
|
_indexname.temp(radix);
|
||||||
|
}
|
||||||
|
|
||||||
if (_indexname != _last_name)
|
if (_indexname != _last_name)
|
||||||
{
|
{
|
||||||
@ -1223,7 +1227,7 @@ int TCursor::test(TIsamop op, TReclock lockop) const
|
|||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
if (op == _isequal)
|
if (op == _isequal)
|
||||||
{
|
{
|
||||||
const TString80 match(curfile.curr().key(_nkey));
|
const TString match(curfile.curr().key(_nkey));
|
||||||
bool trovato = FALSE;
|
bool trovato = FALSE;
|
||||||
|
|
||||||
for (err = curfile.read(op, lockop);
|
for (err = curfile.read(op, lockop);
|
||||||
@ -1634,7 +1638,7 @@ int TSorted_cursor::filtercursor(int pagecnt, TRecnotype* page)
|
|||||||
{
|
{
|
||||||
int np=0 /*, handle=file().filehnd()->fhnd */;
|
int np=0 /*, handle=file().filehnd()->fhnd */;
|
||||||
TRectype& rec=file().curr();
|
TRectype& rec=file().curr();
|
||||||
TString s;
|
TString s, sf, fmt;
|
||||||
El_To_Sort Element;
|
El_To_Sort Element;
|
||||||
|
|
||||||
for (int i=0; i< pagecnt; i++)
|
for (int i=0; i< pagecnt; i++)
|
||||||
@ -1659,7 +1663,7 @@ int TSorted_cursor::filtercursor(int pagecnt, TRecnotype* page)
|
|||||||
if (s.right(1) == "-" || s.right(1) == "+")
|
if (s.right(1) == "-" || s.right(1) == "+")
|
||||||
s.cut(s.len()-1);
|
s.cut(s.len()-1);
|
||||||
TFieldref f(s,0);
|
TFieldref f(s,0);
|
||||||
TString sf=f.read(*relation());
|
sf=f.read(*relation());
|
||||||
TRectype& frec = file(f.file()).curr();
|
TRectype& frec = file(f.file()).curr();
|
||||||
TFieldtypes fld_type = frec.type(f.name());
|
TFieldtypes fld_type = frec.type(f.name());
|
||||||
if (fld_type == _datefld) // Se il campo e' di tipo data, la converte in ANSI!
|
if (fld_type == _datefld) // Se il campo e' di tipo data, la converte in ANSI!
|
||||||
@ -1668,7 +1672,6 @@ int TSorted_cursor::filtercursor(int pagecnt, TRecnotype* page)
|
|||||||
sf=d.string(ANSI);
|
sf=d.string(ANSI);
|
||||||
}
|
}
|
||||||
if (is_up) sf.upper();
|
if (is_up) sf.upper();
|
||||||
TString fmt;
|
|
||||||
if (fld_type == _alfafld || fld_type == _datefld)
|
if (fld_type == _alfafld || fld_type == _datefld)
|
||||||
fmt.format("%%-%ds",f.len(frec));
|
fmt.format("%%-%ds",f.len(frec));
|
||||||
else
|
else
|
||||||
|
@ -403,7 +403,7 @@ public:
|
|||||||
{ return _filter.not_empty() || _filterfunction; }
|
{ return _filter.not_empty() || _filterfunction; }
|
||||||
|
|
||||||
// @cmember Salva la posizione attuale di tutti i file del cursore
|
// @cmember Salva la posizione attuale di tutti i file del cursore
|
||||||
void save_status ()
|
void save_status()
|
||||||
{ _if->save_status(); }
|
{ _if->save_status(); }
|
||||||
// @cmember Ripristina la posizione attuale di tutti i file del cursore
|
// @cmember Ripristina la posizione attuale di tutti i file del cursore
|
||||||
void restore_status ()
|
void restore_status ()
|
||||||
|
@ -14,13 +14,14 @@ TScanner::TScanner(const char* filename)
|
|||||||
{
|
{
|
||||||
setbuf(_buffer.get_buffer(), _buffer.size());
|
setbuf(_buffer.get_buffer(), _buffer.size());
|
||||||
open(filename, ios::in | ios::nocreate, filebuf::sh_read);
|
open(filename, ios::in | ios::nocreate, filebuf::sh_read);
|
||||||
if (bad())
|
if (fail())
|
||||||
fatal_box("Impossibile aprire %s", filename);
|
fatal_box("Impossibile leggere il file '%s'", filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
TScanner::~TScanner()
|
TScanner::~TScanner()
|
||||||
{
|
{
|
||||||
close(); // Altrimenti si incasina col buffer!
|
close();
|
||||||
|
setbuf(NULL, 0); // Altrimenti si incasina col buffer!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class TScanner : public ifstream
|
|||||||
{
|
{
|
||||||
// @access:(INTERNAL) Private Member
|
// @access:(INTERNAL) Private Member
|
||||||
|
|
||||||
// @cmember:(INTERNAL) Prossimo teoken
|
// @cmember:(INTERNAL) Prossimo token
|
||||||
TString _token;
|
TString _token;
|
||||||
// @cmember:(INTERNAL) Chiave del token (prime due lettere)
|
// @cmember:(INTERNAL) Chiave del token (prime due lettere)
|
||||||
TString _key;
|
TString _key;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user