Aggiunte le funzioni rewriteat.
git-svn-id: svn://10.65.10.50/trunk@44 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
76f5246fab
commit
22611ac7b5
@ -19,15 +19,15 @@
|
||||
|
||||
class TExtrectype : public TRectype
|
||||
{
|
||||
public:
|
||||
// FPUB
|
||||
public:
|
||||
// FPUB
|
||||
|
||||
TExtrectype(const TTrec& r); // Costruisce il record a partire da r
|
||||
virtual ~TExtrectype();
|
||||
};
|
||||
|
||||
TExtrectype::TExtrectype(const TTrec& r)
|
||||
: TRectype(6)
|
||||
: TRectype(6)
|
||||
|
||||
{
|
||||
delete _rec;
|
||||
@ -451,6 +451,22 @@ int TBaseisamfile::rewrite(const TRectype& rec, TDate& atdate)
|
||||
}
|
||||
|
||||
|
||||
int TBaseisamfile::rewriteat(TRecnotype nrec)
|
||||
|
||||
{
|
||||
NOT_OPEN(name());
|
||||
return cisrewrec(_isamfile, nrec, curr().string(), &_lasterr);
|
||||
}
|
||||
|
||||
|
||||
int TBaseisamfile::rewriteat(const TRectype& rec, TRecnotype nrec)
|
||||
|
||||
{
|
||||
NOT_OPEN(name());
|
||||
return cisrewrec(_isamfile, nrec, curr().string(), &_lasterr);
|
||||
}
|
||||
|
||||
|
||||
int TBaseisamfile::remove(TDate& atdate)
|
||||
|
||||
{
|
||||
@ -1048,7 +1064,7 @@ int TSystemisamfile::dump(const char* to, int nkey, char fs, char fd, char rs, b
|
||||
for (i = 0; i < nitems && !p.iscancelled(); i++)
|
||||
{
|
||||
p.setstatus(i + 1);
|
||||
readat(i);
|
||||
readat(i + 1);
|
||||
s="";
|
||||
if (withdeleted || curr().valid())
|
||||
{
|
||||
@ -1131,7 +1147,7 @@ TRectype::TRectype(const TRectype& r)
|
||||
_length = r.len();
|
||||
_rec = new char [ _length ];
|
||||
_rec[0] = r._rec[0];
|
||||
// strncpy(_rec + 1, r._rec + 1, _length - 1);
|
||||
// strncpy(_rec + 1, r._rec + 1, _length - 1);
|
||||
memcpy(_rec + 1, r._rec + 1, _length - 1);
|
||||
_i = r._i;
|
||||
setempty(r.empty());
|
||||
@ -1534,7 +1550,7 @@ const char* TRectype::key(int numkey) const
|
||||
|
||||
|
||||
TRec_array::TRec_array(int dimension, TBaseisamfile& i)
|
||||
: TArray(dimension)
|
||||
: TArray(dimension)
|
||||
|
||||
{
|
||||
TRectype r(&i);
|
||||
@ -1623,9 +1639,9 @@ HIDDEN void __getfieldbuff(byte l, byte t, const char* recin, char *s)
|
||||
TDate dt(atol(s));
|
||||
strcpy(s, dt.string(4));
|
||||
}
|
||||
// else
|
||||
// if (t == _realfld)
|
||||
// if ((char* s1 = strchr(s, ',')) != NULL) *s1 = '.';
|
||||
// else
|
||||
// if (t == _realfld)
|
||||
// if ((char* s1 = strchr(s, ',')) != NULL) *s1 = '.';
|
||||
}
|
||||
|
||||
|
||||
@ -1636,7 +1652,7 @@ HIDDEN void __putfieldbuff(byte l, byte d, byte t, const char* s, char* recout)
|
||||
|
||||
if (recout == NULL) return;
|
||||
|
||||
// char* s2 = new char [256];
|
||||
// char* s2 = new char [256];
|
||||
char s2[256];
|
||||
|
||||
strcpy(s2, s);
|
||||
@ -1672,7 +1688,7 @@ HIDDEN void __putfieldbuff(byte l, byte d, byte t, const char* s, char* recout)
|
||||
strncpy(recout, s2, len) ;
|
||||
while (len < l) recout[len++] = ' ';
|
||||
}
|
||||
// delete s2;
|
||||
// delete s2;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user