From 81e4851a6c7841046ed18c712d57153006f09c57 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 22 Jun 2005 23:04:21 +0000 Subject: Updated binary file version. (read_binary_journal): Read in the "basket" account, if used. (write_binary_journal): Write out the "basket" account, if used. --- binary.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/binary.cc b/binary.cc index 6ed7e416..913f29d1 100644 --- a/binary.cc +++ b/binary.cc @@ -11,7 +11,7 @@ namespace ledger { static unsigned long binary_magic_number = 0xFFEED765; -static unsigned long format_version = 0x00020034; +static unsigned long format_version = 0x00020035; static account_t ** accounts; static account_t ** accounts_next; @@ -387,6 +387,8 @@ unsigned int read_binary_journal(std::istream& in, account_t::ident_t a_count = read_binary_number(data); accounts = accounts_next = new account_t *[a_count]; journal->master = read_binary_account(data, journal, master); + if (read_binary_number(data)) + journal->basket = read_binary_account(data, journal); // Allocate the memory needed for the entries and transactions in // one large block, which is then chopped up and custom constructed @@ -690,6 +692,13 @@ void write_binary_journal(std::ostream& out, journal_t * journal) write_binary_number(out, count_accounts(journal->master)); write_binary_account(out, journal->master); + if (journal->basket) { + write_binary_number(out, true); + write_binary_account(out, journal->basket); + } else { + write_binary_number(out, false); + } + // Write out the number of entries, transactions, and amounts write_binary_number(out, journal->entries.size()); -- cgit v1.2.3