Patch level : v32 nopatch
Files correlati : tutti Ricompilazione Demo : [ ] Commento : supporto path custom git-svn-id: svn://10.65.10.50/trunk@10176 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
1190ac6ab5
commit
9718a515ed
@ -24,6 +24,7 @@ word TExternal_app::run(
|
||||
const int p = comm_name.find(' ');
|
||||
if (p >= 0)
|
||||
comm_name.cut(p);
|
||||
comm_name.custom_path();
|
||||
|
||||
TString name(comm_name.name());
|
||||
if (utente == TRUE) // utente puo' essere 0 = No, 1 = Si, 3 = Forzatura
|
||||
|
@ -4472,6 +4472,7 @@ void TForm::read(
|
||||
const char* desc) // @parm Descrizione del formato da leggere
|
||||
{
|
||||
_name= name;
|
||||
|
||||
_code= code;
|
||||
_editlevel= lev;
|
||||
_desc= desc;
|
||||
@ -4519,7 +4520,9 @@ void TForm::read(
|
||||
|
||||
// read base form
|
||||
TFilename n(_name); n.ext("frm");
|
||||
if (!fexist(n)) fatal_box("Il file %s non esiste.",(const char *) n);
|
||||
n.custom_path();
|
||||
if (!n.exist())
|
||||
fatal_box("Il form %s non esiste.",(const char*)n);
|
||||
TScanner scanner(n);
|
||||
|
||||
bool ok = TRUE;
|
||||
|
@ -150,6 +150,7 @@ void TMask::read_mask(
|
||||
_source_file = name;
|
||||
_source_file.ext(MASK_EXT);
|
||||
_source_file.lower();
|
||||
_source_file.custom_path();
|
||||
TScanner scanner(_source_file);
|
||||
|
||||
long start_t = clock();
|
||||
|
@ -13,7 +13,7 @@
|
||||
#define NOTFOUND (-1)
|
||||
|
||||
// *** maximum number of elements in a cursor working page
|
||||
#define CMAXELPAGE 8000
|
||||
#define CMAXELPAGE 8192
|
||||
|
||||
#define print_name(out, f) out << (f.num() == LF_TABCOM ? "%" : "") << f.name()
|
||||
|
||||
@ -1017,7 +1017,7 @@ TRecnotype TCursor::buildcursor(TRecnotype rp)
|
||||
if (junk < 0) junk=get_error(junk);
|
||||
if (junk == _iseof) return 0;
|
||||
|
||||
TRecnotype* page = new TRecnotype [CMAXELPAGE];
|
||||
TRecnotype* page = new TRecnotype[CMAXELPAGE];
|
||||
|
||||
DB_index_recno(fhnd);
|
||||
_pos=-1;
|
||||
@ -1057,11 +1057,6 @@ TRecnotype TCursor::buildcursor(TRecnotype rp)
|
||||
page[pagecnt++] = recno;
|
||||
|
||||
DB_index_next(fhnd);
|
||||
/*
|
||||
int rt=get_error(-1); // Get Last Codebase Error
|
||||
if (rt != NOERR)
|
||||
fatal_box("Can't read index n. %d - file n. %d",DB_tagget(fhnd), file().num());
|
||||
*/
|
||||
} // while
|
||||
if (pagecnt)
|
||||
{
|
||||
@ -1077,8 +1072,14 @@ TRecnotype TCursor::buildcursor(TRecnotype rp)
|
||||
}
|
||||
ap += pagecnt;
|
||||
}
|
||||
delete page;
|
||||
close_index(_f);
|
||||
|
||||
if (ap > CMAXELPAGE)
|
||||
{
|
||||
delete page;
|
||||
page = NULL;
|
||||
}
|
||||
|
||||
return ap;
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,8 @@ class TCursor : public TContainer
|
||||
int _filter_limit;
|
||||
// @cmember:(INTERNAL) Funzione filtro
|
||||
FILTERFUNCTION _filterfunction;
|
||||
// @cmember:(INTERNAL) Nome del file indice
|
||||
|
||||
// @cmember:(INTERNAL) Nome del file indice
|
||||
TFilename _indexname;
|
||||
|
||||
// @access Protected Member
|
||||
|
@ -1207,18 +1207,6 @@ const TFilename& TFilename::temp(
|
||||
{
|
||||
set(prefix); // Copia prefisso e ...
|
||||
strip("$#*?."); // ... toglie caratteri jolly
|
||||
|
||||
const TFixed_string f(prefix);
|
||||
if (f.find("$$") >= 0)
|
||||
{
|
||||
NFCHECK("Unsupported metacharacter $$");
|
||||
/*
|
||||
char pid[8];
|
||||
sprintf(pid, "%d", getpid());
|
||||
pid[3] = '\0';
|
||||
*this << pid;
|
||||
*/
|
||||
}
|
||||
}
|
||||
else
|
||||
cut(0);
|
||||
@ -1271,7 +1259,24 @@ bool TFilename::input()
|
||||
return input_filename(*this);
|
||||
}
|
||||
|
||||
|
||||
bool TFilename::custom_path(const char* path_list)
|
||||
{
|
||||
TToken_string pl = path_list;
|
||||
if (pl.empty())
|
||||
pl = "custom";
|
||||
TFilename cust;
|
||||
FOR_EACH_TOKEN(pl, path)
|
||||
{
|
||||
cust = path;
|
||||
cust.add(name());
|
||||
if (cust.exist())
|
||||
{
|
||||
set(cust);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Token string
|
||||
|
@ -504,6 +504,8 @@ public:
|
||||
const TFilename& tempdir();
|
||||
// @cmember Genera il nome della directory corrente
|
||||
const TFilename& currdir();
|
||||
// @cmember Prepone il nome della dir custom
|
||||
bool custom_path(const char* path_list = NULL);
|
||||
};
|
||||
|
||||
// Forward declaration for TToken_string::get(int n, real& r) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user