diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-15 00:30:05 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:51 -0400 |
commit | 9e55655e0c1a56d3059bd8fc485e37fc3333b3bb (patch) | |
tree | 92ff00093779b7c7fb843417c27726508fa9f557 /src/value.h | |
parent | b36d24481d37170195e3f92267b343b9489c6bba (diff) | |
download | ledger-9e55655e0c1a56d3059bd8fc485e37fc3333b3bb.tar.gz ledger-9e55655e0c1a56d3059bd8fc485e37fc3333b3bb.tar.bz2 ledger-9e55655e0c1a56d3059bd8fc485e37fc3333b3bb.zip |
Got the xpath command working again.
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/value.h b/src/value.h index f001a4aa..51b5be22 100644 --- a/src/value.h +++ b/src/value.h @@ -187,6 +187,9 @@ class value_t return *this; } + bool is_boolean() const { + return type == BOOLEAN; + } bool& as_boolean() { assert(type == BOOLEAN); return *(bool *) data; @@ -195,6 +198,10 @@ class value_t assert(type == BOOLEAN); return *(bool *) data; } + + bool is_long() const { + return type == INTEGER; + } long& as_long() { assert(type == INTEGER); return *(long *) data; @@ -203,6 +210,10 @@ class value_t assert(type == INTEGER); return *(long *) data; } + + bool is_datetime() const { + return type == DATETIME; + } moment_t& as_datetime() { assert(type == DATETIME); return *(moment_t *) data; @@ -211,6 +222,10 @@ class value_t assert(type == DATETIME); return *(moment_t *) data; } + + bool is_amount() const { + return type == AMOUNT; + } amount_t& as_amount() { assert(type == AMOUNT); return *(amount_t *) data; @@ -219,6 +234,10 @@ class value_t assert(type == AMOUNT); return *(amount_t *) data; } + + bool is_balance() const { + return type == BALANCE; + } balance_t& as_balance() { assert(type == BALANCE); return *(balance_t *) data; @@ -227,6 +246,10 @@ class value_t assert(type == BALANCE); return *(balance_t *) data; } + + bool is_balance_pair() const { + return type == BALANCE_PAIR; + } balance_pair_t& as_balance_pair() { assert(type == BALANCE_PAIR); return *(balance_pair_t *) data; @@ -235,6 +258,10 @@ class value_t assert(type == BALANCE_PAIR); return *(balance_pair_t *) data; } + + bool is_string() const { + return type == STRING; + } string& as_string() { assert(type == STRING); return *(string *) data; @@ -243,6 +270,10 @@ class value_t assert(type == STRING); return *(string *) data; } + + bool is_sequence() const { + return type == SEQUENCE; + } sequence_t& as_sequence() { assert(type == SEQUENCE); return *(sequence_t *) data; @@ -252,6 +283,9 @@ class value_t return *(sequence_t *) data; } + bool is_xml_node() const { + return type == XML_NODE; + } xml::node_t *& as_xml_node() { assert(type == XML_NODE); return *(xml::node_t **) data; @@ -260,6 +294,10 @@ class value_t assert(type == XML_NODE); return *(xml::node_t **) data; } + + bool is_pointer() const { + return type == POINTER; + } void *& as_pointer() { assert(type == POINTER); return *(void **) data; |