@ -377,15 +377,15 @@ static bool str_kvs_fnc_isempty(KviKvsModuleFunctionCall * c)
}
}
/*
/*
@ doc : str . tq contains
@ doc : str . contains
@ type :
@ type :
function
function
@ title :
@ title :
$ str . tq contains
$ str . contains
@ short :
@ short :
Returns 1 if the first parameter contains the second
Returns 1 if the first parameter contains the second
@ syntax :
@ syntax :
< bool > $ str . tq contains( < container : string > , < to tq find: string > )
< bool > $ str . contains( < container : string > , < to find: string > )
@ description :
@ description :
Returns 1 if the first string parameter contains the second string parameter .
Returns 1 if the first string parameter contains the second string parameter .
This function is case sensitive .
This function is case sensitive .
@ -394,15 +394,15 @@ static bool str_kvs_fnc_isempty(KviKvsModuleFunctionCall * c)
*/
*/
static bool str_kvs_fnc_ tq contains( KviKvsModuleFunctionCall * c )
static bool str_kvs_fnc_ contains( KviKvsModuleFunctionCall * c )
{
{
TQString szString , szSubString ;
TQString szString , szSubString ;
bool bIs ;
bool bIs ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " container " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " container " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " to tq find" , KVS_PT_STRING , 0 , szSubString )
KVSM_PARAMETER ( " to find" , KVS_PT_STRING , 0 , szSubString )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
bIs = szString . tq find( szSubString ) ! = - 1 ;
bIs = szString . find( szSubString ) ! = - 1 ;
c - > returnValue ( ) - > setBoolean ( bIs ) ;
c - > returnValue ( ) - > setBoolean ( bIs ) ;
return true ;
return true ;
}
}
@ -416,12 +416,12 @@ static bool str_kvs_fnc_tqcontains(KviKvsModuleFunctionCall * c)
@ short :
@ short :
Returns 1 if the first parameter contains the second , case insensitive
Returns 1 if the first parameter contains the second , case insensitive
@ syntax :
@ syntax :
< bool > $ str . containsnocase ( < container : string > , < to tq find: string > )
< bool > $ str . containsnocase ( < container : string > , < to find: string > )
@ description :
@ description :
Returns 1 if the first string parameter contains the second string parameter
Returns 1 if the first string parameter contains the second string parameter
whithout taking in consideration the case of the characters in the string .
whithout taking in consideration the case of the characters in the string .
@ seealso :
@ seealso :
[ fnc ] $ str . tq contains[ / fnc ]
[ fnc ] $ str . contains[ / fnc ]
*/
*/
static bool str_kvs_fnc_containsnocase ( KviKvsModuleFunctionCall * c )
static bool str_kvs_fnc_containsnocase ( KviKvsModuleFunctionCall * c )
@ -430,9 +430,9 @@ static bool str_kvs_fnc_containsnocase(KviKvsModuleFunctionCall * c)
bool bIs ;
bool bIs ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " container " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " container " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " to tq find" , KVS_PT_STRING , 0 , szSubString )
KVSM_PARAMETER ( " to find" , KVS_PT_STRING , 0 , szSubString )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
bIs = szString . tq find( szSubString , 0 , false ) ! = - 1 ;
bIs = szString . find( szSubString , 0 , false ) ! = - 1 ;
c - > returnValue ( ) - > setBoolean ( bIs ) ;
c - > returnValue ( ) - > setBoolean ( bIs ) ;
return true ;
return true ;
}
}
@ -557,15 +557,15 @@ static bool str_kvs_fnc_cmpnocase(KviKvsModuleFunctionCall * c)
}
}
/*
/*
@ doc : str . tq find
@ doc : str . find
@ type :
@ type :
function
function
@ title :
@ title :
$ str . tq find
$ str . find
@ short :
@ short :
Find the index of the nth ocurrence of a substring in a string
Find the index of the nth ocurrence of a substring in a string
@ syntax :
@ syntax :
< int > $ str . tq find( < findIn : string > , < to tq find: string > [ , ocurrence : int ] )
< int > $ str . find( < findIn : string > , < to find: string > [ , ocurrence : int ] )
@ description :
@ description :
This function search in the string given as the first parameter for the string
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
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 : (
FIXME : The semantics of this function are totally broken : (
*/
*/
static bool str_kvs_fnc_ tq find( KviKvsModuleFunctionCall * c )
static bool str_kvs_fnc_ find( KviKvsModuleFunctionCall * c )
{
{
TQString szFindIn , szToFind ;
TQString szFindIn , szToFind ;
kvs_int_t iOcurence ;
kvs_int_t iOcurence ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szFindIn )
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szFindIn )
KVSM_PARAMETER ( " to tq find" , KVS_PT_STRING , 0 , szToFind )
KVSM_PARAMETER ( " to find" , KVS_PT_STRING , 0 , szToFind )
KVSM_PARAMETER ( " ocurrence " , KVS_PT_INTEGER , KVS_PF_OPTIONAL , iOcurence )
KVSM_PARAMETER ( " ocurrence " , KVS_PT_INTEGER , KVS_PF_OPTIONAL , iOcurence )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
int pos = 1 ;
int pos = 1 ;
@ -609,7 +609,7 @@ static bool str_kvs_fnc_tqfind(KviKvsModuleFunctionCall * c)
while ( cnt < = pos )
while ( cnt < = pos )
{
{
idx = szFindIn . right ( szFindIn . length ( ) - totalIdx ) . tq find( szToFind ) ;
idx = szFindIn . right ( szFindIn . length ( ) - totalIdx ) . find( szToFind ) ;
if ( idx = = - 1 )
if ( idx = = - 1 )
{
{
c - > returnValue ( ) - > setInteger ( - 1 ) ;
c - > returnValue ( ) - > setInteger ( - 1 ) ;
@ -646,7 +646,7 @@ static bool str_kvs_fnc_findfirst(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " toFind " , KVS_PT_STRING , 0 , szString2 )
KVSM_PARAMETER ( " toFind " , KVS_PT_STRING , 0 , szString2 )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
c - > returnValue ( ) - > setInteger ( szString . tq find( szString2 ) ) ;
c - > returnValue ( ) - > setInteger ( szString . find( szString2 ) ) ;
return true ;
return true ;
}
}
/*
/*
@ -672,7 +672,7 @@ static bool str_kvs_fnc_findfirstnocase(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " toFind " , KVS_PT_STRING , 0 , szString2 )
KVSM_PARAMETER ( " toFind " , KVS_PT_STRING , 0 , szString2 )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
c - > returnValue ( ) - > setInteger ( szString . tq find( szString2 , 0 , false ) ) ;
c - > returnValue ( ) - > setInteger ( szString . find( szString2 , 0 , false ) ) ;
return true ;
return true ;
}
}
/*
/*
@ -698,7 +698,7 @@ static bool str_kvs_fnc_findlast(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " toFind " , KVS_PT_STRING , 0 , szString2 )
KVSM_PARAMETER ( " toFind " , KVS_PT_STRING , 0 , szString2 )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
c - > returnValue ( ) - > setInteger ( szString . tq findRev( szString2 ) ) ;
c - > returnValue ( ) - > setInteger ( szString . findRev( szString2 ) ) ;
return true ;
return true ;
}
}
/*
/*
@ -724,7 +724,7 @@ static bool str_kvs_fnc_findlastnocase(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " findIn " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " toFind " , KVS_PT_STRING , 0 , szString2 )
KVSM_PARAMETER ( " toFind " , KVS_PT_STRING , 0 , szString2 )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
c - > returnValue ( ) - > setInteger ( szString . tq findRev( szString2 , - 1 , false ) ) ;
c - > returnValue ( ) - > setInteger ( szString . findRev( szString2 , - 1 , false ) ) ;
return true ;
return true ;
}
}
/*
/*
@ -994,37 +994,37 @@ static bool str_kvs_fnc_stripcolors(KviKvsModuleFunctionCall * c)
}
}
/*
/*
@ doc : str . tq replace
@ doc : str . replace
@ type :
@ type :
function
function
@ title :
@ title :
$ str . tq replace
$ str . replace
@ short :
@ short :
Replace substrings in a string
Replace substrings in a string
@ syntax :
@ syntax :
< string > $ str . tq replace( < string : string > , < replacewith : string > , < to tq replace: string > )
< string > $ str . replace( < string : string > , < replacewith : string > , < to replace: string > )
@ description :
@ description :
This function returns a string created replacing all ocurrences of the third parameter
This function returns a string created replacing all ocurrences of the third parameter
( ' to tq replace' ) in the string given as the first parameter ( ' string ' ) with the string
( ' to replace' ) in the string given as the first parameter ( ' string ' ) with the string
given as the second parameter ( ' replacewith ' ) .
given as the second parameter ( ' replacewith ' ) .
The string replacement is case sensitive ! .
The string replacement is case sensitive ! .
FIXME : The order of the parameters in this function is illogical ( and probably incompatible
FIXME : The order of the parameters in this function is illogical ( and probably incompatible
with any other scripting language ) : D
with any other scripting language ) : D
@ examples :
@ examples :
[ example ]
[ example ]
echo $ str . tq replace( " I like big networks " , " neural " , " big " )
echo $ str . replace( " I like big networks " , " neural " , " big " )
[ / example ]
[ / example ]
*/
*/
static bool str_kvs_fnc_ tq replace( KviKvsModuleFunctionCall * c )
static bool str_kvs_fnc_ replace( KviKvsModuleFunctionCall * c )
{
{
TQString szString , szNewstr , szTo tq replace;
TQString szString , szNewstr , szTo replace;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " newstr " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETER ( " newstr " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETER ( " to tq replace" , KVS_PT_STRING , 0 , szTo tq replace)
KVSM_PARAMETER ( " to replace" , KVS_PT_STRING , 0 , szTo replace)
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
szString . tq replace( szTo tq replace, szNewstr ) ;
szString . replace( szTo replace, szNewstr ) ;
c - > returnValue ( ) - > setString ( szString ) ;
c - > returnValue ( ) - > setString ( szString ) ;
return true ;
return true ;
}
}
@ -1038,10 +1038,10 @@ static bool str_kvs_fnc_tqreplace(KviKvsModuleFunctionCall * c)
@ short :
@ short :
Replace substrings in a string ignoring case
Replace substrings in a string ignoring case
@ syntax :
@ syntax :
< string > $ str . replacenocase ( < string : string > , < newstr : string > , < to tq replace: string > )
< string > $ str . replacenocase ( < string : string > , < newstr : string > , < to replace: string > )
@ description :
@ description :
This function returns a string created replacing all ocurrences of the third parameter
This function returns a string created replacing all ocurrences of the third parameter
( ' to tq replace' ) in the string given as the first parameter ( ' string ' ) with the string
( ' to replace' ) in the string given as the first parameter ( ' string ' ) with the string
given as the second parameter ( ' newstr ' ) . [ br ]
given as the second parameter ( ' newstr ' ) . [ br ]
The replacement is case insensitive . [ br ]
The replacement is case insensitive . [ br ]
FIXME : The order of the parameters in this function is illogical ( and probably incompatible
FIXME : The order of the parameters in this function is illogical ( and probably incompatible
@ -1050,13 +1050,13 @@ static bool str_kvs_fnc_tqreplace(KviKvsModuleFunctionCall * c)
static bool str_kvs_fnc_replacenocase ( KviKvsModuleFunctionCall * c )
static bool str_kvs_fnc_replacenocase ( KviKvsModuleFunctionCall * c )
{
{
TQString szString , szNewstr , szTo tq replace;
TQString szString , szNewstr , szTo replace;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " newstr " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETER ( " newstr " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETER ( " to tq replace" , KVS_PT_STRING , 0 , szTo tq replace)
KVSM_PARAMETER ( " to replace" , KVS_PT_STRING , 0 , szTo replace)
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
szString . tq replace( szTo tq replace, szNewstr , false ) ;
szString . replace( szTo replace, szNewstr , false ) ;
c - > returnValue ( ) - > setString ( szString ) ;
c - > returnValue ( ) - > setString ( szString ) ;
return true ;
return true ;
}
}
@ -1090,12 +1090,12 @@ static bool str_kvs_fnc_urlencode(KviKvsModuleFunctionCall * c)
/*
/*
for ( int idx = 0 , idx < 22 , idx + + )
for ( int idx = 0 , idx < 22 , idx + + )
szNewstr = szString . tq replace( toReplace [ idx ] , newStr [ idx ] , false ) ;
szNewstr = szString . replace( toReplace [ idx ] , newStr [ idx ] , false ) ;
*/
*/
int idx = 0 ;
int idx = 0 ;
while ( idx < 20 ) {
while ( idx < 20 ) {
szNewstr = szString . tq replace( toReplace [ idx ] , newStr [ idx ] , false ) ;
szNewstr = szString . replace( toReplace [ idx ] , newStr [ idx ] , false ) ;
idx + + ;
idx + + ;
}
}
@ -1129,7 +1129,7 @@ static bool str_kvs_fnc_lefttofirst(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " substring " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETER ( " substring " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
where = szString . tq find( szNewstr , false ) ;
where = szString . find( szNewstr , false ) ;
if ( where ! = - 1 ) c - > returnValue ( ) - > setString ( szString . left ( where ) ) ;
if ( where ! = - 1 ) c - > returnValue ( ) - > setString ( szString . left ( where ) ) ;
else c - > returnValue ( ) - > setString ( szString ) ;
else c - > returnValue ( ) - > setString ( szString ) ;
return true ;
return true ;
@ -1159,7 +1159,7 @@ static bool str_kvs_fnc_lefttolast(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " substring " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETER ( " substring " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
int where = szString . tq findRev( szNewstr , - 1 , false ) ;
int where = szString . findRev( szNewstr , - 1 , false ) ;
if ( where ! = - 1 ) c - > returnValue ( ) - > setString ( szString . left ( where ) ) ;
if ( where ! = - 1 ) c - > returnValue ( ) - > setString ( szString . left ( where ) ) ;
else c - > returnValue ( ) - > setString ( szString ) ;
else c - > returnValue ( ) - > setString ( szString ) ;
return true ;
return true ;
@ -1189,7 +1189,7 @@ static bool str_kvs_fnc_rightfromfirst(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " substring " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETER ( " substring " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
int idx = szString . tq find( szNewstr , false ) ;
int idx = szString . find( szNewstr , false ) ;
if ( idx ! = - 1 ) c - > returnValue ( ) - > setString ( szString . right ( szString . length ( ) - ( idx + szNewstr . length ( ) ) ) ) ;
if ( idx ! = - 1 ) c - > returnValue ( ) - > setString ( szString . right ( szString . length ( ) - ( idx + szNewstr . length ( ) ) ) ) ;
else c - > returnValue ( ) - > setString ( " " ) ;
else c - > returnValue ( ) - > setString ( " " ) ;
return true ;
return true ;
@ -1220,7 +1220,7 @@ static bool str_kvs_fnc_rightfromlast(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " substring " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETER ( " substring " , KVS_PT_STRING , 0 , szNewstr )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
int idx = szString . tq findRev( szNewstr , - 1 , false ) ;
int idx = szString . findRev( szNewstr , - 1 , false ) ;
if ( idx ! = - 1 ) c - > returnValue ( ) - > setString ( szString . right ( szString . length ( ) - ( idx + szNewstr . length ( ) ) ) ) ;
if ( idx ! = - 1 ) c - > returnValue ( ) - > setString ( szString . right ( szString . length ( ) - ( idx + szNewstr . length ( ) ) ) ) ;
else c - > returnValue ( ) - > setString ( " " ) ;
else c - > returnValue ( ) - > setString ( " " ) ;
return true ;
return true ;
@ -1265,8 +1265,8 @@ static bool str_kvs_fnc_match(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " flags " , KVS_PT_STRING , KVS_PF_OPTIONAL , szFlags )
KVSM_PARAMETER ( " flags " , KVS_PT_STRING , KVS_PF_OPTIONAL , szFlags )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
bool bRegExp = ( szFlags . tq find( TQChar ( ' r ' ) ) ! = - 1 ) | | ( szFlags . tq find( TQChar ( ' R ' ) ) ! = - 1 ) ;
bool bRegExp = ( szFlags . find( TQChar ( ' r ' ) ) ! = - 1 ) | | ( szFlags . find( TQChar ( ' R ' ) ) ! = - 1 ) ;
bool bExact = ( szFlags . tq find( TQChar ( ' e ' ) ) ! = - 1 ) | | ( szFlags . tq find( TQChar ( ' E ' ) ) ! = - 1 ) ;
bool bExact = ( szFlags . find( TQChar ( ' e ' ) ) ! = - 1 ) | | ( szFlags . find( TQChar ( ' E ' ) ) ! = - 1 ) ;
c - > returnValue ( ) - > setBoolean ( KviTQString : : matchStringCS ( szWildcard , szString , bRegExp , bExact ) ) ;
c - > returnValue ( ) - > setBoolean ( KviTQString : : matchStringCS ( szWildcard , szString , bRegExp , bExact ) ) ;
return true ;
return true ;
}
}
@ -1311,8 +1311,8 @@ static bool str_kvs_fnc_matchnocase(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " string " , KVS_PT_STRING , 0 , szString )
KVSM_PARAMETER ( " flags " , KVS_PT_STRING , KVS_PF_OPTIONAL , szFlags )
KVSM_PARAMETER ( " flags " , KVS_PT_STRING , KVS_PF_OPTIONAL , szFlags )
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
bool bRegExp = ( szFlags . tq find( TQChar ( ' r ' ) ) ! = - 1 ) | | ( szFlags . tq find( TQChar ( ' R ' ) ) ! = - 1 ) ;
bool bRegExp = ( szFlags . find( TQChar ( ' r ' ) ) ! = - 1 ) | | ( szFlags . find( TQChar ( ' R ' ) ) ! = - 1 ) ;
bool bExact = ( szFlags . tq find( TQChar ( ' e ' ) ) ! = - 1 ) | | ( szFlags . tq find( TQChar ( ' E ' ) ) ! = - 1 ) ;
bool bExact = ( szFlags . find( TQChar ( ' e ' ) ) ! = - 1 ) | | ( szFlags . find( TQChar ( ' E ' ) ) ! = - 1 ) ;
c - > returnValue ( ) - > setBoolean ( KviTQString : : matchStringCI ( szWildcard , szString , bRegExp , bExact ) ) ;
c - > returnValue ( ) - > setBoolean ( KviTQString : : matchStringCI ( szWildcard , szString , bRegExp , bExact ) ) ;
return true ;
return true ;
}
}
@ -1435,13 +1435,13 @@ static bool str_kvs_fnc_token(KviKvsModuleFunctionCall * c)
{
{
TQChar szTmp = szString [ idx ] . tqunicode ( ) ;
TQChar szTmp = szString [ idx ] . tqunicode ( ) ;
// while (szTmp==sep)
// while (szTmp==sep)
while ( sep . tq contains( szTmp ) )
while ( sep . contains( szTmp ) )
{
{
idx + + ;
idx + + ;
szTmp = szString [ idx ] . tqunicode ( ) ;
szTmp = szString [ idx ] . tqunicode ( ) ;
}
}
begin = idx ;
begin = idx ;
while ( idx < len & & ! sep . tq contains( szTmp ) )
while ( idx < len & & ! sep . contains( szTmp ) )
{
{
idx + + ;
idx + + ;
szTmp = szString [ idx ] . tqunicode ( ) ;
szTmp = szString [ idx ] . tqunicode ( ) ;
@ -1600,7 +1600,7 @@ static bool str_kvs_fnc_join(KviKvsModuleFunctionCall * c)
KVSM_PARAMETERS_END ( c )
KVSM_PARAMETERS_END ( c )
TQString szRet ;
TQString szRet ;
bool bSkipEmpty = szFlags . tq find( ' n ' , 0 , false ) ! = - 1 ;
bool bSkipEmpty = szFlags . find( ' n ' , 0 , false ) ! = - 1 ;
bool bFirst = true ;
bool bFirst = true ;
@ -1693,9 +1693,9 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c)
KviKvsArray * a = ac . array ( ) ;
KviKvsArray * a = ac . array ( ) ;
bool bCaseSensitive = szFlags . tq find( ' s ' , 0 , false ) ! = - 1 ;
bool bCaseSensitive = szFlags . find( ' s ' , 0 , false ) ! = - 1 ;
bool bRegexp = szFlags . tq find( ' r ' , 0 , false ) ! = - 1 ;
bool bRegexp = szFlags . find( ' r ' , 0 , false ) ! = - 1 ;
bool bWild = szFlags . tq find( ' w ' , 0 , false ) ! = - 1 ;
bool bWild = szFlags . find( ' w ' , 0 , false ) ! = - 1 ;
int idx = 0 ;
int idx = 0 ;
int cnt = a - > size ( ) ;
int cnt = a - > size ( ) ;
@ -1726,7 +1726,7 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c)
{
{
TQString sz ;
TQString sz ;
v - > asString ( sz ) ;
v - > asString ( sz ) ;
if ( sz . tq find( szMatch , 0 , bCaseSensitive ) ! = - 1 )
if ( sz . find( szMatch , 0 , bCaseSensitive ) ! = - 1 )
{
{
n - > set ( i , new KviKvsVariant ( sz ) ) ;
n - > set ( i , new KviKvsVariant ( sz ) ) ;
i + + ;
i + + ;
@ -1812,10 +1812,10 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c)
if ( iMaxItems = = 0 ) return true ;
if ( iMaxItems = = 0 ) return true ;
bool bWild = szFla . tq find( ' w ' , 0 , false ) ! = - 1 ;
bool bWild = szFla . find( ' w ' , 0 , false ) ! = - 1 ;
bool bContainsR = szFla . tq find( ' r ' , 0 , false ) ! = - 1 ;
bool bContainsR = szFla . find( ' r ' , 0 , false ) ! = - 1 ;
bool bCaseSensitive = szFla . tq find( ' s ' , 0 , false ) ! = - 1 ;
bool bCaseSensitive = szFla . find( ' s ' , 0 , false ) ! = - 1 ;
bool bNoEmpty = szFla . tq find( ' n ' , 0 , false ) ! = - 1 ;
bool bNoEmpty = szFla . find( ' n ' , 0 , false ) ! = - 1 ;
int id = 0 ;
int id = 0 ;
@ -1855,7 +1855,7 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c)
} else {
} else {
while ( ( iMatch ! = - 1 ) & & ( iMatch < iStrLen ) & & ( ( id < ( iMaxItems - 1 ) ) | | ( iMaxItems < 0 ) ) )
while ( ( iMatch ! = - 1 ) & & ( iMatch < iStrLen ) & & ( ( id < ( iMaxItems - 1 ) ) | | ( iMaxItems < 0 ) ) )
{
{
iMatch = szStr . tq find( szSep , iBegin , bCaseSensitive ) ;
iMatch = szStr . find( szSep , iBegin , bCaseSensitive ) ;
if ( iMatch ! = - 1 )
if ( iMatch ! = - 1 )
{
{
TQString tmp = szStr . mid ( iBegin , iMatch - iBegin ) ;
TQString tmp = szStr . mid ( iBegin , iMatch - iBegin ) ;
@ -2270,13 +2270,13 @@ static bool str_module_init(KviModule * m)
KVSM_REGISTER_FUNCTION ( m , " localelowcase " , str_kvs_fnc_localelowcase ) ;
KVSM_REGISTER_FUNCTION ( m , " localelowcase " , str_kvs_fnc_localelowcase ) ;
KVSM_REGISTER_FUNCTION ( m , " isnumber " , str_kvs_fnc_isnumber ) ;
KVSM_REGISTER_FUNCTION ( m , " isnumber " , str_kvs_fnc_isnumber ) ;
KVSM_REGISTER_FUNCTION ( m , " isunsignednumber " , str_kvs_fnc_isunsignednumber ) ;
KVSM_REGISTER_FUNCTION ( m , " isunsignednumber " , str_kvs_fnc_isunsignednumber ) ;
KVSM_REGISTER_FUNCTION ( m , " tq contains" , str_kvs_fnc_ tq contains) ;
KVSM_REGISTER_FUNCTION ( m , " contains" , str_kvs_fnc_ contains) ;
KVSM_REGISTER_FUNCTION ( m , " containsnocase " , str_kvs_fnc_containsnocase ) ;
KVSM_REGISTER_FUNCTION ( m , " containsnocase " , str_kvs_fnc_containsnocase ) ;
KVSM_REGISTER_FUNCTION ( m , " equal " , str_kvs_fnc_equal ) ;
KVSM_REGISTER_FUNCTION ( m , " equal " , str_kvs_fnc_equal ) ;
KVSM_REGISTER_FUNCTION ( m , " equalnocase " , str_kvs_fnc_equalnocase ) ;
KVSM_REGISTER_FUNCTION ( m , " equalnocase " , str_kvs_fnc_equalnocase ) ;
KVSM_REGISTER_FUNCTION ( m , " cmp " , str_kvs_fnc_cmp ) ;
KVSM_REGISTER_FUNCTION ( m , " cmp " , str_kvs_fnc_cmp ) ;
KVSM_REGISTER_FUNCTION ( m , " cmpnocase " , str_kvs_fnc_cmpnocase ) ;
KVSM_REGISTER_FUNCTION ( m , " cmpnocase " , str_kvs_fnc_cmpnocase ) ;
KVSM_REGISTER_FUNCTION ( m , " tq find" , str_kvs_fnc_ tq find) ;
KVSM_REGISTER_FUNCTION ( m , " find" , str_kvs_fnc_ find) ;
KVSM_REGISTER_FUNCTION ( m , " findfirst " , str_kvs_fnc_findfirst ) ;
KVSM_REGISTER_FUNCTION ( m , " findfirst " , str_kvs_fnc_findfirst ) ;
KVSM_REGISTER_FUNCTION ( m , " findfirstnocase " , str_kvs_fnc_findfirstnocase ) ;
KVSM_REGISTER_FUNCTION ( m , " findfirstnocase " , str_kvs_fnc_findfirstnocase ) ;
KVSM_REGISTER_FUNCTION ( m , " findlast " , str_kvs_fnc_findlast ) ;
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 , " stripright " , str_kvs_fnc_stripright ) ;
KVSM_REGISTER_FUNCTION ( m , " stripleft " , str_kvs_fnc_stripleft ) ;
KVSM_REGISTER_FUNCTION ( m , " stripleft " , str_kvs_fnc_stripleft ) ;
KVSM_REGISTER_FUNCTION ( m , " stripcolors " , str_kvs_fnc_stripcolors ) ;
KVSM_REGISTER_FUNCTION ( m , " stripcolors " , str_kvs_fnc_stripcolors ) ;
KVSM_REGISTER_FUNCTION ( m , " tq replace" , str_kvs_fnc_ tq replace) ;
KVSM_REGISTER_FUNCTION ( m , " replace" , str_kvs_fnc_ replace) ;
KVSM_REGISTER_FUNCTION ( m , " replacenocase " , str_kvs_fnc_replacenocase ) ;
KVSM_REGISTER_FUNCTION ( m , " replacenocase " , str_kvs_fnc_replacenocase ) ;
KVSM_REGISTER_FUNCTION ( m , " urlencode " , str_kvs_fnc_urlencode ) ;
KVSM_REGISTER_FUNCTION ( m , " urlencode " , str_kvs_fnc_urlencode ) ;
KVSM_REGISTER_FUNCTION ( m , " lefttolast " , str_kvs_fnc_lefttolast ) ;
KVSM_REGISTER_FUNCTION ( m , " lefttolast " , str_kvs_fnc_lefttolast ) ;