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

Function loadExpressionString

mapfile.c:2106–2134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2104}
2105
2106int loadExpressionString(expressionObj *exp, char *value)
2107{
2108 msyystate = MS_TOKENIZE_STRING; msyystring = value;
2109 msyylex(); /* sets things up but processes no tokens */
2110
2111 freeExpression(exp); /* we're totally replacing the old expression so free (which re-inits) to start over */
2112
2113 msyystring_icase = MS_TRUE;
2114 if((exp->type = getSymbol(4, MS_EXPRESSION,MS_REGEX,MS_IREGEX,MS_ISTRING)) != -1) {
2115 exp->string = msStrdup(msyystring_buffer);
2116
2117 if(exp->type == MS_ISTRING) {
2118 exp->type = MS_STRING;
2119 exp->flags = exp->flags | MS_EXP_INSENSITIVE;
2120 } else if(exp->type == MS_IREGEX) {
2121 exp->type = MS_REGEX;
2122 exp->flags = exp->flags | MS_EXP_INSENSITIVE;
2123 }
2124 } else {
2125 msResetErrorList(); /* failure above is not really an error since we'll consider anything not matching (like an unquoted number) as a STRING) */
2126 exp->type = MS_STRING;
2127 if((strlen(value) - strlen(msyystring_buffer)) == 2)
2128 exp->string = msStrdup(msyystring_buffer); /* value was quoted */
2129 else
2130 exp->string = msStrdup(value); /* use the whole value */
2131 }
2132
2133 return(0);
2134}
2135
2136/* msGetExpressionString()
2137 *

Callers 4

msLoadExpressionStringFunction · 0.85
makeTimeFilterFunction · 0.85
msSOSGetObservationFunction · 0.85

Calls 4

freeExpressionFunction · 0.85
getSymbolFunction · 0.85
msStrdupFunction · 0.85
msResetErrorListFunction · 0.85

Tested by

no test coverage detected