MCPcopy Index your code
hub / github.com/MapServer/MapServer / writeNameValuePair

Function writeNameValuePair

mapfile.c:583–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581}
582
583static void writeNameValuePair(FILE *stream, int indent, const char *name, const char *value) {
584 char *string_tmp;
585 if(!name || !value) return;
586 writeIndent(stream, ++indent);
587
588 if ( (strchr(name, '\'') == NULL) && (strchr(name, '\"') == NULL))
589 fprintf(stream, "\"%s\"\t", name);
590 else if ( (strchr(name, '\"') != NULL) && (strchr(name, '\'') == NULL))
591 fprintf(stream, "'%s'\t", name);
592 else if ( (strchr(name, '\'') != NULL) && (strchr(name, '\"') == NULL))
593 fprintf(stream, "\"%s\"\t", name);
594 else {
595 string_tmp = msStringEscape(name);
596 fprintf(stream, "\"%s\"\t", string_tmp);
597 free(string_tmp);
598 }
599
600 if ( (strchr(value, '\'') == NULL) && (strchr(value, '\"') == NULL))
601 fprintf(stream, "\"%s\"\n", value);
602 else if ( (strchr(value, '\"') != NULL) && (strchr(value, '\'') == NULL))
603 fprintf(stream, "'%s'\n", value);
604 else if ( (strchr(value, '\'') != NULL) && (strchr(value, '\"') == NULL))
605 fprintf(stream, "\"%s\"\n", value);
606 else {
607 string_tmp = msStringEscape(value);
608 fprintf(stream, "\"%s\"\n", string_tmp);
609 free(string_tmp);
610 }
611}
612
613static void writeAttributeBinding(FILE *stream, int indent, const char *name, attributeBindingObj *binding) {
614 if(!binding || !binding->item) return;

Callers 1

writeHashTableFunction · 0.85

Calls 2

writeIndentFunction · 0.85
msStringEscapeFunction · 0.85

Tested by

no test coverage detected