X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Fstatement.cpp;h=3b6f7165b0ef1fa50874c255b12cd987c2563b22;hp=29961a963fcfa97ce6d8461c0a384a64ce465bcd;hb=3b78eeb8b92dc3524d6a0456b4daf0a0f3dbf813;hpb=a82776d980239e48d2b509d33b56e77a1ea44dda diff --git a/source/statement.cpp b/source/statement.cpp index 29961a9..3b6f716 100644 --- a/source/statement.cpp +++ b/source/statement.cpp @@ -1,5 +1,6 @@ #include #include "statement.h" +#include "type.h" using namespace std; @@ -33,5 +34,38 @@ string Statement::get_signature() const return result; } + +StatementInfo::StatementInfo(): + args_size(0) +{ } + +StatementInfo::StatementInfo(const string &k, const string &s): + key(k, s), + args_size(0) +{ + for(string::const_iterator i=key.signature.begin(); i!=key.signature.end(); ++i) + { + arg_offsets.push_back(args_size); + switch(*i) + { + case IntType::signature: + args_size += sizeof(IntType::Store); + break; + case FloatType::signature: + args_size += sizeof(FloatType::Store); + break; + case BoolType::signature: + args_size += sizeof(BoolType::Store); + break; + case StringType::signature: + args_size += sizeof(StringType::Store); + break; + case SymbolType::signature: + args_size += sizeof(SymbolType::Store); + break; + } + } +} + } // namespace DataFile } // namespace Msp