X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstatement.cpp;h=a1bd688bf38016b24e326ce2e863cc6f76f51fd8;hb=a582163d380833b1370ba067a1fd0ad5c2984723;hp=2df8b4cdde28e9019164977aa32b6771fbcd249f;hpb=27630d44298cb67e075c166f4421288cc8ca117e;p=libs%2Fdatafile.git diff --git a/source/statement.cpp b/source/statement.cpp index 2df8b4c..a1bd688 100644 --- a/source/statement.cpp +++ b/source/statement.cpp @@ -1,21 +1,42 @@ /* $Id: statement.h 19 2007-08-21 14:11:23Z tdb $ This file is part of libmspdatafile -Copyright © 2006 Mikko Rasa, Mikkosoft Productions +Copyright © 2007, 2010 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ #include #include "statement.h" +using namespace std; + namespace Msp { namespace DataFile { -std::string Statement::get_location() const +Statement::Statement(): + valid(false), + line(0) +{ } + +Statement::Statement(const string &kw): + keyword(kw), + valid(true), + line(0) +{ } + +string Statement::get_location() const { - std::string result=source; + string result = source; if(line) - result+=format(":%d", line); + result += format(":%d", line); + return result; +} + +string Statement::get_signature() const +{ + string result; + for(Arguments::const_iterator i = args.begin(); i!=args.end(); ++i) + result += i->get_signature(); return result; }