summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-14 11:09:28 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:50 -0400
commit59fc3d1bdb01b7195a0f9745fe9914ac31b8a3a5 (patch)
treeb925cd5f52bed29606364c76a08c0b7795ebcedd /src/main.cc
parent77db7eb92f730af315d4bcdf831cc67acb386b58 (diff)
downloadfork-ledger-59fc3d1bdb01b7195a0f9745fe9914ac31b8a3a5.tar.gz
fork-ledger-59fc3d1bdb01b7195a0f9745fe9914ac31b8a3a5.tar.bz2
fork-ledger-59fc3d1bdb01b7195a0f9745fe9914ac31b8a3a5.zip
Initial implementation of document_builder_t.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main.cc b/src/main.cc
index 010abd3c..945587b1 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -186,8 +186,8 @@ static int read_and_report(report_t * report, int argc, char * argv[],
std::cout << "Result of calculation: ";
}
- std::cout << expr.calc((xml::document_t *)NULL, report).
- strip_annotations() << std::endl;
+ xml::document_t temp(xml::LEDGER_NODE);
+ std::cout << expr.calc(temp, report).strip_annotations() << std::endl;
return 0;
}
@@ -215,8 +215,16 @@ static int read_and_report(report_t * report, int argc, char * argv[],
{
textual_parser_t text_parser;
ifstream input(session.data_file);
+
+#if 1
+ xml::document_t temp(xml::LEDGER_NODE);
+ xml::document_builder_t builder(temp);
+ text_parser.parse(input, session.data_file, builder);
+ temp.print(std::cout);
+#else
xml::xml_writer_t writer(std::cout);
text_parser.parse(input, session.data_file, writer);
+#endif
}
INFO_FINISH(journal);
return 0;
@@ -292,8 +300,8 @@ static int read_and_report(report_t * report, int argc, char * argv[],
*out << "Result of calculation: ";
}
- *out << expr.calc((xml::document_t *)NULL, report).
- strip_annotations() << std::endl;
+ xml::document_t temp(xml::LEDGER_NODE);
+ *out << expr.calc(temp, report).strip_annotations() << std::endl;
return 0;
}