mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-09 03:24:59 -06:00
plugin/dbf: Version handling improved (thanks zsolt)
git-svn-id: svn://ultimatepp.org/upp/trunk@7439 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
aae8de0c2b
commit
91abf69578
2 changed files with 9 additions and 3 deletions
|
|
@ -304,10 +304,12 @@ void DbfStream::Field::Serialize(Stream& stream)
|
|||
|
||||
DbfStream::DbfStream()
|
||||
{
|
||||
version = 0x03;
|
||||
}
|
||||
|
||||
DbfStream::DbfStream(const char *_file, bool write, byte _charset, bool _delete_share)
|
||||
{
|
||||
version = 0x03;
|
||||
Open(_file, write, _charset, _delete_share);
|
||||
}
|
||||
|
||||
|
|
@ -362,14 +364,17 @@ bool DbfStream::StreamHeader(bool full)
|
|||
data_offset = 32 + fields.GetCount() * 32 + 1;
|
||||
if(dbf.IsStoring()) {
|
||||
ASSERT(!IsReadOnly());
|
||||
dbf.Put(0x03); // #0: version number - 03 without a DBT file
|
||||
dbf.Put(version); // #0: version number - 03 without a DBT file
|
||||
Date date = GetSysDate();
|
||||
dbf.Put(date.year - 1900); // #1 - 3: date of last update
|
||||
dbf.Put(date.month);
|
||||
dbf.Put(date.day);
|
||||
}
|
||||
else
|
||||
dbf.Get32le();
|
||||
else {
|
||||
version = dbf.Get8();
|
||||
dbf.Get8();
|
||||
dbf.Get16();
|
||||
}
|
||||
sStreamIL(dbf, rows);
|
||||
if(!full)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ protected:
|
|||
bool dirty;
|
||||
bool dirty_header;
|
||||
bool has_memo;
|
||||
byte version;
|
||||
};
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue