summaryrefslogtreecommitdiff
path: root/binary.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-10 05:07:50 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-10 05:07:50 -0400
commite414123ecb472d1f86a2f1cfdbd2732144c20f0d (patch)
treecafc81314d337786ea0d8461a96110ee5b1d6fe2 /binary.cc
parent6261da4660a6602345c19d5a948124991bda86dc (diff)
downloadfork-ledger-e414123ecb472d1f86a2f1cfdbd2732144c20f0d.tar.gz
fork-ledger-e414123ecb472d1f86a2f1cfdbd2732144c20f0d.tar.bz2
fork-ledger-e414123ecb472d1f86a2f1cfdbd2732144c20f0d.zip
change commodity->symbol to const, and added set_symbol
Diffstat (limited to 'binary.cc')
-rw-r--r--binary.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/binary.cc b/binary.cc
index a64f21ff..98e3be16 100644
--- a/binary.cc
+++ b/binary.cc
@@ -9,7 +9,7 @@
namespace ledger {
static unsigned long binary_magic_number = 0xFFEED765;
-static unsigned long format_version = 0x0002001a;
+static unsigned long format_version = 0x0002001b;
static account_t ** accounts;
static account_t ** accounts_next;
@@ -216,7 +216,8 @@ inline commodity_t * read_binary_commodity(char *& data)
commodity->ident = read_binary_number<commodity_t::ident_t>(data);
- read_binary_string(data, commodity->symbol);
+ read_binary_string(data, *(const_cast<std::string *>(&commodity->symbol)));
+ read_binary_number(data, commodity->quote);
read_binary_string(data, commodity->name);
read_binary_string(data, commodity->note);
read_binary_number(data, commodity->precision);
@@ -472,6 +473,7 @@ void write_binary_commodity(std::ostream& out, commodity_t * commodity)
write_binary_number(out, commodity->ident);
write_binary_string(out, commodity->symbol);
+ write_binary_number(out, commodity->quote);
write_binary_string(out, commodity->name);
write_binary_string(out, commodity->note);
write_binary_number(out, commodity->precision);