29#include "../ows/ows.h"
41 bool bool_type =
false;
42 bool sensitive_case =
true;
44 assert(o &&
typename && fe && n);
52 matchcase = xmlGetProp(n, (xmlChar *)
"matchCase");
53 if (matchcase && !strcmp((
char *) matchcase,
"false")) sensitive_case =
false;
58 while (n->type != XML_ELEMENT_NODE) n = n->next;
74 if (tmp->
buf[0] ==
'(') {
96 if (
buffer_cmp(type,
"bool")) bool_type =
true;
110 if (
buffer_cmp(name,
"PropertyIsGreaterThan"))
113 if (
buffer_cmp(name,
"PropertyIsLessThanOrEqualTo"))
116 if (
buffer_cmp(name,
"PropertyIsGreaterThanOrEqualTo"))
123 while (n->type != XML_ELEMENT_NODE) n = n->next;
155 xmlChar *content, *wildcard, *singlechar, *escape, *matchcase;
158 bool sensitive_case =
true;
160 assert(o &&
typename && fe && n);
162 wildcard = xmlGetProp(n, (xmlChar *)
"wildCard");
163 singlechar = xmlGetProp(n, (xmlChar *)
"singleChar");
164 matchcase = xmlGetProp(n, (xmlChar *)
"matchCase");
167 escape = xmlGetProp(n, (xmlChar *)
"escape");
169 escape = xmlGetProp(n, (xmlChar *)
"escapeChar");
172 if (matchcase && !strcmp((
char *) matchcase,
"false")) sensitive_case =
false;
176 while (n->type != XML_ELEMENT_NODE) n = n->next;
186 if (!sensitive_case) {
194 while (n->type != XML_ELEMENT_NODE) n = n->next;
196 content = xmlNodeGetContent(n->children);
202 if ((
char *) wildcard && (
char *) singlechar && (
char *) escape) {
203 if (strlen((
char *) escape)) pg_string =
buffer_replace(pg_string, (
char *) escape,
"\\\\");
204 if (strlen((
char *) wildcard)) pg_string =
buffer_replace(pg_string, (
char *) wildcard,
"%");
205 if (strlen((
char *) singlechar)) pg_string =
buffer_replace(pg_string, (
char *) singlechar,
"_");
234 assert(o &&
typename && fe && n);
237 while (n->type != XML_ELEMENT_NODE) n = n->next;
253 assert(o &&
typename && fe && n);
259 while (n->type != XML_ELEMENT_NODE) n = n->next;
270 while (n->type != XML_ELEMENT_NODE) n = n->next;
281 while (n->type != XML_ELEMENT_NODE) n = n->next;
300 if ( !strcmp(name,
"PropertyIsEqualTo")
301 || !strcmp(name,
"PropertyIsNotEqualTo")
302 || !strcmp(name,
"PropertyIsLessThan")
303 || !strcmp(name,
"PropertyIsGreaterThan")
304 || !strcmp(name,
"PropertyIsLessThanOrEqualTo")
305 || !strcmp(name,
"PropertyIsGreaterThanOrEqualTo")
306 || !strcmp(name,
"PropertyIsLike")
307 || !strcmp(name,
"PropertyIsNull")
308 || !strcmp(name,
"PropertyIsBetween"))
321 assert(o &&
typename && fe && n);
324 if ( !strcmp((
char *) n->name,
"PropertyIsEqualTo")
325 || !strcmp((
char *) n->name,
"PropertyIsNotEqualTo")
326 || !strcmp((
char *) n->name,
"PropertyIsLessThan")
327 || !strcmp((
char *) n->name,
"PropertyIsGreaterThan")
328 || !strcmp((
char *) n->name,
"PropertyIsLessThanOrEqualTo")
329 || !strcmp((
char *) n->name,
"PropertyIsGreaterThanOrEqualTo"))
331 else if (!strcmp((
char *) n->name,
"PropertyIsLike"))
333 else if (!strcmp((
char *) n->name,
"PropertyIsNull"))
335 else if (!strcmp((
char *) n->name,
"PropertyIsBetween"))
static buffer * fe_property_is_like(ows *o, buffer *typename, filter_encoding *fe, xmlNodePtr n)
bool fe_is_comparison_op(char *name)
static buffer * fe_property_is_null(ows *o, buffer *typename, filter_encoding *fe, xmlNodePtr n)
static buffer * fe_property_is_between(ows *o, buffer *typename, filter_encoding *fe, xmlNodePtr n)
buffer * fe_comparison_op(ows *o, buffer *typename, filter_encoding *fe, xmlNodePtr n)
static buffer * fe_binary_comparison_op(ows *o, buffer *typename, filter_encoding *fe, xmlNodePtr n)
void buffer_add(buffer *buf, char c)
int ows_version_get(ows_version *v)
void buffer_empty(buffer *buf)
void buffer_copy(buffer *dest, const buffer *src)
bool buffer_cmp(const buffer *buf, const char *str)
buffer * ows_psql_type(ows *o, buffer *layer_name, buffer *property)
void buffer_add_str(buffer *buf, const char *str)
buffer * fe_expression(ows *o, buffer *typename, filter_encoding *fe, buffer *sql, xmlNodePtr n)
char * ows_psql_escape_string(ows *o, const char *content)
buffer * buffer_replace(buffer *buf, char *before, char *after)
void buffer_free(buffer *buf)
void buffer_shift(buffer *buf, size_t len)
void buffer_pop(buffer *buf, size_t len)
buffer * fe_property_name(ows *o, buffer *typename, filter_encoding *fe, buffer *sql, xmlNodePtr n, bool check_geom_column, bool mandatory)
buffer * ows_layer_prefix_to_uri(ows_layer_list *ll, buffer *layer_name_prefix)
char * buf
size to next realloc
enum fe_error_code error_code