HyriseSQLParser/src/SQLParserResult.cpp

41 lines
802 B
C++
Raw Normal View History

2016-02-27 14:45:59 +01:00
#include "SQLParserResult.h"
namespace hsql {
2016-02-27 15:01:06 +01:00
SQLParserResult::SQLParserResult() :
isValid(true),
errorMsg(NULL) {};
2016-02-27 14:45:59 +01:00
2016-02-27 15:01:06 +01:00
SQLParserResult::SQLParserResult(SQLStatement* stmt) :
isValid(true),
errorMsg(NULL) {
addStatement(stmt);
};
2016-02-27 14:45:59 +01:00
2016-02-27 15:01:06 +01:00
SQLParserResult::~SQLParserResult() {
for (std::vector<SQLStatement*>::iterator it = statements.begin(); it != statements.end(); ++it) {
delete *it;
}
2016-02-27 14:45:59 +01:00
2016-02-27 15:01:06 +01:00
delete errorMsg;
}
2016-02-27 14:45:59 +01:00
2016-02-27 15:01:06 +01:00
void SQLParserResult::addStatement(SQLStatement* stmt) {
statements.push_back(stmt);
}
2016-02-27 14:45:59 +01:00
2016-02-27 15:01:06 +01:00
SQLStatement* SQLParserResult::getStatement(int id) {
return statements[id];
}
2016-02-27 14:45:59 +01:00
2016-02-27 15:01:06 +01:00
size_t SQLParserResult::size() {
return statements.size();
}
2016-02-27 14:45:59 +01:00
} // namespace hsql