summaryrefslogtreecommitdiff
path: root/ledger.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-19 22:03:23 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-19 22:03:23 -0400
commita9b207205f5d117db4f6a5d503ba7289882dec2d (patch)
tree81935d2cfd538cf782638ffb7cbd36dc9033baed /ledger.cc
parent9d4f8392632481ce5e174a4ebe52d4cb339b95dc (diff)
downloadfork-ledger-a9b207205f5d117db4f6a5d503ba7289882dec2d.tar.gz
fork-ledger-a9b207205f5d117db4f6a5d503ba7289882dec2d.tar.bz2
fork-ledger-a9b207205f5d117db4f6a5d503ba7289882dec2d.zip
several fixes
Diffstat (limited to 'ledger.cc')
-rw-r--r--ledger.cc30
1 files changed, 0 insertions, 30 deletions
diff --git a/ledger.cc b/ledger.cc
index ff7c7502..72a5a15d 100644
--- a/ledger.cc
+++ b/ledger.cc
@@ -174,34 +174,4 @@ entry_t * journal_t::derive_entry(strings_list::iterator i,
return added.release();
}
-int parse_journal_file(const std::string& path,
- journal_t * journal,
- account_t * master,
- const std::string * original_file)
-{
- journal->sources.push_back(path);
-
- if (access(path.c_str(), R_OK) == -1)
- return 0;
-
- std::ifstream stream(path.c_str());
-
- char magic[sizeof(unsigned int) + 1];
- stream.read(magic, sizeof(unsigned int));
- magic[sizeof(unsigned int)] = '\0';
- stream.seekg(0);
-
- if (*((unsigned int *) magic) == binary_magic_number)
- return read_binary_journal(stream, original_file ? *original_file : "",
- journal, master ? master : journal->master);
- else if (std::strcmp(magic, "!Typ") == 0 ||
- std::strcmp(magic, "\n!Ty") == 0 ||
- std::strcmp(magic, "\r\n!T") == 0)
- return parse_qif_file(stream, journal, master ? master : journal->master,
- commodity_t::find_commodity("$", true));
- else
- return parse_textual_journal(stream, journal,
- master ? master : journal->master);
-}
-
} // namespace ledger