21 #ifndef _SWQ_H_INCLUDED_
22 #define _SWQ_H_INCLUDED_
28 #if defined(_WIN32) && !defined(_WIN32_WCE)
29 # define strcasecmp stricmp
30 #elif defined(_WIN32_WCE)
31 # define strcasecmp _stricmp
81 #define SWQ_IS_INTEGER(x) ((x) == SWQ_INTEGER || (x) == SWQ_INTEGER64)
96 void *record_handle );
100 int bAllowMismatchTypeOnFieldComparison );
118 CPLString UnparseOperationFromUnparsedSubExpr(
char** apszSubExpr);
120 void Dump( FILE *fp,
int depth );
121 swq_field_type Check(
swq_field_list *,
int bAllowFieldsInSecondaryTables,
122 int bAllowMismatchTypeOnFieldComparison,
128 void ReplaceBetweenByGEAndLERecurse();
130 swq_node_type eNodeType;
131 swq_field_type field_type;
135 void ReverseSubExpressions();
163 swq_op_evaluator pfnEvaluator;
164 swq_op_checker pfnChecker;
170 static const swq_operation *GetOperator( swq_op eOperation );
177 virtual const swq_operation *GetOperator(
const char * ) = 0;
191 swq_field_type *types;
202 pszLastValid(NULL), bAcceptCustomFuncs(FALSE),
203 poRoot(NULL), poCurSelect(NULL) {}
206 const char *pszInput;
208 const char *pszLastValid;
209 int bAcceptCustomFuncs;
224 int swq_identify_field(
const char* table_name,
226 swq_field_type *this_type,
int *table_id );
228 CPLErr swq_expr_compile(
const char *where_clause,
231 swq_field_type *field_types,
236 CPLErr swq_expr_compile2(
const char *where_clause,
245 int swq_test_like(
const char *input,
const char *pattern );
248 swq_field_type SWQGeneralChecker(
swq_expr_node *node,
int bAllowMismatchTypeOnFieldComparison );
250 swq_field_type SWQCastChecker(
swq_expr_node *node,
int bAllowMismatchTypeOnFieldComparison );
251 const char* SWQFieldTypeToString( swq_field_type field_type );
255 #define SWQP_ALLOW_UNDEFINED_COL_FUNCS 0x01
257 #define SWQM_SUMMARY_RECORD 1
258 #define SWQM_RECORDSET 2
259 #define SWQM_DISTINCT_LIST 3
266 SWQCF_COUNT = SWQ_COUNT,
272 swq_col_func col_func;
278 swq_field_type field_type;
279 swq_field_type target_type;
292 char **distinct_list;
317 int bAllowFieldsInSecondaryTablesInWhere;
318 int bAddSecondaryTablesGeometryFields;
319 int bAlwaysPrefixWithTableName;
320 int bAllowDistinctOnGeometryField;
321 int bAllowDistinctOnMultipleFields;
324 bAllowFieldsInSecondaryTablesInWhere(FALSE),
325 bAddSecondaryTablesGeometryFields(FALSE),
326 bAlwaysPrefixWithTableName(FALSE),
327 bAllowDistinctOnGeometryField(FALSE),
328 bAllowDistinctOnMultipleFields(FALSE) {}
343 int PushField(
swq_expr_node *poExpr,
const char *pszAlias=NULL,
344 int distinct_flag = FALSE );
349 int PushTableDef(
const char *pszDataSource,
350 const char *pszTableName,
351 const char *pszAlias );
361 void PushOrderBy(
const char* pszTableName,
const char *pszFieldName,
int bAscending );
366 void PushUnionAll(
swq_select* poOtherSelectIn );
368 CPLErr preparse(
const char *select_statement,
369 int bAcceptCustomFuncs = FALSE );
371 int bAlwaysPrefixWithTableName );
379 CPLErr swq_select_parse(
swq_select *select_info,
383 const char *swq_select_finish_summarize(
swq_select *select_info );
384 const char *swq_select_summarize(
swq_select *select_info,
388 int swq_is_reserved_keyword(
const char* pszStr);
390 char* OGRHStoreGetValue(
const char* pszHStore,
const char* pszSearchedKey);
OGRFieldSubType
Definition: ogr_core.h:540
Convenient string class based on std::string.
Definition: cpl_string.h:236
OGRwkbGeometryType
Definition: ogr_core.h:309
Definition: ogr_geometry.h:104