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

Function processItemTag

maptemplate.c:1171–1331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1169enum ITEM_ESCAPING {ESCAPE_HTML, ESCAPE_URL, ESCAPE_NONE};
1170
1171static int processItemTag(layerObj *layer, char **line, shapeObj *shape)
1172{
1173 int i, j;
1174
1175 char *tag, *tagStart, *tagEnd;
1176 hashTableObj *tagArgs=NULL;
1177 int tagOffset, tagLength;
1178 char *encodedTagValue=NULL, *tagValue=NULL;
1179
1180 char *argValue=NULL;
1181
1182 char *name=NULL, *pattern=NULL;
1183 char *format=NULL, *nullFormat=NULL;
1184 int precision;
1185 int uc, lc, commify;
1186 int escape;
1187
1188 if(!*line) {
1189 msSetError(MS_WEBERR, "Invalid line pointer.", "processItemTag()");
1190 return(MS_FAILURE);
1191 }
1192
1193 tagStart = findTag(*line, "item");
1194
1195 if(!tagStart) return(MS_SUCCESS); /* OK, just return; */
1196
1197 while (tagStart) {
1198 format = "$value"; /* initialize the tag arguments */
1199 nullFormat = "";
1200 precision=-1;
1201 name = pattern = NULL;
1202 uc = lc = commify = MS_FALSE;
1203 escape=ESCAPE_HTML;
1204
1205 tagOffset = tagStart - *line;
1206
1207 /* check for any tag arguments */
1208 if(getTagArgs("item", tagStart, &tagArgs) != MS_SUCCESS) return(MS_FAILURE);
1209 if(tagArgs) {
1210 argValue = msLookupHashTable(tagArgs, "name");
1211 if(argValue) name = argValue;
1212
1213 argValue = msLookupHashTable(tagArgs, "pattern");
1214 if(argValue) pattern = argValue;
1215
1216 argValue = msLookupHashTable(tagArgs, "precision");
1217 if(argValue) precision = atoi(argValue);
1218
1219 argValue = msLookupHashTable(tagArgs, "format");
1220 if(argValue) format = argValue;
1221
1222 argValue = msLookupHashTable(tagArgs, "nullformat");
1223 if(argValue) nullFormat = argValue;
1224
1225 argValue = msLookupHashTable(tagArgs, "uc");
1226 if(argValue && strcasecmp(argValue, "true") == 0) uc = MS_TRUE;
1227
1228 argValue = msLookupHashTable(tagArgs, "lc");

Callers 1

processLineFunction · 0.85

Calls 15

msSetErrorFunction · 0.85
findTagFunction · 0.85
getTagArgsFunction · 0.85
msLookupHashTableFunction · 0.85
strcasecmpFunction · 0.85
msEvalRegexFunction · 0.85
msStrdupFunction · 0.85
msSmallMallocFunction · 0.85
msCommifyStringFunction · 0.85
msReplaceSubstringFunction · 0.85
msFreeFunction · 0.85
findTagEndFunction · 0.85

Tested by

no test coverage detected