From: Mikko Rasa Date: Sun, 9 Mar 2008 01:02:43 +0000 (+0000) Subject: Add an easier way to construct statements for writing X-Git-Tag: 1.0~8 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=752cb121db958e14f473fe2eda4c6522d095e19b;p=libs%2Fdatafile.git Add an easier way to construct statements for writing --- 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