From 752cb121db958e14f473fe2eda4c6522d095e19b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 9 Mar 2008 01:02:43 +0000 Subject: [PATCH] Add an easier way to construct statements for writing --- source/statement.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/statement.h b/source/statement.h index f2fa6e6..efc097b 100644 --- a/source/statement.h +++ b/source/statement.h @@ -24,7 +24,19 @@ public: std::list sub; Statement(): valid(false), line(0) { } + Statement(const std::string &kw): keyword(kw), valid(true), line(0) { } std::string get_location() const; + + template + Statement &append(const T &v) + { + args.push_back(Value(v)); + return *this; + } + + template + Statement &operator,(const T &v) + { return append(v); } }; } // namespace DataFile -- 2.43.0