Added "strpos" function to regexroute.
git-svn-id: http://voip.null.ro/svn/yate@4456 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
93402140eb
commit
c18e7fae9a
|
@ -43,6 +43,7 @@
|
||||||
; $(ge,VAL1,VAL2) = "true" if VAL1 >= VAL2, "false" otherwise
|
; $(ge,VAL1,VAL2) = "true" if VAL1 >= VAL2, "false" otherwise
|
||||||
; $(streq,VAL1,VAL2) = "true" if VAL1 = VAL2 (string), "false" otherwise
|
; $(streq,VAL1,VAL2) = "true" if VAL1 = VAL2 (string), "false" otherwise
|
||||||
; $(strne,VAL1,VAL2) = "true" if VAL1 != VAL2 (string), "false" otherwise
|
; $(strne,VAL1,VAL2) = "true" if VAL1 != VAL2 (string), "false" otherwise
|
||||||
|
; $(strpos,VAL1,VAL2) = 0-based position of VAL1 in VAL2, -1 if not found
|
||||||
; $(random,STRING) = STRING with each ? character replaced with a random digit
|
; $(random,STRING) = STRING with each ? character replaced with a random digit
|
||||||
; $(index,N,ITEM1,ITEM2,...) = N-th (modulo length of list) item in list
|
; $(index,N,ITEM1,ITEM2,...) = N-th (modulo length of list) item in list
|
||||||
; $(rotate,N,ITEM1,ITEM2,...) = list rotated N (modulo length of list) times
|
; $(rotate,N,ITEM1,ITEM2,...) = list rotated N (modulo length of list) times
|
||||||
|
|
|
@ -182,6 +182,13 @@ static void evalFunc(String& str)
|
||||||
ret ^= (str == par);
|
ret ^= (str == par);
|
||||||
str = ret;
|
str = ret;
|
||||||
}
|
}
|
||||||
|
else if ((sep >= 0) && (str == "strpos")) {
|
||||||
|
str = par.substr(sep+1);
|
||||||
|
par = par.substr(0,sep);
|
||||||
|
vars(str);
|
||||||
|
vars(par);
|
||||||
|
str = str.find(par);
|
||||||
|
}
|
||||||
else if ((sep >= 0) && ((str == "add") || (str == "+")))
|
else if ((sep >= 0) && ((str == "add") || (str == "+")))
|
||||||
mathOper(str,par,sep,OPER_ADD);
|
mathOper(str,par,sep,OPER_ADD);
|
||||||
else if ((sep >= 0) && ((str == "sub") || (str == "-")))
|
else if ((sep >= 0) && ((str == "sub") || (str == "-")))
|
||||||
|
|
Loading…
Reference in New Issue