summaryrefslogtreecommitdiff
path: root/src/item.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-13 05:02:14 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-13 05:02:14 -0400
commitea1642b3f969463a49e5a671478c92e4ef129665 (patch)
tree9eba47b8708123b4e3f539dd9d747f1f85d9d2fe /src/item.cc
parentad3b30a9641b8e09c38ea76e7011b614152d8faf (diff)
downloadfork-ledger-ea1642b3f969463a49e5a671478c92e4ef129665.tar.gz
fork-ledger-ea1642b3f969463a49e5a671478c92e4ef129665.tar.bz2
fork-ledger-ea1642b3f969463a49e5a671478c92e4ef129665.zip
Completely reworked argument passing in expressions
Diffstat (limited to 'src/item.cc')
-rw-r--r--src/item.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/item.cc b/src/item.cc
index f59c9e29..f0273e59 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -32,7 +32,6 @@
#include <system.hh>
#include "item.h"
-#include "interactive.h"
namespace ledger {
@@ -256,9 +255,9 @@ namespace {
if (args.size() == 1) {
if (args[0].is_string())
- return item.has_tag(args[0].as_string());
+ return item.has_tag(args.get<string>(0));
else if (args[0].is_mask())
- return item.has_tag(args[0].as_mask());
+ return item.has_tag(args.get<mask_t>(0));
else
throw_(std::runtime_error,
_("Expected string or mask for argument 1, but received %1")
@@ -266,7 +265,7 @@ namespace {
}
else if (args.size() == 2) {
if (args[0].is_mask() && args[1].is_mask())
- return item.has_tag(args[0].to_mask(), args[1].to_mask());
+ return item.has_tag(args.get<mask_t>(0), args.get<mask_t>(1));
else
throw_(std::runtime_error,
_("Expected masks for arguments 1 and 2, but received %1 and %2")
@@ -288,9 +287,9 @@ namespace {
if (args.size() == 1) {
if (args[0].is_string())
- val = item.get_tag(args[0].as_string());
+ val = item.get_tag(args.get<string>(0));
else if (args[0].is_mask())
- val = item.get_tag(args[0].as_mask());
+ val = item.get_tag(args.get<mask_t>(0));
else
throw_(std::runtime_error,
_("Expected string or mask for argument 1, but received %1")
@@ -298,7 +297,7 @@ namespace {
}
else if (args.size() == 2) {
if (args[0].is_mask() && args[1].is_mask())
- val = item.get_tag(args[0].to_mask(), args[1].to_mask());
+ val = item.get_tag(args.get<mask_t>(0), args.get<mask_t>(1));
else
throw_(std::runtime_error,
_("Expected masks for arguments 1 and 2, but received %1 and %2")