From aa4f0d4364783ed5cbc97972755c7fd6b0da3cf0 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 21 Jul 2008 20:41:42 -0400 Subject: Added the var_t helper class, which can be seen in the beginning implementation of register_command in main.cc. --- value.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'value.cc') diff --git a/value.cc b/value.cc index 16091e47..87b5f59a 100644 --- a/value.cc +++ b/value.cc @@ -1413,19 +1413,31 @@ void value_t::print(std::ostream& out, const int first_width, { switch (type()) { case VOID: - out << "NULL"; + out << "VOID"; break; case BOOLEAN: + out << const_cast(*this).as_boolean_lval(); + break; + case DATETIME: + out << const_cast(*this).as_datetime_lval(); + break; + case INTEGER: + out << const_cast(*this).as_long_lval(); + break; + case AMOUNT: + out << const_cast(*this).as_amount_lval(); + break; + case STRING: + out << const_cast(*this).as_string_lval(); + break; + case POINTER: - // jww (2007-05-14): I need a version of this print just for XPath - // expression, since amounts and strings need to be output with - // special syntax. - out << *this; + out << boost::unsafe_any_cast(&const_cast(*this).as_any_pointer_lval()); break; case SEQUENCE: { -- cgit v1.2.3