ODBCEscaper Class Reference

Scanner for ODBC query strings, Applying a DS-specific match/replace function,. More...

List of all members.

Classes

class  IReplacer
 Interface for a functor that matches/replaces substrings of a SQL query that have been selected and sanitized by ODBCEscaper. More...

Public Types

enum  ESC_TYPE {
  ESC_TYPE_UNKNOWN, ESC_TYPE_PARAM, ESC_TYPE_FUNC, ESC_TYPE_DATE,
  ESC_TYPE_ESCAPE, ESC_TYPE_GUID, ESC_TYPE_INTERVAL, ESC_TYPE_TIME,
  ESC_TYPE_TIMESTAMP, ESC_TYPE_OUTERJOIN, ESC_TYPE_CALL, ESC_TYPE_RESULT,
  ESC_TYPE_FN
}
 

The type of ODBC-escape being passed to an IReplacer.

More...

Public Member Functions

void * _Test ()
 For diagnostics only: test lazy compilation.
simba_wstring Apply (IReplacer &replacer, const simba_wstring &in_query)
 Apply custom replacer to substrings of an ODBC SQL command. This preps for the (possibly recursing) Apply() function.
 ODBCEscaper ()
 Constructor.
simba_int32 Scan (const simba_wstring &in_query, simba_int32 in_pos, char const *in_any)
 Search (str) for any char in (any), starting at (pos). This skips such chars in strings, comments or [identifiers].
 ~ODBCEscaper ()
 Destructor.

Static Public Attributes

static char const *const type_name []
 For diagnostics only: a mapping from ESC_TYPE to string.

Detailed Description

Scanner for ODBC query strings, Applying a DS-specific match/replace function,.

ODBCEscaper handles the parsing that cannot be done with regexes. In particular, it handles recursion like {fn foo({fn bar(x)}, y}. This class is for now effectively a singleton. It maintains no state, and Apply() could just as well be a static method. Note that this uses ICU regexes; therefore it is not threadsafe.


Member Enumeration Documentation

enum ESC_TYPE

The type of ODBC-escape being passed to an IReplacer.

Enumerator:
ESC_TYPE_UNKNOWN 
ESC_TYPE_PARAM 
ESC_TYPE_FUNC 
ESC_TYPE_DATE 
ESC_TYPE_ESCAPE 
ESC_TYPE_GUID 
ESC_TYPE_INTERVAL 
ESC_TYPE_TIME 
ESC_TYPE_TIMESTAMP 
ESC_TYPE_OUTERJOIN 
ESC_TYPE_CALL 
ESC_TYPE_RESULT 
ESC_TYPE_FN 

Constructor & Destructor Documentation

ODBCEscaper (  ) 

Constructor.

~ODBCEscaper (  ) 

Destructor.


Member Function Documentation

void* _Test (  )  [inline]

For diagnostics only: test lazy compilation.

simba_wstring Apply ( IReplacer replacer,
const simba_wstring in_query 
)

Apply custom replacer to substrings of an ODBC SQL command. This preps for the (possibly recursing) Apply() function.

Parameters:
replacer Functor that applies DS-specific transforms.
in_query SQL command string.
Returns:
The result of Applying all replacements
simba_int32 Scan ( const simba_wstring in_query,
simba_int32  in_pos,
char const *  in_any 
)

Search (str) for any char in (any), starting at (pos). This skips such chars in strings, comments or [identifiers].

Parameters:
str String to search.
pos Offset in string from where to start search.
any Characters to search for.
Returns:
The offset of the subset char, or str.GetLength() if none found.

Member Data Documentation

char const* const type_name[] [static]

For diagnostics only: a mapping from ESC_TYPE to string.


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

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba