summaryrefslogtreecommitdiff
path: root/src/transform.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-14 11:09:54 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:50 -0400
commitf83705b847c59a8197f5098cb7dc2d484704e24d (patch)
tree1b314d07bb9f50a75781d703ec6c778056e74684 /src/transform.cc
parent65af1688382331d91153fb2366026e94feb5afe2 (diff)
downloadfork-ledger-f83705b847c59a8197f5098cb7dc2d484704e24d.tar.gz
fork-ledger-f83705b847c59a8197f5098cb7dc2d484704e24d.tar.bz2
fork-ledger-f83705b847c59a8197f5098cb7dc2d484704e24d.zip
Changed xpath to use intrusive_ptr; got the xml command working
Diffstat (limited to 'src/transform.cc')
-rw-r--r--src/transform.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/transform.cc b/src/transform.cc
index d13d9f7e..3331c2f3 100644
--- a/src/transform.cc
+++ b/src/transform.cc
@@ -34,7 +34,7 @@
namespace ledger {
#if 0
-void populate_account(account_t& acct, xml::document_t * document)
+void populate_account(account_t& acct, xml::document_t& document)
{
if (! acct.parent)
return;
@@ -61,7 +61,7 @@ void populate_account(account_t& acct, xml::document_t * document)
}
class populate_accounts : public repitem_t::select_callback_t {
- virtual void operator()(xml::document_t * document) {
+ virtual void operator()(xml::document_t& document) {
if (item->kind == repitem_t::TRANSACTION) {
item->extract();
populate_account(*static_cast<xact_repitem_t *>(item)->account(), item);
@@ -70,13 +70,13 @@ class populate_accounts : public repitem_t::select_callback_t {
};
class clear_account_data : public repitem_t::select_callback_t {
- virtual void operator()(xml::document_t * document) {
+ virtual void operator()(xml::document_t& document) {
if (item->kind == repitem_t::ACCOUNT)
static_cast<account_repitem_t *>(item)->account->data = NULL;
}
};
-void accounts_transform::execute(xml::document_t * document)
+void accounts_transform::execute(xml::document_t& document)
{
populate_accounts cb1;
items->select_all(cb1);
@@ -99,7 +99,7 @@ void accounts_transform::execute(xml::document_t * document)
items->select_all(cb2);
}
-void compact_transform::execute(xml::document_t * document)
+void compact_transform::execute(xml::document_t& document)
{
for (repitem_t * i = items; i; i = i->next) {
if (i->kind == repitem_t::ACCOUNT) {
@@ -138,7 +138,7 @@ void compact_transform::execute(xml::document_t * document)
}
}
-void clean_transform::execute(xml::document_t * document)
+void clean_transform::execute(xml::document_t& document)
{
repitem_t * i = items;
while (i) {
@@ -169,11 +169,11 @@ void clean_transform::execute(xml::document_t * document)
}
}
-void entries_transform::execute(xml::document_t * document)
+void entries_transform::execute(xml::document_t& document)
{
}
-void optimize_transform::execute(xml::document_t * document)
+void optimize_transform::execute(xml::document_t& document)
{
for (repitem_t * i = items; i; i = i->next) {
if (i->kind == repitem_t::ENTRY) {
@@ -194,7 +194,7 @@ void optimize_transform::execute(xml::document_t * document)
}
}
-void split_transform::execute(xml::document_t * document)
+void split_transform::execute(xml::document_t& document)
{
for (repitem_t * i = items; i; i = i->next) {
if (i->contents && i->contents->next) {
@@ -236,7 +236,7 @@ void split_transform::execute(xml::document_t * document)
}
}
-void merge_transform::execute(xml::document_t * document)
+void merge_transform::execute(xml::document_t& document)
{
for (repitem_t * i = items; i; i = i->next) {
if (i->next) {
@@ -290,13 +290,13 @@ namespace {
#define REPITEM_FLAGGED 0x1
class mark_selected : public repitem_t::select_callback_t {
- virtual void operator()(xml::document_t * document) {
+ virtual void operator()(xml::document_t& document) {
item->flags |= REPITEM_FLAGGED;
}
};
class mark_selected_and_ancestors : public repitem_t::select_callback_t {
- virtual void operator()(xml::document_t * document) {
+ virtual void operator()(xml::document_t& document) {
while (item->parent) {
item->flags |= REPITEM_FLAGGED;
item = item->parent;
@@ -305,27 +305,27 @@ namespace {
};
class delete_unmarked : public repitem_t::select_callback_t {
- virtual void operator()(xml::document_t * document) {
+ virtual void operator()(xml::document_t& document) {
if (item->parent && ! (item->flags & REPITEM_FLAGGED))
checked_delete(item);
}
};
class delete_marked : public repitem_t::select_callback_t {
- virtual void operator()(xml::document_t * document) {
+ virtual void operator()(xml::document_t& document) {
if (item->flags & REPITEM_FLAGGED)
checked_delete(item);
}
};
class clear_flags : public repitem_t::select_callback_t {
- virtual void operator()(xml::document_t * document) {
+ virtual void operator()(xml::document_t& document) {
item->flags = 0;
}
};
}
-void select_transform::execute(xml::document_t * document)
+void select_transform::execute(xml::document_t& document)
{
if (! path) {
items->clear();
@@ -340,7 +340,7 @@ void select_transform::execute(xml::document_t * document)
items->select_all(cb3);
}
-void remove_transform::execute(xml::document_t * document)
+void remove_transform::execute(xml::document_t& document)
{
if (! path)
return;