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

Function msOWSPrintEncodeMetadataList

mapows.c:1295–1325  ·  view source on GitHub ↗

msOWSPrintEncodeMetadataList() ** ** Prints comma-separated lists metadata. (e.g. keywordList) ** This will print HTML encoded values. **/

Source from the content-addressed store, hash-verified

1293** This will print HTML encoded values.
1294**/
1295int msOWSPrintEncodeMetadataList(FILE *stream, hashTableObj *metadata,
1296 const char *namespaces, const char *name,
1297 const char *startTag,
1298 const char *endTag, const char *itemFormat,
1299 const char *default_value)
1300{
1301 const char *value;
1302 char *encoded;
1303 if((value = msOWSLookupMetadata(metadata, namespaces, name)) ||
1304 (value = default_value) != NULL )
1305 {
1306 char **keywords;
1307 int numkeywords;
1308
1309 keywords = msStringSplit(value, ',', &numkeywords);
1310 if(keywords && numkeywords > 0) {
1311 int kw;
1312 if(startTag) msIO_fprintf(stream, "%s", startTag);
1313 for(kw=0; kw<numkeywords; kw++)
1314 {
1315 encoded = msEncodeHTMLEntities(keywords[kw]);
1316 msIO_fprintf(stream, itemFormat, encoded);
1317 msFree(encoded);
1318 }
1319 if(endTag) msIO_fprintf(stream, "%s", endTag);
1320 msFreeCharArray(keywords, numkeywords);
1321 }
1322 return MS_TRUE;
1323 }
1324 return MS_FALSE;
1325}
1326
1327/* msOWSPrintEncodeParamList()
1328**

Calls 6

msOWSLookupMetadataFunction · 0.85
msStringSplitFunction · 0.85
msIO_fprintfFunction · 0.85
msEncodeHTMLEntitiesFunction · 0.85
msFreeFunction · 0.85
msFreeCharArrayFunction · 0.85

Tested by

no test coverage detected