Public Member Functions

AppSecInc::Databases::ODBC::OdbcParser Class Reference

#include <OdbcParser.h>

List of all members.

Public Member Functions

 OdbcParser ()
virtual ~OdbcParser ()
void setSqlFlavour (const std::wstring &sqlFlavour)
 select sql flavor (type of command-line tool)
void setDelimiters (const std::vector< const std::wstring > &delimiters)
 set arbitrary delimiters (insert commands not supported)
void setSqlTypeOrDelimiter (const std::wstring &type, const std::wstring &delimiter)
 convenience method that sets either sql flavour or delimiter - whichever not empty.
void setPathResolver (PathResolver *pathResolver)
 set path resolver (default - file system path resolver)
void setSourcePath (const std::wstring &sourceName)
 set input source path (e.g. file name or MSI binary ID)
void setInput (const std::wstring &input)
 set input string to process
PathResolvergetPathResolver () const
 get path resolver used
bool hasMore ()
 check if there are more batches in the input
std::wstring getNextBatch ()
 get next batch to execute
bool exitOnErrorFlag ()
 returns current state of error processing in the script
std::wstring processInsertsOnly ()
 return input with all files inserted (flatten input)

Detailed Description

Class provides parsing of sql scripts that emulates parsing in vendor-specific command-line tools (sqlplus, osql, etc.), particularly:

Parsing follows common command-line tools conventions:

Type of command-line tool is selected with setSqlFlavor() method; method setDelimiters() is provided only for compatibility with existing MSI actions and odbq --delimiter option, without insertion support.

Parser may be used both with files and other sources, e.g. with MSI binary streams, see PathResolver for details.

Parser input is provided either with setSourcePath() or with setInput() method.


Constructor & Destructor Documentation

OdbcParser::OdbcParser ( )
OdbcParser::~OdbcParser ( ) [virtual]

Member Function Documentation

bool OdbcParser::exitOnErrorFlag ( )

returns current state of error processing in the script

std::wstring OdbcParser::getNextBatch ( )

get next batch to execute

PathResolver * OdbcParser::getPathResolver ( ) const

get path resolver used

bool OdbcParser::hasMore ( )

check if there are more batches in the input

std::wstring OdbcParser::processInsertsOnly ( )

return input with all files inserted (flatten input)

void OdbcParser::setDelimiters ( const std::vector< const std::wstring > &  delimiters)

set arbitrary delimiters (insert commands not supported)

void OdbcParser::setInput ( const std::wstring &  input)

set input string to process

void OdbcParser::setPathResolver ( PathResolver pathResolver)

set path resolver (default - file system path resolver)

void OdbcParser::setSourcePath ( const std::wstring &  sourceName)

set input source path (e.g. file name or MSI binary ID)

void OdbcParser::setSqlFlavour ( const std::wstring &  sqlFlavour)

select sql flavor (type of command-line tool)

Parameters:
sqlFlavoursql flavour, case-insensitive. One of 'sqlserver', 'mssql', 'osql', 'tsql', 'sqlcmd', 'oracle',sqlplus', 'sql*plus'.
void OdbcParser::setSqlTypeOrDelimiter ( const std::wstring &  type,
const std::wstring &  delimiter 
)

convenience method that sets either sql flavour or delimiter - whichever not empty.


The documentation for this class was generated from the following files:


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com