summaryrefslogtreecommitdiff
path: root/xml.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-10-19 22:42:24 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:19 -0400
commiteb0525e3157b579d45aab568e3ee06432fbaa338 (patch)
tree308ada59d939b363afd3791ef5f26406cedcebe1 /xml.cc
parenta53f44ecdaf9051c9e7f64993787c88d98b5348a (diff)
downloadfork-ledger-eb0525e3157b579d45aab568e3ee06432fbaa338.tar.gz
fork-ledger-eb0525e3157b579d45aab568e3ee06432fbaa338.tar.bz2
fork-ledger-eb0525e3157b579d45aab568e3ee06432fbaa338.zip
See ChangeLog
Diffstat (limited to 'xml.cc')
-rw-r--r--xml.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/xml.cc b/xml.cc
index 6dea19cf..edfefe83 100644
--- a/xml.cc
+++ b/xml.cc
@@ -83,7 +83,10 @@ static void endElement(void *userData, const char *name)
curr_entry = NULL;
}
else if (std::strcmp(name, "en:date") == 0) {
- quick_parse_date(data.c_str(), &curr_entry->date);
+ quick_parse_date(data.c_str(), &curr_entry->_date);
+ }
+ else if (std::strcmp(name, "en:date_eff") == 0) {
+ quick_parse_date(data.c_str(), &curr_entry->_date_eff);
}
else if (std::strcmp(name, "en:code") == 0) {
curr_entry->code = data;
@@ -331,11 +334,17 @@ void format_xml_entries::format_last_entry()
{
char buf[256];
std::strftime(buf, 255, format_t::date_format.c_str(),
- std::localtime(&last_entry->date));
+ std::localtime(&last_entry->_date));
output_stream << " <entry>\n"
<< " <en:date>" << buf << "</en:date>\n";
+ if (last_entry->_date_eff) {
+ std::strftime(buf, 255, format_t::date_format.c_str(),
+ std::localtime(&last_entry->_date_eff));
+ output_stream << " <en:date_eff>" << buf << "</en:date_eff>\n";
+ }
+
if (! last_entry->code.empty()) {
output_stream << " <en:code>";
output_xml_string(output_stream, last_entry->code);
@@ -361,6 +370,17 @@ void format_xml_entries::format_last_entry()
output_stream << " <transaction>\n";
+ if ((*i)->_date) {
+ std::strftime(buf, 255, format_t::date_format.c_str(),
+ std::localtime(&(*i)->_date));
+ output_stream << " <tr:date>" << buf << "</tr:date>\n";
+ }
+ if ((*i)->_date_eff) {
+ std::strftime(buf, 255, format_t::date_format.c_str(),
+ std::localtime(&(*i)->_date_eff));
+ output_stream << " <tr:date_eff>" << buf << "</tr:date_eff>\n";
+ }
+
if ((*i)->state == transaction_t::CLEARED)
output_stream << " <tr:cleared/>\n";
else if ((*i)->state == transaction_t::PENDING)