]> git.tdb.fi Git - libs/datafile.git/blob - source/statement.h
Revert "Convenience function for reporting errors in loaded data"
[libs/datafile.git] / source / statement.h
1 #ifndef MSP_DATAFILE_STATEMENT_H_
2 #define MSP_DATAFILE_STATEMENT_H_
3
4 #include <list>
5 #include "value.h"
6
7 namespace Msp {
8 namespace DataFile {
9
10 class Statement
11 {
12 public:
13         typedef std::vector<Value> Arguments;
14
15         std::string keyword;
16         Arguments args;
17         bool valid;
18         std::string source;
19         unsigned line;
20         std::list<Statement> sub;
21
22         Statement();
23         Statement(const std::string &);
24         std::string get_location() const;
25         std::string get_signature() const;
26         
27         template<typename T>
28         Statement &append(const T &v)
29         {
30                 args.push_back(v);
31                 return *this;
32         }
33
34         template<typename T>
35         Statement &operator,(const T &v)
36         { return append(v); }
37 };
38
39 } // namespace DataFile
40 } // namespace Msp
41
42 #endif