summaryrefslogtreecommitdiff
path: root/binary.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-05 23:51:20 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-05 23:51:20 -0400
commit6048ae7c05622a83355ad0a87ab1ce512f00b3f3 (patch)
treed8467e4cafbd93edf7923f9431751563907ab2a9 /binary.cc
parent5409bc04b8535ba2b52096475d759462c8cd9876 (diff)
downloadfork-ledger-6048ae7c05622a83355ad0a87ab1ce512f00b3f3.tar.gz
fork-ledger-6048ae7c05622a83355ad0a87ab1ce512f00b3f3.tar.bz2
fork-ledger-6048ae7c05622a83355ad0a87ab1ce512f00b3f3.zip
fixed cache by clear transaction flags before writing
Diffstat (limited to 'binary.cc')
-rw-r--r--binary.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/binary.cc b/binary.cc
index 0e9fcd45..ee6bf3f0 100644
--- a/binary.cc
+++ b/binary.cc
@@ -253,6 +253,8 @@ account_t * read_binary_account(std::istream& in, account_t * master = NULL)
acct->note = buf;
}
+ in.read((char *)&acct->depth, sizeof(acct->depth));
+
in.read((char *)&len, sizeof(len));
// If all of the subaccounts will be added to a different master
@@ -540,6 +542,8 @@ void write_binary_account(std::ostream& out, account_t * account)
if (len)
out.write(account->note.c_str(), len);
+ out.write((char *)&account->depth, sizeof(account->depth));
+
len = account->accounts.size();
out.write((char *)&len, sizeof(len));
@@ -592,13 +596,14 @@ void write_binary_journal(std::ostream& out, journal_t * journal,
write_binary_account(out, journal->master);
- unsigned long count = commodity_t::commodities.size();
+ unsigned long count = commodity_t::commodities.size() - 1;
out.write((char *)&count, sizeof(count));
for (commodities_map::const_iterator i = commodity_t::commodities.begin();
i != commodity_t::commodities.end();
i++)
- write_binary_commodity(out, (*i).second);
+ if (! (*i).first.empty())
+ write_binary_commodity(out, (*i).second);
count = journal->entries.size();
out.write((char *)&count, sizeof(count));