HyriseSQLParser/src/SQLParserResult.h

47 lines
1.2 KiB
C
Raw Normal View History

#ifndef __SQLPARSERRESULT__
#define __SQLPARSERRESULT__
#include "sql/SQLStatement.h"
namespace hsql {
// Represents the result of the SQLParser.
// If parsing was successful it contains a list of SQLStatement.
class SQLParserResult {
public:
// Initialize with empty statement list.
SQLParserResult();
// Initialize with a single statement.
SQLParserResult(SQLStatement* stmt);
// Deletes all statements in the resul.
virtual ~SQLParserResult();
2016-02-27 15:01:06 +01:00
// Returns the number of statements in the result.
size_t size();
2016-02-27 15:01:06 +01:00
// Gets the SQL statement with the given index.
SQLStatement* getStatement(int id);
2016-02-27 15:01:06 +01:00
// Adds a statement to the result list of statements.
void addStatement(SQLStatement* stmt);
2016-02-27 15:01:06 +01:00
// List of statements within the result.
std::vector<SQLStatement*> statements;
// Flag indicating the parsing was successful.
bool isValid;
2016-02-27 15:01:06 +01:00
// Error message, if an error occurred.
const char* errorMsg;
// Line number of the occurrance of the error in the query.
int errorLine;
// Column number of the occurrance of the error in the query.
int errorColumn;
};
2016-02-27 14:45:59 +01:00
} // namespace hsql
#endif // __SQLPARSERRESULT__