diff options
Diffstat (limited to 'src/modules/str/libkvistr.cpp')
-rw-r--r-- | src/modules/str/libkvistr.cpp | 316 |
1 files changed, 158 insertions, 158 deletions
diff --git a/src/modules/str/libkvistr.cpp b/src/modules/str/libkvistr.cpp index 58549f57..0403bbc1 100644 --- a/src/modules/str/libkvistr.cpp +++ b/src/modules/str/libkvistr.cpp @@ -34,8 +34,8 @@ #include "kvi_malloc.h" #include "kvi_kvs_arraycast.h" -#include <qregexp.h> -#include <qclipboard.h> +#include <tqregexp.h> +#include <tqclipboard.h> #ifdef COMPILE_SSL_SUPPORT #include <openssl/evp.h> @@ -65,7 +65,7 @@ static bool str_kvs_fnc_section(KviKvsModuleFunctionCall * c) { - QString szString, szSeparator,szSplittedString; + TQString szString, szSeparator,szSplittedString; kvs_int_t iPosFrom, iPosTo; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string_to_split",KVS_PT_STRING,0,szString) @@ -99,11 +99,11 @@ static bool str_kvs_fnc_section(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_fromclipboard(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETERS_END(c) - QClipboard *cb = QApplication::clipboard(); - szString = cb->text(QClipboard::Clipboard); + TQClipboard *cb = TQApplication::tqclipboard(); + szString = cb->text(TQClipboard::Clipboard); c->returnValue()->setString(szString); return true; } @@ -128,12 +128,12 @@ static bool str_kvs_fnc_fromclipboard(KviKvsModuleFunctionCall * c) static bool str_kvs_cmd_toClipboard(KviKvsModuleCommandCall * c) { - QString szValue; + TQString szValue; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("value",KVS_PT_STRING,KVS_PF_OPTIONAL,szValue) KVSM_PARAMETERS_END(c) - QClipboard *cb = QApplication::clipboard(); - cb->setText(szValue, QClipboard::Clipboard ); + TQClipboard *cb = TQApplication::tqclipboard(); + cb->setText(szValue, TQClipboard::Clipboard ); return true; } @@ -169,7 +169,7 @@ static bool str_kvs_cmd_toClipboard(KviKvsModuleCommandCall * c) static bool str_kvs_fnc_len(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) @@ -196,11 +196,11 @@ static bool str_kvs_fnc_len(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_lowcase(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string_to_convert",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) - c->returnValue()->setString(KviQString::lowerISO88591(szString)); + c->returnValue()->setString(KviTQString::lowerISO88591(szString)); return true; } /* @@ -222,11 +222,11 @@ static bool str_kvs_fnc_lowcase(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_upcase(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string_to_convert",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) - c->returnValue()->setString(KviQString::upperISO88591(szString)); + c->returnValue()->setString(KviTQString::upperISO88591(szString)); return true; } /* @@ -248,7 +248,7 @@ static bool str_kvs_fnc_upcase(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_localelowcase(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string_to_convert",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) @@ -275,7 +275,7 @@ static bool str_kvs_fnc_localelowcase(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_localeupcase(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string_to_convert",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) @@ -365,7 +365,7 @@ static bool str_kvs_fnc_isunsignednumber(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_isempty(KviKvsModuleFunctionCall * c) { - QString v; + TQString v; bool bRet; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("datastring",KVS_PT_STRING,0,v) @@ -377,15 +377,15 @@ static bool str_kvs_fnc_isempty(KviKvsModuleFunctionCall * c) } /* - @doc: str.contains + @doc: str.tqcontains @type: function @title: - $str.contains + $str.tqcontains @short: Returns 1 if the first parameter contains the second @syntax: - <bool> $str.contains(<container:string>,<tofind:string>) + <bool> $str.tqcontains(<container:string>,<totqfind:string>) @description: Returns 1 if the first string parameter contains the second string parameter. This function is case sensitive. @@ -394,15 +394,15 @@ static bool str_kvs_fnc_isempty(KviKvsModuleFunctionCall * c) */ -static bool str_kvs_fnc_contains(KviKvsModuleFunctionCall * c) +static bool str_kvs_fnc_tqcontains(KviKvsModuleFunctionCall * c) { - QString szString,szSubString; + TQString szString,szSubString; bool bIs; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("container",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("tofind",KVS_PT_STRING,0,szSubString) + KVSM_PARAMETER("totqfind",KVS_PT_STRING,0,szSubString) KVSM_PARAMETERS_END(c) - bIs = szString.find(szSubString) != -1; + bIs = szString.tqfind(szSubString) != -1; c->returnValue()->setBoolean(bIs); return true; } @@ -416,23 +416,23 @@ static bool str_kvs_fnc_contains(KviKvsModuleFunctionCall * c) @short: Returns 1 if the first parameter contains the second, case insensitive @syntax: - <bool> $str.containsnocase(<container:string>,<tofind:string>) + <bool> $str.containsnocase(<container:string>,<totqfind:string>) @description: Returns 1 if the first string parameter contains the second string parameter whithout taking in consideration the case of the characters in the string. @seealso: - [fnc]$str.contains[/fnc] + [fnc]$str.tqcontains[/fnc] */ static bool str_kvs_fnc_containsnocase(KviKvsModuleFunctionCall * c) { - QString szString,szSubString; + TQString szString,szSubString; bool bIs; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("container",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("tofind",KVS_PT_STRING,0,szSubString) + KVSM_PARAMETER("totqfind",KVS_PT_STRING,0,szSubString) KVSM_PARAMETERS_END(c) - bIs = szString.find(szSubString,0,false) != -1; + bIs = szString.tqfind(szSubString,0,false) != -1; c->returnValue()->setBoolean(bIs); return true; } @@ -455,13 +455,13 @@ static bool str_kvs_fnc_containsnocase(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_equal(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; bool bIs; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("fromcompare",KVS_PT_STRING,0,szString) KVSM_PARAMETER("tocompare",KVS_PT_STRING,0,szString2) KVSM_PARAMETERS_END(c) - bIs = KviQString::equalCS(szString,szString2); + bIs = KviTQString::equalCS(szString,szString2); c->returnValue()->setBoolean(bIs); return true; } @@ -484,13 +484,13 @@ static bool str_kvs_fnc_equal(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_equalnocase(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; bool bIs; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("fromcompare",KVS_PT_STRING,0,szString) KVSM_PARAMETER("tocompare",KVS_PT_STRING,0,szString2) KVSM_PARAMETERS_END(c) - bIs = KviQString::equalCI(szString,szString2); + bIs = KviTQString::equalCI(szString,szString2); c->returnValue()->setBoolean(bIs); return true; } @@ -515,13 +515,13 @@ static bool str_kvs_fnc_equalnocase(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_cmp(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; int iCmp; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("fromcompare",KVS_PT_STRING,0,szString) KVSM_PARAMETER("tocompare",KVS_PT_STRING,0,szString2) KVSM_PARAMETERS_END(c) - iCmp = KviQString::cmpCS(szString,szString2); + iCmp = KviTQString::cmpCS(szString,szString2); c->returnValue()->setInteger(iCmp); return true; } @@ -545,27 +545,27 @@ static bool str_kvs_fnc_cmp(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_cmpnocase(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; int iCmp; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("fromcompare",KVS_PT_STRING,0,szString) KVSM_PARAMETER("tocompare",KVS_PT_STRING,0,szString2) KVSM_PARAMETERS_END(c) - iCmp = KviQString::cmpCI(szString,szString2); + iCmp = KviTQString::cmpCI(szString,szString2); c->returnValue()->setInteger(iCmp); return true; } /* - @doc: str.find + @doc: str.tqfind @type: function @title: - $str.find + $str.tqfind @short: Find the index of the nth ocurrence of a substring in a string @syntax: - <int> $str.find(<findIn:string>,<tofind:string>[,ocurrence:int]) + <int> $str.tqfind(<findIn:string>,<totqfind:string>[,ocurrence:int]) @description: This function search in the string given as the first parameter for the string given as his second parameter, and will return the index where the nth ocurrence @@ -576,13 +576,13 @@ static bool str_kvs_fnc_cmpnocase(KviKvsModuleFunctionCall * c) FIXME: The semantics of this function are totally broken :( */ -static bool str_kvs_fnc_find(KviKvsModuleFunctionCall * c) +static bool str_kvs_fnc_tqfind(KviKvsModuleFunctionCall * c) { - QString szFindIn, szToFind; + TQString szFindIn, szToFind; kvs_int_t iOcurence; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("findIn",KVS_PT_STRING,0,szFindIn) - KVSM_PARAMETER("tofind",KVS_PT_STRING,0,szToFind) + KVSM_PARAMETER("totqfind",KVS_PT_STRING,0,szToFind) KVSM_PARAMETER("ocurrence",KVS_PT_INTEGER,KVS_PF_OPTIONAL,iOcurence) KVSM_PARAMETERS_END(c) int pos = 1; @@ -609,7 +609,7 @@ static bool str_kvs_fnc_find(KviKvsModuleFunctionCall * c) while (cnt<=pos) { - idx = szFindIn.right(szFindIn.length() - totalIdx).find(szToFind); + idx = szFindIn.right(szFindIn.length() - totalIdx).tqfind(szToFind); if(idx == -1) { c->returnValue()->setInteger(-1); @@ -641,12 +641,12 @@ static bool str_kvs_fnc_find(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_findfirst(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("findIn",KVS_PT_STRING,0,szString) KVSM_PARAMETER("toFind",KVS_PT_STRING,0,szString2) KVSM_PARAMETERS_END(c) - c->returnValue()->setInteger(szString.find(szString2)); + c->returnValue()->setInteger(szString.tqfind(szString2)); return true; } /* @@ -667,12 +667,12 @@ static bool str_kvs_fnc_findfirst(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_findfirstnocase(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("findIn",KVS_PT_STRING,0,szString) KVSM_PARAMETER("toFind",KVS_PT_STRING,0,szString2) KVSM_PARAMETERS_END(c) - c->returnValue()->setInteger(szString.find(szString2,0,false)); + c->returnValue()->setInteger(szString.tqfind(szString2,0,false)); return true; } /* @@ -693,12 +693,12 @@ static bool str_kvs_fnc_findfirstnocase(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_findlast(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("findIn",KVS_PT_STRING,0,szString) KVSM_PARAMETER("toFind",KVS_PT_STRING,0,szString2) KVSM_PARAMETERS_END(c) - c->returnValue()->setInteger(szString.findRev(szString2)); + c->returnValue()->setInteger(szString.tqfindRev(szString2)); return true; } /* @@ -719,12 +719,12 @@ static bool str_kvs_fnc_findlast(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_findlastnocase(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("findIn",KVS_PT_STRING,0,szString) KVSM_PARAMETER("toFind",KVS_PT_STRING,0,szString2) KVSM_PARAMETERS_END(c) - c->returnValue()->setInteger(szString.findRev(szString2,-1,false)); + c->returnValue()->setInteger(szString.tqfindRev(szString2,-1,false)); return true; } /* @@ -744,7 +744,7 @@ static bool str_kvs_fnc_findlastnocase(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_left(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; kvs_int_t iIdx; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) @@ -771,7 +771,7 @@ static bool str_kvs_fnc_left(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_right(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; kvs_int_t iIdx; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) @@ -798,7 +798,7 @@ static bool str_kvs_fnc_right(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_mid(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; kvs_int_t iIdx,iNchars; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) @@ -825,7 +825,7 @@ static bool str_kvs_fnc_mid(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_append(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("toappend",KVS_PT_STRING,0,szString2) @@ -850,7 +850,7 @@ static bool str_kvs_fnc_append(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_prepend(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("toprepend",KVS_PT_STRING,0,szString2) @@ -876,7 +876,7 @@ static bool str_kvs_fnc_prepend(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_insert(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + TQString szString,szString2; kvs_int_t iIdx; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) @@ -903,7 +903,7 @@ static bool str_kvs_fnc_insert(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_strip(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) @@ -927,7 +927,7 @@ static bool str_kvs_fnc_strip(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_stripleft(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) @@ -957,7 +957,7 @@ static bool str_kvs_fnc_stripleft(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_stripright(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) @@ -985,7 +985,7 @@ static bool str_kvs_fnc_stripright(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_stripcolors(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) @@ -994,37 +994,37 @@ static bool str_kvs_fnc_stripcolors(KviKvsModuleFunctionCall * c) } /* - @doc: str.replace + @doc: str.tqreplace @type: function @title: - $str.replace + $str.tqreplace @short: Replace substrings in a string @syntax: - <string> $str.replace(<string:string>,<replacewith:string>,<toreplace:string>) + <string> $str.tqreplace(<string:string>,<replacewith:string>,<totqreplace:string>) @description: This function returns a string created replacing all ocurrences of the third parameter - ('toreplace') in the string given as the first parameter ('string') with the string + ('totqreplace') in the string given as the first parameter ('string') with the string given as the second parameter ('replacewith'). The string replacement is case sensitive!. FIXME: The order of the parameters in this function is illogical (and probably incompatible with any other scripting language) :D @examples: [example] - echo $str.replace("I like big networks","neural","big") + echo $str.tqreplace("I like big networks","neural","big") [/example] */ -static bool str_kvs_fnc_replace(KviKvsModuleFunctionCall * c) +static bool str_kvs_fnc_tqreplace(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr,szToreplace; + TQString szString,szNewstr,szTotqreplace; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("newstr",KVS_PT_STRING,0,szNewstr) - KVSM_PARAMETER("toreplace",KVS_PT_STRING,0,szToreplace) + KVSM_PARAMETER("totqreplace",KVS_PT_STRING,0,szTotqreplace) KVSM_PARAMETERS_END(c) - szString.replace(szToreplace,szNewstr); + szString.tqreplace(szTotqreplace,szNewstr); c->returnValue()->setString(szString); return true; } @@ -1038,10 +1038,10 @@ static bool str_kvs_fnc_replace(KviKvsModuleFunctionCall * c) @short: Replace substrings in a string ignoring case @syntax: - <string> $str.replacenocase(<string:string>,<newstr:string>,<toreplace:string>) + <string> $str.replacenocase(<string:string>,<newstr:string>,<totqreplace:string>) @description: This function returns a string created replacing all ocurrences of the third parameter - ('toreplace') in the string given as the first parameter ('string') with the string + ('totqreplace') in the string given as the first parameter ('string') with the string given as the second parameter ('newstr').[br] The replacement is case insensitive.[br] FIXME: The order of the parameters in this function is illogical (and probably incompatible @@ -1050,13 +1050,13 @@ static bool str_kvs_fnc_replace(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_replacenocase(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr,szToreplace; + TQString szString,szNewstr,szTotqreplace; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("newstr",KVS_PT_STRING,0,szNewstr) - KVSM_PARAMETER("toreplace",KVS_PT_STRING,0,szToreplace) + KVSM_PARAMETER("totqreplace",KVS_PT_STRING,0,szTotqreplace) KVSM_PARAMETERS_END(c) - szString.replace(szToreplace,szNewstr,false); + szString.tqreplace(szTotqreplace,szNewstr,false); c->returnValue()->setString(szString); return true; } @@ -1080,7 +1080,7 @@ static bool str_kvs_fnc_replacenocase(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_urlencode(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr; + TQString szString,szNewstr; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETERS_END(c) @@ -1090,12 +1090,12 @@ static bool str_kvs_fnc_urlencode(KviKvsModuleFunctionCall * c) /* for(int idx=0,idx<22,idx++) - szNewstr=szString.replace(toReplace[idx],newStr[idx],false); + szNewstr=szString.tqreplace(toReplace[idx],newStr[idx],false); */ int idx=0; while(idx<20){ - szNewstr=szString.replace(toReplace[idx],newStr[idx],false); + szNewstr=szString.tqreplace(toReplace[idx],newStr[idx],false); idx++; } @@ -1123,13 +1123,13 @@ static bool str_kvs_fnc_urlencode(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_lefttofirst(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr; + TQString szString,szNewstr; int where; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("substring",KVS_PT_STRING,0,szNewstr) KVSM_PARAMETERS_END(c) - where = szString.find(szNewstr,false); + where = szString.tqfind(szNewstr,false); if(where != -1) c->returnValue()->setString(szString.left(where)); else c->returnValue()->setString(szString); return true; @@ -1154,12 +1154,12 @@ static bool str_kvs_fnc_lefttofirst(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_lefttolast(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr; + TQString szString,szNewstr; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("substring",KVS_PT_STRING,0,szNewstr) KVSM_PARAMETERS_END(c) - int where = szString.findRev(szNewstr,-1,false); + int where = szString.tqfindRev(szNewstr,-1,false); if(where != -1) c->returnValue()->setString(szString.left(where)); else c->returnValue()->setString(szString); return true; @@ -1184,12 +1184,12 @@ static bool str_kvs_fnc_lefttolast(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_rightfromfirst(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr; + TQString szString,szNewstr; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("substring",KVS_PT_STRING,0,szNewstr) KVSM_PARAMETERS_END(c) - int idx = szString.find(szNewstr,false); + int idx = szString.tqfind(szNewstr,false); if(idx != -1) c->returnValue()->setString(szString.right(szString.length()-(idx+szNewstr.length()))); else c->returnValue()->setString(""); return true; @@ -1215,12 +1215,12 @@ static bool str_kvs_fnc_rightfromfirst(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_rightfromlast(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr; + TQString szString,szNewstr; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("substring",KVS_PT_STRING,0,szNewstr) KVSM_PARAMETERS_END(c) - int idx = szString.findRev(szNewstr,-1,false); + int idx = szString.tqfindRev(szNewstr,-1,false); if(idx != -1) c->returnValue()->setString(szString.right(szString.length()-(idx+szNewstr.length()))); else c->returnValue()->setString(""); return true; @@ -1259,15 +1259,15 @@ static bool str_kvs_fnc_rightfromlast(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_match(KviKvsModuleFunctionCall * c) { - QString szWildcard,szString,szFlags; + TQString szWildcard,szString,szFlags; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("wildcard",KVS_PT_NONEMPTYSTRING,0,szWildcard) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) KVSM_PARAMETERS_END(c) - bool bRegExp = (szFlags.find(QChar('r')) != -1) || (szFlags.find(QChar('R')) != -1); - bool bExact = (szFlags.find(QChar('e')) != -1) || (szFlags.find(QChar('E')) != -1); - c->returnValue()->setBoolean(KviQString::matchStringCS(szWildcard,szString,bRegExp,bExact)); + bool bRegExp = (szFlags.tqfind(TQChar('r')) != -1) || (szFlags.tqfind(TQChar('R')) != -1); + bool bExact = (szFlags.tqfind(TQChar('e')) != -1) || (szFlags.tqfind(TQChar('E')) != -1); + c->returnValue()->setBoolean(KviTQString::matchStringCS(szWildcard,szString,bRegExp,bExact)); return true; } @@ -1305,15 +1305,15 @@ static bool str_kvs_fnc_match(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_matchnocase(KviKvsModuleFunctionCall * c) { - QString szWildcard,szString,szFlags; + TQString szWildcard,szString,szFlags; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("wildcard",KVS_PT_NONEMPTYSTRING,0,szWildcard) KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) KVSM_PARAMETERS_END(c) - bool bRegExp = (szFlags.find(QChar('r')) != -1) || (szFlags.find(QChar('R')) != -1); - bool bExact = (szFlags.find(QChar('e')) != -1) || (szFlags.find(QChar('E')) != -1); - c->returnValue()->setBoolean(KviQString::matchStringCI(szWildcard,szString,bRegExp,bExact)); + bool bRegExp = (szFlags.tqfind(TQChar('r')) != -1) || (szFlags.tqfind(TQChar('R')) != -1); + bool bExact = (szFlags.tqfind(TQChar('e')) != -1) || (szFlags.tqfind(TQChar('E')) != -1); + c->returnValue()->setBoolean(KviTQString::matchStringCI(szWildcard,szString,bRegExp,bExact)); return true; } @@ -1348,7 +1348,7 @@ static bool str_kvs_fnc_matchnocase(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_word(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; kvs_int_t iOccurence; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("occurence",KVS_PT_INT,0,iOccurence) @@ -1360,17 +1360,17 @@ static bool str_kvs_fnc_word(KviKvsModuleFunctionCall * c) int len = szString.length(); while (idx<len) { - QChar szTmp = szString[idx].unicode(); + TQChar szTmp = szString[idx].tqunicode(); while (szTmp.isSpace()) { idx++; - szTmp = szString[idx].unicode(); + szTmp = szString[idx].tqunicode(); } begin = idx; while (idx<len && !szTmp.isSpace()) { idx++; - szTmp = szString[idx].unicode(); + szTmp = szString[idx].tqunicode(); } if (iOccurence == (kvs_int_t)cnt) { @@ -1414,7 +1414,7 @@ static bool str_kvs_fnc_word(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_token(KviKvsModuleFunctionCall * c) { - QString szString,sep; + TQString szString,sep; kvs_uint_t n; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("n",KVS_PT_UINT,0,n) @@ -1433,18 +1433,18 @@ static bool str_kvs_fnc_token(KviKvsModuleFunctionCall * c) int len = szString.length(); while (idx<len) { - QChar szTmp = szString[idx].unicode(); + TQChar szTmp = szString[idx].tqunicode(); // while (szTmp==sep) - while (sep.contains(szTmp)) + while (sep.tqcontains(szTmp)) { idx++; - szTmp = szString[idx].unicode(); + szTmp = szString[idx].tqunicode(); } begin = idx; - while (idx<len && !sep.contains(szTmp)) + while (idx<len && !sep.tqcontains(szTmp)) { idx++; - szTmp = szString[idx].unicode(); + szTmp = szString[idx].tqunicode(); } if (n == cnt) { @@ -1476,7 +1476,7 @@ static bool str_kvs_fnc_token(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_charsum(KviKvsModuleFunctionCall * c) { - QString szString; + TQString szString; bool bCaseInsensitive; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) @@ -1489,13 +1489,13 @@ static bool str_kvs_fnc_charsum(KviKvsModuleFunctionCall * c) { while(idx < len) { - sum += szString[idx].lower().unicode(); + sum += szString[idx].lower().tqunicode(); idx++; } } else { while(idx < len) { - sum += szString[idx].unicode(); + sum += szString[idx].tqunicode(); idx++; } } @@ -1524,7 +1524,7 @@ static bool str_kvs_fnc_charsum(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_digest(KviKvsModuleFunctionCall * c) { #ifdef COMPILE_SSL_SUPPORT - QString szString,szType,szResult; + TQString szString,szType,szResult; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("data",KVS_PT_NONEMPTYSTRING,0,szString) KVSM_PARAMETER("algorythm",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szType) @@ -1590,17 +1590,17 @@ static bool str_kvs_fnc_digest(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_join(KviKvsModuleFunctionCall * c) { - QString szSep; + TQString szSep; KviKvsArrayCast ac; - QString szFlags; + TQString szFlags; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("separator",KVS_PT_STRING,0,szSep) KVSM_PARAMETER("data",KVS_PT_ARRAYCAST,0,ac) KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) KVSM_PARAMETERS_END(c) - QString szRet; - bool bSkipEmpty = szFlags.find('n',0,false) != -1; + TQString szRet; + bool bSkipEmpty = szFlags.tqfind('n',0,false) != -1; bool bFirst = true; @@ -1613,7 +1613,7 @@ static bool str_kvs_fnc_join(KviKvsModuleFunctionCall * c) KviKvsVariant * v = a->at(uIdx); if(v) { - QString tmp; + TQString tmp; v->asString(tmp); if(bFirst) { @@ -1681,7 +1681,7 @@ static bool str_kvs_fnc_join(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) { KviKvsArrayCast ac; - QString szMatch,szFlags; + TQString szMatch,szFlags; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("match",KVS_PT_STRING,0,szMatch) KVSM_PARAMETER("strings",KVS_PT_ARRAYCAST,0,ac) @@ -1693,22 +1693,22 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) KviKvsArray * a = ac.array(); - bool bCaseSensitive = szFlags.find('s',0,false) != -1; - bool bRegexp = szFlags.find('r',0,false) != -1; - bool bWild = szFlags.find('w',0,false) != -1; + bool bCaseSensitive = szFlags.tqfind('s',0,false) != -1; + bool bRegexp = szFlags.tqfind('r',0,false) != -1; + bool bWild = szFlags.tqfind('w',0,false) != -1; int idx = 0; int cnt = a->size(); int i = 0; if(bRegexp || bWild) { - QRegExp re(szMatch,bCaseSensitive,bWild); + TQRegExp re(szMatch,bCaseSensitive,bWild); while(idx < cnt) { KviKvsVariant * v = a->at(idx); if(v) { - QString sz; + TQString sz; v->asString(sz); if(re.search(sz) != -1) { @@ -1724,9 +1724,9 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) KviKvsVariant * v = a->at(idx); if(v) { - QString sz; + TQString sz; v->asString(sz); - if(sz.find(szMatch,0,bCaseSensitive) != -1) + if(sz.tqfind(szMatch,0,bCaseSensitive) != -1) { n->set(i,new KviKvsVariant(sz)); i++; @@ -1790,7 +1790,7 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) { - QString szSep,szStr,szFla; + TQString szSep,szStr,szFla; kvs_int_t iMaxItems; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("separator",KVS_PT_STRING,0,szSep) @@ -1812,10 +1812,10 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) if(iMaxItems == 0)return true; - bool bWild = szFla.find('w',0,false) != -1; - bool bContainsR = szFla.find('r',0,false) != -1; - bool bCaseSensitive = szFla.find('s',0,false) != -1; - bool bNoEmpty = szFla.find('n',0,false) != -1; + bool bWild = szFla.tqfind('w',0,false) != -1; + bool bContainsR = szFla.tqfind('r',0,false) != -1; + bool bCaseSensitive = szFla.tqfind('s',0,false) != -1; + bool bNoEmpty = szFla.tqfind('n',0,false) != -1; int id = 0; @@ -1825,7 +1825,7 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) if(bContainsR || bWild) { - QRegExp re(szSep,bCaseSensitive,bWild); + TQRegExp re(szSep,bCaseSensitive,bWild); while((iMatch != -1) && (iMatch < iStrLen) && ((id < (iMaxItems-1)) || (iMaxItems < 0))) { @@ -1835,7 +1835,7 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) int len = re.matchedLength(); if((len == 0) && (iBegin == iMatch))iMatch++; // safety measure for empty string matching - QString tmp = szStr.mid(iBegin,iMatch - iBegin); + TQString tmp = szStr.mid(iBegin,iMatch - iBegin); if(bNoEmpty) { if(!tmp.isEmpty()) @@ -1855,10 +1855,10 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) } else { while((iMatch != -1) && (iMatch < iStrLen) && ((id < (iMaxItems-1)) || (iMaxItems < 0))) { - iMatch = szStr.find(szSep,iBegin,bCaseSensitive); + iMatch = szStr.tqfind(szSep,iBegin,bCaseSensitive); if(iMatch != -1) { - QString tmp = szStr.mid(iBegin,iMatch - iBegin); + TQString tmp = szStr.mid(iBegin,iMatch - iBegin); if(bNoEmpty) { if(!tmp.isEmpty()) @@ -1879,7 +1879,7 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) if(iBegin < iStrLen) { - QString tmpx = szStr.right(iStrLen-iBegin); + TQString tmpx = szStr.right(iStrLen-iBegin); if(bNoEmpty) { if(!tmpx.isEmpty()) @@ -1889,7 +1889,7 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) } } else { if(!bNoEmpty) - a->set(id,new KviKvsVariant(QString::null)); // empty string at the end + a->set(id,new KviKvsVariant(TQString())); // empty string at the end } return true; @@ -1942,14 +1942,14 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) { - QString szFormat; + TQString szFormat; KviKvsVariantList vArgs; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("format",KVS_PT_STRING,0,szFormat) KVSM_PARAMETER("vArgs",KVS_PT_VARIANTLIST,0,vArgs) KVSM_PARAMETERS_END(c) - QString s; + TQString s; #define MEMINCREMENT 32 @@ -1958,12 +1958,12 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) //s.setLength(allocsize); - const QChar * fmt = KviQString::nullTerminatedArray(szFormat); + const TQChar * fmt = KviTQString::nullTerminatedArray(szFormat); if(fmt) { - QChar * buffer = (QChar *)kvi_malloc(sizeof(QChar) * allocsize); - //QChar * p = (QChar *)s.unicode(); + TQChar * buffer = (TQChar *)kvi_malloc(sizeof(TQChar) * allocsize); + //TQChar * p = (TQChar *)s.tqunicode(); //9999999999999999999999999999999\0 char numberBuffer[1024]; @@ -1973,19 +1973,19 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) kvs_uint_t argUValue; kvs_real_t argRValue; - QChar * p = buffer; + TQChar * p = buffer; #define INCREMENT_MEM \ { \ allocsize += MEMINCREMENT; \ - buffer = (QChar *)kvi_realloc(buffer,sizeof(QChar) * allocsize); \ + buffer = (TQChar *)kvi_realloc(buffer,sizeof(TQChar) * allocsize); \ p = buffer + reallen; \ } #define INCREMENT_MEM_BY(numchars) \ { \ allocsize += numchars + MEMINCREMENT; \ - buffer = (QChar *)kvi_realloc(buffer,sizeof(QChar) * allocsize); \ + buffer = (TQChar *)kvi_realloc(buffer,sizeof(TQChar) * allocsize); \ p = buffer + reallen; \ } @@ -1993,12 +1993,12 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) pVar = vArgs.first(); - for(; fmt->unicode() ; ++fmt) + for(; fmt->tqunicode() ; ++fmt) { if(reallen == allocsize)INCREMENT_MEM //copy up to a '?' - if(fmt->unicode() != '?') + if(fmt->tqunicode() != '?') { *p++ = *fmt; reallen++; @@ -2006,16 +2006,16 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) } ++fmt; //skip this '?' - switch(fmt->unicode()) + switch(fmt->tqunicode()) { case 's': { - QString sz; + TQString sz; if(pVar)pVar->asString(sz); if(sz.isEmpty())continue; int len = sz.length(); if((allocsize - reallen) < len)INCREMENT_MEM_BY(len) - const QChar * ch = sz.unicode(); + const TQChar * ch = sz.tqunicode(); while(len--)*p++ = *ch++; reallen += sz.length(); pVar = vArgs.next(); @@ -2052,7 +2052,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) //copy now.... argUValue = pNumBuf - numberBuffer; //length of the number string if((allocsize - reallen) < (int)argUValue)INCREMENT_MEM_BY(argUValue) - do { *p++ = QChar(*--pNumBuf); } while(pNumBuf != numberBuffer); + do { *p++ = TQChar(*--pNumBuf); } while(pNumBuf != numberBuffer); reallen += argUValue; pVar = vArgs.next(); continue; @@ -2149,7 +2149,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) } case '?': { - if(fmt->unicode()) + if(fmt->tqunicode()) { if(reallen == allocsize)INCREMENT_MEM *p++ = *fmt; @@ -2161,7 +2161,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) case '.': { // precision mark - const QChar * save = fmt; + const TQChar * save = fmt; fmt++; unsigned int uPrecision = 0; @@ -2171,15 +2171,15 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) int idx = 2; - while((fmt->unicode() >= '0') && (fmt->unicode() <= '9') && (idx < 6)) + while((fmt->tqunicode() >= '0') && (fmt->tqunicode() <= '9') && (idx < 6)) { uPrecision *= 10; - fmtbuffer[idx] = fmt->unicode(); + fmtbuffer[idx] = fmt->tqunicode(); uPrecision += fmtbuffer[idx] - '0'; fmt++; idx++; } - fmtbuffer[idx] = fmt->unicode(); + fmtbuffer[idx] = fmt->tqunicode(); fmtbuffer[idx+1] = 0; if(pVar) @@ -2193,7 +2193,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) c->warning(__tr2qs("Missing argument for a floating point escape sequence, 0.0 assumed")); argRValue = 0; } - switch(fmt->unicode()) + switch(fmt->tqunicode()) { case 'e': case 'E': @@ -2212,7 +2212,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) fmt = save; *p++ = '?'; //write it reallen++; - if(fmt->unicode()) + if(fmt->tqunicode()) { if(reallen == allocsize)INCREMENT_MEM *p++ = *fmt; @@ -2228,7 +2228,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) { *p++ = '?'; //write it reallen++; - if(fmt->unicode()) + if(fmt->tqunicode()) { if(reallen == allocsize)INCREMENT_MEM *p++ = *fmt; @@ -2270,13 +2270,13 @@ static bool str_module_init(KviModule * m) KVSM_REGISTER_FUNCTION(m,"localelowcase",str_kvs_fnc_localelowcase); KVSM_REGISTER_FUNCTION(m,"isnumber",str_kvs_fnc_isnumber); KVSM_REGISTER_FUNCTION(m,"isunsignednumber",str_kvs_fnc_isunsignednumber); - KVSM_REGISTER_FUNCTION(m,"contains",str_kvs_fnc_contains); + KVSM_REGISTER_FUNCTION(m,"tqcontains",str_kvs_fnc_tqcontains); KVSM_REGISTER_FUNCTION(m,"containsnocase",str_kvs_fnc_containsnocase); KVSM_REGISTER_FUNCTION(m,"equal",str_kvs_fnc_equal); KVSM_REGISTER_FUNCTION(m,"equalnocase",str_kvs_fnc_equalnocase); KVSM_REGISTER_FUNCTION(m,"cmp",str_kvs_fnc_cmp); KVSM_REGISTER_FUNCTION(m,"cmpnocase",str_kvs_fnc_cmpnocase); - KVSM_REGISTER_FUNCTION(m,"find",str_kvs_fnc_find); + KVSM_REGISTER_FUNCTION(m,"tqfind",str_kvs_fnc_tqfind); KVSM_REGISTER_FUNCTION(m,"findfirst",str_kvs_fnc_findfirst); KVSM_REGISTER_FUNCTION(m,"findfirstnocase",str_kvs_fnc_findfirstnocase); KVSM_REGISTER_FUNCTION(m,"findlast",str_kvs_fnc_findlast); @@ -2291,7 +2291,7 @@ static bool str_module_init(KviModule * m) KVSM_REGISTER_FUNCTION(m,"stripright",str_kvs_fnc_stripright); KVSM_REGISTER_FUNCTION(m,"stripleft",str_kvs_fnc_stripleft); KVSM_REGISTER_FUNCTION(m,"stripcolors",str_kvs_fnc_stripcolors); - KVSM_REGISTER_FUNCTION(m,"replace",str_kvs_fnc_replace); + KVSM_REGISTER_FUNCTION(m,"tqreplace",str_kvs_fnc_tqreplace); KVSM_REGISTER_FUNCTION(m,"replacenocase",str_kvs_fnc_replacenocase); KVSM_REGISTER_FUNCTION(m,"urlencode",str_kvs_fnc_urlencode); KVSM_REGISTER_FUNCTION(m,"lefttolast",str_kvs_fnc_lefttolast); |