]> git.tdb.fi Git - libs/datafile.git/blob - source/statement.cpp
Restructure the tool and make it able to handle multiple input files
[libs/datafile.git] / source / statement.cpp
1 #include <msp/strings/format.h>
2 #include "statement.h"
3
4 using namespace std;
5
6 namespace Msp {
7 namespace DataFile {
8
9 Statement::Statement():
10         valid(false),
11         line(0)
12 { }
13
14 Statement::Statement(const string &kw):
15         keyword(kw),
16         valid(true),
17         line(0)
18 { }
19
20 string Statement::get_location() const
21 {
22         string result = source;
23         if(line)
24                 result += format(":%d", line);
25         return result;
26 }
27
28 string Statement::get_signature() const
29 {
30         string result;
31         for(Arguments::const_iterator i = args.begin(); i!=args.end(); ++i)
32                 result += i->get_signature();
33         return result;
34 }
35
36 } // namespace DataFile
37 } // namespace Msp