summaryrefslogtreecommitdiff
path: root/src/emacs.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-23 19:07:30 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-23 19:07:30 -0400
commit944c63e6f26d1f05ba6f63c60f510d3796872f3e (patch)
treee1fc54319c2c42c16a64e95930acaca063658863 /src/emacs.cc
parent057506ab6dddbfb75d1bb29289602f375ca57df5 (diff)
downloadfork-ledger-944c63e6f26d1f05ba6f63c60f510d3796872f3e.tar.gz
fork-ledger-944c63e6f26d1f05ba6f63c60f510d3796872f3e.tar.bz2
fork-ledger-944c63e6f26d1f05ba6f63c60f510d3796872f3e.zip
The Great Renaming, Part II
The last commit did not contain the majority of changes because of a slight mishap. This contains the real changeset.
Diffstat (limited to 'src/emacs.cc')
-rw-r--r--src/emacs.cc50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/emacs.cc b/src/emacs.cc
index 3c3c1b7b..fb54783b 100644
--- a/src/emacs.cc
+++ b/src/emacs.cc
@@ -34,50 +34,50 @@
namespace ledger {
-void format_emacs_xacts::write_entry(entry_t& entry)
+void format_emacs_posts::write_xact(xact_t& xact)
{
- out << "\"" << entry.pathname << "\" "
- << (static_cast<std::size_t>(entry.beg_line) + 1) << " ";
+ out << "\"" << xact.pathname << "\" "
+ << (static_cast<std::size_t>(xact.beg_line) + 1) << " ";
- tm when = gregorian::to_tm(entry.date());
+ tm when = gregorian::to_tm(xact.date());
std::time_t date = std::mktime(&when); // jww (2008-04-20): Is this GMT or local?
out << "(" << (date / 65536) << " " << (date % 65536) << " 0) ";
- if (! entry.code)
+ if (! xact.code)
out << "nil ";
else
- out << "\"" << *entry.code << "\" ";
+ out << "\"" << *xact.code << "\" ";
- if (entry.payee.empty())
+ if (xact.payee.empty())
out << "nil";
else
- out << "\"" << entry.payee << "\"";
+ out << "\"" << xact.payee << "\"";
out << "\n";
}
-void format_emacs_xacts::operator()(xact_t& xact)
+void format_emacs_posts::operator()(post_t& post)
{
- if (! xact.has_xdata() ||
- ! xact.xdata().has_flags(XACT_EXT_DISPLAYED)) {
- if (! last_entry) {
+ if (! post.has_xdata() ||
+ ! post.xdata().has_flags(POST_EXT_DISPLAYED)) {
+ if (! last_xact) {
out << "((";
- write_entry(*xact.entry);
+ write_xact(*post.xact);
}
- else if (xact.entry != last_entry) {
+ else if (post.xact != last_xact) {
out << ")\n (";
- write_entry(*xact.entry);
+ write_xact(*post.xact);
}
else {
out << "\n";
}
- out << " (" << (static_cast<std::size_t>(xact.beg_line) + 1) << " ";
- out << "\"" << xact.reported_account()->fullname() << "\" \""
- << xact.amount << "\"";
+ out << " (" << (static_cast<std::size_t>(post.beg_line) + 1) << " ";
+ out << "\"" << post.reported_account()->fullname() << "\" \""
+ << post.amount << "\"";
- switch (xact.state()) {
+ switch (post.state()) {
case item_t::CLEARED:
out << " t";
break;
@@ -89,15 +89,15 @@ void format_emacs_xacts::operator()(xact_t& xact)
break;
}
- if (xact.cost)
- out << " \"" << *xact.cost << "\"";
- if (xact.note)
- out << " \"" << *xact.note << "\"";
+ if (post.cost)
+ out << " \"" << *post.cost << "\"";
+ if (post.note)
+ out << " \"" << *post.note << "\"";
out << ")";
- last_entry = xact.entry;
+ last_xact = post.xact;
- xact.xdata().add_flags(XACT_EXT_DISPLAYED);
+ post.xdata().add_flags(POST_EXT_DISPLAYED);
}
}