diff options
author | John Wiegley <johnw@newartisans.com> | 2005-06-22 23:04:21 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:11 -0400 |
commit | 81e4851a6c7841046ed18c712d57153006f09c57 (patch) | |
tree | 54c1f5d16364049dcd641ae569fba48e57571955 | |
parent | 75f110f8426b7fbc2ee0f683d0f48321bd81a6a2 (diff) | |
download | fork-ledger-81e4851a6c7841046ed18c712d57153006f09c57.tar.gz fork-ledger-81e4851a6c7841046ed18c712d57153006f09c57.tar.bz2 fork-ledger-81e4851a6c7841046ed18c712d57153006f09c57.zip |
Updated binary file version. (read_binary_journal): Read in the
"basket" account, if used. (write_binary_journal): Write out the
"basket" account, if used.
-rw-r--r-- | binary.cc | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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<account_t::ident_t>(data); accounts = accounts_next = new account_t *[a_count]; journal->master = read_binary_account(data, journal, master); + if (read_binary_number<bool>(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<account_t::ident_t>(out, count_accounts(journal->master)); write_binary_account(out, journal->master); + if (journal->basket) { + write_binary_number<bool>(out, true); + write_binary_account(out, journal->basket); + } else { + write_binary_number<bool>(out, false); + } + // Write out the number of entries, transactions, and amounts write_binary_number<unsigned long>(out, journal->entries.size()); |