Changeset 208
- Timestamp:
- 04/23/10 17:01:18 (22 months ago)
- Location:
- src
- Files:
-
- 3 modified
-
ows_api.h (modified) (1 diff)
-
struct/buffer.c (modified) (1 diff)
-
wfs/wfs_get_feature.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/ows_api.h
r205 r208 17 17 void buffer_add_int (buffer * buf, int i); 18 18 void buffer_add_str (buffer * buf, const char *str); 19 bool buffer_cmp (const buffer * buf, const char *str); 20 bool buffer_ncmp(const buffer * buf, const char *str, size_t n); 19 21 bool buffer_case_cmp (const buffer * buf, const char *str); 20 bool buffer_cmp (const buffer * buf, const char *str);21 22 void buffer_copy (buffer * dest, const buffer * src); 22 23 void buffer_empty (buffer * buf); -
src/struct/buffer.c
r182 r208 307 307 308 308 /* 309 * Check if a buffer string is the same than another, on the n first char 310 */ 311 bool buffer_ncmp(const buffer * buf, const char *str, size_t n) 312 { 313 size_t i; 314 315 assert(buf != NULL); 316 assert(str != NULL); 317 318 if (buf->use < n) return false; 319 320 for (i = 0 ; i < n ; i++) 321 if (buf->buf[i] != str[i]) 322 return false; 323 324 return true; 325 } 326 327 /* 309 328 * Check if a buffer string is the same than anoter for a specified length 310 329 * (insensitive case check) -
src/wfs/wfs_get_feature.c
r201 r208 140 140 fprintf(o->output, "false"); 141 141 142 /* FIXME what about varchar or char postgreSQL type ? */ 143 } else if (buffer_cmp(prop_type, "text")) { 144 value_encoded = buffer_encode_xml_entities(value); 142 } else if (buffer_cmp(prop_type, "text") 143 || buffer_ncmp(prop_type, "char", 4) 144 || buffer_ncmp(prop_type, "varchar", 7)) { 145 value_encoded = buffer_encode_xml_entities(value); 145 146 fprintf(o->output, "%s", value_encoded->buf); 146 147 buffer_free(value_encoded); 147 } else 148 fprintf(o->output, "%s", value->buf);148 149 } else fprintf(o->output, "%s", value->buf); 149 150 150 151 if (gml_ns)