00001 #pragma once 00002 00003 #include "OdbcParser.h" 00004 00005 namespace AppSecInc 00006 { 00007 namespace Databases 00008 { 00009 namespace ODBC 00010 { 00011 class CommandSet; 00012 00013 class OdbcParserImpl { 00014 public: 00015 OdbcParserImpl(); 00016 virtual ~OdbcParserImpl(); 00017 00018 void setPathResolver(PathResolver* resolver); 00019 void setDelimiters(const std::vector<const std::wstring>& delimiters); 00020 void setSqlFlavour(const std::wstring& sqlFlavour); 00021 PathResolver* getPathResolver() const; 00022 00023 // insert additional input from the specified source 00024 // (e.g. file) in the current point 00025 void insertSource(const std::wstring& path); 00026 // insert additional input in the current point 00027 void insertInput(const std::wstring& input); 00028 00029 bool hasMore() const; 00030 std::wstring getNextBatch(); 00031 00032 bool exitOnErrorFlag(); 00033 void setExitOnErrorFlag( bool on ); 00034 00035 std::wstring processInsertsOnly(); 00036 00037 void checkInitialState(); 00038 00039 private: 00040 void prepareNext(std::wstring& buffer, bool processInsertsOnly); 00041 void nextline(std::wstring& buffer); 00042 00043 CommandSet* commandSet; 00044 PathResolver* pathResolver; 00045 unsigned int currPos; 00046 std::wstring sql; 00047 bool exitOnError; 00048 }; 00049 } 00050 } 00051 }
© Application Security Inc. - All Rights Reserved | http://msiext.codeplex.com |