StrFunc 1.08 by deguix:
- Converted all the functions to LogicLib. - StrSort: Totally remade and it can break old scripts. See documentation for details. - Added defines: StrFunc_List, *_List and *_TypeList. - Fixed StrStrAdv: Variables $R0-$R3 couldn't be used on scripts before calling. - StrRep: Cut down some variables. - Arranged correctly the order of StrSort on the documentation. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3726 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
bfb170dba1
commit
280f1a2803
3 changed files with 1061 additions and 647 deletions
|
@ -117,6 +117,70 @@ ioerror:
|
||||||
strlocerror:
|
strlocerror:
|
||||||
DetailPrint "FAILED StrLoc test"
|
DetailPrint "FAILED StrLoc test"
|
||||||
|
|
||||||
|
# Test string replacement
|
||||||
|
${StrRep} $0 "This is just an example" "an" "one"
|
||||||
|
StrCmp $0 "This is just one example" 0 strreperror
|
||||||
|
${StrRep} $0 "test... test... 1 2 3..." "test" "testing"
|
||||||
|
StrCmp $0 "testing... testing... 1 2 3..." 0 strreperror
|
||||||
|
${StrRep} $0 "" "test" "testing"
|
||||||
|
StrCmp $0 "" 0 strreperror
|
||||||
|
${StrRep} $0 "test" "test" "testing"
|
||||||
|
StrCmp $0 "testing" 0 strreperror
|
||||||
|
${StrRep} $0 "test" "test" ""
|
||||||
|
StrCmp $0 "" 0 strreperror
|
||||||
|
${StrRep} $0 "test" "" "abc"
|
||||||
|
StrCmp $0 "test" 0 strreperror
|
||||||
|
${StrRep} $0 "test" "" ""
|
||||||
|
StrCmp $0 "test" 0 strreperror
|
||||||
|
DetailPrint "PASSED StrRep test"
|
||||||
|
Goto +2
|
||||||
|
strreperror:
|
||||||
|
DetailPrint "FAILED StrRep test"
|
||||||
|
|
||||||
|
# Test sorting
|
||||||
|
${StrSort} $0 "This is just an example" "" " just" "ple" "0" "0" "0"
|
||||||
|
StrCmp $0 "This is an exam" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "j" " " "0" "" "0"
|
||||||
|
StrCmp $0 "just" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" "" "j" "" "0" "1" "0"
|
||||||
|
StrCmp $0 "This is just an example" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "us" "" "0" "1" "0"
|
||||||
|
StrCmp $0 "just an example" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" "" "u" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "This is just" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "just" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "just" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "t" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "This" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "le" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "example" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "le" " " "1" "0" "0"
|
||||||
|
StrCmp $0 " examp" 0 strsorterror
|
||||||
|
${StrSort} $0 "an error has occured" " " "e" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "error" 0 strsorterror
|
||||||
|
${StrSort} $0 "" " " "something" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "j" " " "" "" ""
|
||||||
|
StrCmp $0 " just " 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "j" " " "1" "0" "1"
|
||||||
|
StrCmp $0 " ust " 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" "" "j" "" "0" "0" "1"
|
||||||
|
StrCmp $0 "This is ust an example" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "us" "" "1" "0" "0"
|
||||||
|
StrCmp $0 " jt an example" 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" "" "u" " " "0" "0" "1"
|
||||||
|
StrCmp $0 "This is jst " 0 strsorterror
|
||||||
|
${StrSort} $0 "This is just an example" " " "just" " " "1" "0" "1"
|
||||||
|
StrCmp $0 " " 0 strsorterror
|
||||||
|
${StrSort} $0 "an error has occured" " " "e" "h" "1" "0" "0"
|
||||||
|
StrCmp $0 " rror " 0 strsorterror
|
||||||
|
${StrSort} $0 "" " " "something" " " "1" "0" "1"
|
||||||
|
StrCmp $0 "" 0 strsorterror
|
||||||
|
DetailPrint "PASSED StrSort test"
|
||||||
|
Goto +2
|
||||||
|
strsorterror:
|
||||||
|
DetailPrint "FAILED StrSort test"
|
||||||
|
|
||||||
${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "g"
|
${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "g"
|
||||||
StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror
|
StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror
|
||||||
${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga"
|
${StrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga"
|
||||||
|
@ -150,7 +214,7 @@ strstrerror:
|
||||||
StrCmp $0 "" 0 strstradverror
|
StrCmp $0 "" 0 strstradverror
|
||||||
${StrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0"
|
${StrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0"
|
||||||
StrCmp $0 "abc" 0 strstradverror
|
StrCmp $0 "abc" 0 strstradverror
|
||||||
|
|
||||||
${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1"
|
${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1"
|
||||||
StrCmp $0 "abcabc" 0 strstradverror
|
StrCmp $0 "abcabc" 0 strstradverror
|
||||||
${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1"
|
${StrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1"
|
||||||
|
@ -176,82 +240,18 @@ strstrerror:
|
||||||
strstradverror:
|
strstradverror:
|
||||||
DetailPrint "FAILED StrStrAdv test"
|
DetailPrint "FAILED StrStrAdv test"
|
||||||
|
|
||||||
# Test string replacement
|
|
||||||
${StrRep} $0 "This is just an example" "an" "one"
|
|
||||||
StrCmp $0 "This is just one example" 0 strreperror
|
|
||||||
${StrRep} $0 "test... test... 1 2 3..." "test" "testing"
|
|
||||||
StrCmp $0 "testing... testing... 1 2 3..." 0 strreperror
|
|
||||||
${StrRep} $0 "" "test" "testing"
|
|
||||||
StrCmp $0 "" 0 strreperror
|
|
||||||
${StrRep} $0 "test" "test" "testing"
|
|
||||||
StrCmp $0 "testing" 0 strreperror
|
|
||||||
${StrRep} $0 "test" "test" ""
|
|
||||||
StrCmp $0 "" 0 strreperror
|
|
||||||
${StrRep} $0 "test" "" "abc"
|
|
||||||
StrCmp $0 "test" 0 strreperror
|
|
||||||
${StrRep} $0 "test" "" ""
|
|
||||||
StrCmp $0 "test" 0 strreperror
|
|
||||||
DetailPrint "PASSED StrRep test"
|
|
||||||
Goto +2
|
|
||||||
strreperror:
|
|
||||||
DetailPrint "FAILED StrRep test"
|
|
||||||
|
|
||||||
# Test sorting
|
|
||||||
${StrSort} $0 "This is just an example" " just" "" "ple" "0" "0"
|
|
||||||
StrCmp $0 "This is an exam" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "j" " " " " "0" "1"
|
|
||||||
StrCmp $0 "just" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "j" "" "" "0" "1"
|
|
||||||
StrCmp $0 "This is just an example" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "us" " " "" "0" "1"
|
|
||||||
StrCmp $0 "just an example" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "u" "" " " "0" "1"
|
|
||||||
StrCmp $0 "This is just" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "just" " " " " "0" "1"
|
|
||||||
StrCmp $0 "just" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "t" " " " " "0" "1"
|
|
||||||
StrCmp $0 "This" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "le" " " " " "0" "1"
|
|
||||||
StrCmp $0 "example" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "le" " " " " "1" "0"
|
|
||||||
StrCmp $0 " examp" 0 strsorterror
|
|
||||||
${StrSort} $0 "an error has occured" "e" " " " " "0" "1"
|
|
||||||
StrCmp $0 "error" 0 strsorterror
|
|
||||||
${StrSort} $0 "" "something" " " " " "0" "1"
|
|
||||||
StrCmp $0 "" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "j" " " " " "1" "1"
|
|
||||||
StrCmp $0 " just " 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "j" " " " " "1" "0"
|
|
||||||
StrCmp $0 " ust " 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "j" "" "" "1" "0"
|
|
||||||
StrCmp $0 "This is ust an example" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "us" " " "" "1" "0"
|
|
||||||
StrCmp $0 " jt an example" 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "u" "" " " "1" "0"
|
|
||||||
StrCmp $0 "This is jst " 0 strsorterror
|
|
||||||
${StrSort} $0 "This is just an example" "just" " " " " "1" "0"
|
|
||||||
StrCmp $0 " " 0 strsorterror
|
|
||||||
${StrSort} $0 "an error has occured" "e" " " " " "1" "0"
|
|
||||||
StrCmp $0 " rror " 0 strsorterror
|
|
||||||
${StrSort} $0 "" "something" " " " " "1" "0"
|
|
||||||
StrCmp $0 "" 0 strsorterror
|
|
||||||
DetailPrint "PASSED StrSort test"
|
|
||||||
Goto +2
|
|
||||||
strsorterror:
|
|
||||||
DetailPrint "FAILED StrSort test"
|
|
||||||
|
|
||||||
# Test tokenizer
|
# Test tokenizer
|
||||||
${StrTok} $0 "This is, or is not, just an example" " ," "5" "1"
|
${StrTok} $0 "This is, or is not, just an example" " ," "4" "1"
|
||||||
StrCmp $0 "not" 0 strtokerror
|
StrCmp $0 "not" 0 strtokerror
|
||||||
${StrTok} $0 "This is, or is not, just an example" " ," "5" "0"
|
${StrTok} $0 "This is, or is not, just an example" " ," "4" "0"
|
||||||
StrCmp $0 "is" 0 strtokerror
|
StrCmp $0 "is" 0 strtokerror
|
||||||
${StrTok} $0 "This is, or is not, just an example" " ," "152" "0"
|
${StrTok} $0 "This is, or is not, just an example" " ," "152" "0"
|
||||||
StrCmp $0 "" 0 strtokerror
|
StrCmp $0 "" 0 strtokerror
|
||||||
|
${StrTok} $0 "This is, or is not, just an example" " ," "" "0"
|
||||||
|
StrCmp $0 "example" 0 strtokerror
|
||||||
|
${StrTok} $0 "This is, or is not, just an example" " ," "L" "0"
|
||||||
|
StrCmp $0 "example" 0 strtokerror
|
||||||
${StrTok} $0 "This is, or is not, just an example" " ," "0" "0"
|
${StrTok} $0 "This is, or is not, just an example" " ," "0" "0"
|
||||||
StrCmp $0 "example" 0 strtokerror
|
|
||||||
${StrTok} $0 "This is, or is not, just an example" " ," "-1" "0"
|
|
||||||
StrCmp $0 "example" 0 strtokerror
|
|
||||||
${StrTok} $0 "This is, or is not, just an example" " ," "1" "0"
|
|
||||||
StrCmp $0 "This" 0 strtokerror
|
StrCmp $0 "This" 0 strtokerror
|
||||||
DetailPrint "PASSED StrTok test"
|
DetailPrint "PASSED StrTok test"
|
||||||
Goto +2
|
Goto +2
|
||||||
|
@ -357,6 +357,70 @@ ioerror:
|
||||||
strlocerror:
|
strlocerror:
|
||||||
DetailPrint "FAILED StrLoc test"
|
DetailPrint "FAILED StrLoc test"
|
||||||
|
|
||||||
|
# Test string replacement
|
||||||
|
${UnStrRep} $0 "This is just an example" "an" "one"
|
||||||
|
StrCmp $0 "This is just one example" 0 strreperror
|
||||||
|
${UnStrRep} $0 "test... test... 1 2 3..." "test" "testing"
|
||||||
|
StrCmp $0 "testing... testing... 1 2 3..." 0 strreperror
|
||||||
|
${UnStrRep} $0 "" "test" "testing"
|
||||||
|
StrCmp $0 "" 0 strreperror
|
||||||
|
${UnStrRep} $0 "test" "test" "testing"
|
||||||
|
StrCmp $0 "testing" 0 strreperror
|
||||||
|
${UnStrRep} $0 "test" "test" ""
|
||||||
|
StrCmp $0 "" 0 strreperror
|
||||||
|
${UnStrRep} $0 "test" "" "abc"
|
||||||
|
StrCmp $0 "test" 0 strreperror
|
||||||
|
${UnStrRep} $0 "test" "" ""
|
||||||
|
StrCmp $0 "test" 0 strreperror
|
||||||
|
DetailPrint "PASSED StrRep test"
|
||||||
|
Goto +2
|
||||||
|
strreperror:
|
||||||
|
DetailPrint "FAILED StrRep test"
|
||||||
|
|
||||||
|
# Test sorting
|
||||||
|
${UnStrSort} $0 "This is just an example" "" " just" "ple" "0" "0" "0"
|
||||||
|
StrCmp $0 "This is an exam" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "j" " " "0" "" "0"
|
||||||
|
StrCmp $0 "just" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" "" "j" "" "0" "1" "0"
|
||||||
|
StrCmp $0 "This is just an example" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "us" "" "0" "1" "0"
|
||||||
|
StrCmp $0 "just an example" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" "" "u" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "This is just" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "just" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "just" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "t" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "This" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "le" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "example" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "le" " " "1" "0" "0"
|
||||||
|
StrCmp $0 " examp" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "an error has occured" " " "e" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "error" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "" " " "something" " " "0" "1" "0"
|
||||||
|
StrCmp $0 "" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "j" " " "" "" ""
|
||||||
|
StrCmp $0 " just " 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "j" " " "1" "0" "1"
|
||||||
|
StrCmp $0 " ust " 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" "" "j" "" "0" "0" "1"
|
||||||
|
StrCmp $0 "This is ust an example" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "us" "" "1" "0" "0"
|
||||||
|
StrCmp $0 " jt an example" 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" "" "u" " " "0" "0" "1"
|
||||||
|
StrCmp $0 "This is jst " 0 strsorterror
|
||||||
|
${UnStrSort} $0 "This is just an example" " " "just" " " "1" "0" "1"
|
||||||
|
StrCmp $0 " " 0 strsorterror
|
||||||
|
${UnStrSort} $0 "an error has occured" " " "e" "h" "1" "0" "0"
|
||||||
|
StrCmp $0 " rror " 0 strsorterror
|
||||||
|
${UnStrSort} $0 "" " " "something" " " "1" "0" "1"
|
||||||
|
StrCmp $0 "" 0 strsorterror
|
||||||
|
DetailPrint "PASSED StrSort test"
|
||||||
|
Goto +2
|
||||||
|
strsorterror:
|
||||||
|
DetailPrint "FAILED StrSort test"
|
||||||
|
|
||||||
${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "g"
|
${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "g"
|
||||||
StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror
|
StrCmp $0 "ghijklmnopqrstuvwxyz" 0 strstrerror
|
||||||
${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga"
|
${UnStrStr} $0 "abcefghijklmnopqrstuvwxyz" "ga"
|
||||||
|
@ -390,7 +454,7 @@ strstrerror:
|
||||||
StrCmp $0 "" 0 strstradverror
|
StrCmp $0 "" 0 strstradverror
|
||||||
${UnStrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0"
|
${UnStrStrAdv} $0 "abcabcabc" "abc" "<" ">" "0" "1" "0"
|
||||||
StrCmp $0 "abc" 0 strstradverror
|
StrCmp $0 "abc" 0 strstradverror
|
||||||
|
|
||||||
${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1"
|
${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "0" "1"
|
||||||
StrCmp $0 "abcabc" 0 strstradverror
|
StrCmp $0 "abcabc" 0 strstradverror
|
||||||
${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1"
|
${UnStrStrAdv} $0 "ABCabcabc" "a" ">" ">" "1" "1" "1"
|
||||||
|
@ -416,82 +480,18 @@ strstrerror:
|
||||||
strstradverror:
|
strstradverror:
|
||||||
DetailPrint "FAILED StrStrAdv test"
|
DetailPrint "FAILED StrStrAdv test"
|
||||||
|
|
||||||
# Test string replacement
|
|
||||||
${UnStrRep} $0 "This is just an example" "an" "one"
|
|
||||||
StrCmp $0 "This is just one example" 0 strreperror
|
|
||||||
${UnStrRep} $0 "test... test... 1 2 3..." "test" "testing"
|
|
||||||
StrCmp $0 "testing... testing... 1 2 3..." 0 strreperror
|
|
||||||
${UnStrRep} $0 "" "test" "testing"
|
|
||||||
StrCmp $0 "" 0 strreperror
|
|
||||||
${UnStrRep} $0 "test" "test" "testing"
|
|
||||||
StrCmp $0 "testing" 0 strreperror
|
|
||||||
${UnStrRep} $0 "test" "test" ""
|
|
||||||
StrCmp $0 "" 0 strreperror
|
|
||||||
${UnStrRep} $0 "test" "" "abc"
|
|
||||||
StrCmp $0 "test" 0 strreperror
|
|
||||||
${UnStrRep} $0 "test" "" ""
|
|
||||||
StrCmp $0 "test" 0 strreperror
|
|
||||||
DetailPrint "PASSED StrRep test"
|
|
||||||
Goto +2
|
|
||||||
strreperror:
|
|
||||||
DetailPrint "FAILED StrRep test"
|
|
||||||
|
|
||||||
# Test sorting
|
|
||||||
${UnStrSort} $0 "This is just an example" " just" "" "ple" "0" "0"
|
|
||||||
StrCmp $0 "This is an exam" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "j" " " " " "0" "1"
|
|
||||||
StrCmp $0 "just" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "j" "" "" "0" "1"
|
|
||||||
StrCmp $0 "This is just an example" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "us" " " "" "0" "1"
|
|
||||||
StrCmp $0 "just an example" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "u" "" " " "0" "1"
|
|
||||||
StrCmp $0 "This is just" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "just" " " " " "0" "1"
|
|
||||||
StrCmp $0 "just" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "t" " " " " "0" "1"
|
|
||||||
StrCmp $0 "This" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "le" " " " " "0" "1"
|
|
||||||
StrCmp $0 "example" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "le" " " " " "1" "0"
|
|
||||||
StrCmp $0 " examp" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "an error has occured" "e" " " " " "0" "1"
|
|
||||||
StrCmp $0 "error" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "" "something" " " " " "0" "1"
|
|
||||||
StrCmp $0 "" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "j" " " " " "1" "1"
|
|
||||||
StrCmp $0 " just " 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "j" " " " " "1" "0"
|
|
||||||
StrCmp $0 " ust " 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "j" "" "" "1" "0"
|
|
||||||
StrCmp $0 "This is ust an example" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "us" " " "" "1" "0"
|
|
||||||
StrCmp $0 " jt an example" 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "u" "" " " "1" "0"
|
|
||||||
StrCmp $0 "This is jst " 0 strsorterror
|
|
||||||
${UnStrSort} $0 "This is just an example" "just" " " " " "1" "0"
|
|
||||||
StrCmp $0 " " 0 strsorterror
|
|
||||||
${UnStrSort} $0 "an error has occured" "e" " " " " "1" "0"
|
|
||||||
StrCmp $0 " rror " 0 strsorterror
|
|
||||||
${UnStrSort} $0 "" "something" " " " " "1" "0"
|
|
||||||
StrCmp $0 "" 0 strsorterror
|
|
||||||
DetailPrint "PASSED StrSort test"
|
|
||||||
Goto +2
|
|
||||||
strsorterror:
|
|
||||||
DetailPrint "FAILED StrSort test"
|
|
||||||
|
|
||||||
# Test tokenizer
|
# Test tokenizer
|
||||||
${UnStrTok} $0 "This is, or is not, just an example" " ," "5" "1"
|
${UnStrTok} $0 "This is, or is not, just an example" " ," "4" "1"
|
||||||
StrCmp $0 "not" 0 strtokerror
|
StrCmp $0 "not" 0 strtokerror
|
||||||
${UnStrTok} $0 "This is, or is not, just an example" " ," "5" "0"
|
${UnStrTok} $0 "This is, or is not, just an example" " ," "4" "0"
|
||||||
StrCmp $0 "is" 0 strtokerror
|
StrCmp $0 "is" 0 strtokerror
|
||||||
${UnStrTok} $0 "This is, or is not, just an example" " ," "152" "0"
|
${UnStrTok} $0 "This is, or is not, just an example" " ," "152" "0"
|
||||||
StrCmp $0 "" 0 strtokerror
|
StrCmp $0 "" 0 strtokerror
|
||||||
|
${UnStrTok} $0 "This is, or is not, just an example" " ," "" "0"
|
||||||
|
StrCmp $0 "example" 0 strtokerror
|
||||||
|
${UnStrTok} $0 "This is, or is not, just an example" " ," "L" "0"
|
||||||
|
StrCmp $0 "example" 0 strtokerror
|
||||||
${UnStrTok} $0 "This is, or is not, just an example" " ," "0" "0"
|
${UnStrTok} $0 "This is, or is not, just an example" " ," "0" "0"
|
||||||
StrCmp $0 "example" 0 strtokerror
|
|
||||||
${UnStrTok} $0 "This is, or is not, just an example" " ," "-1" "0"
|
|
||||||
StrCmp $0 "example" 0 strtokerror
|
|
||||||
${UnStrTok} $0 "This is, or is not, just an example" " ," "1" "0"
|
|
||||||
StrCmp $0 "This" 0 strtokerror
|
StrCmp $0 "This" 0 strtokerror
|
||||||
DetailPrint "PASSED StrTok test"
|
DetailPrint "PASSED StrTok test"
|
||||||
Goto +2
|
Goto +2
|
||||||
|
|
1074
Include/StrFunc.nsh
1074
Include/StrFunc.nsh
File diff suppressed because it is too large
Load diff
|
@ -11,7 +11,8 @@ How to use
|
||||||
------------
|
------------
|
||||||
|
|
||||||
Parameters are specified in this format:
|
Parameters are specified in this format:
|
||||||
required (required) (option1 | option2) [optional]
|
required (required) (option1 | option2) [optional or add. options]
|
||||||
|
[option1 | option2]
|
||||||
|
|
||||||
The stars in command titles (*****) are the function usefulness in my
|
The stars in command titles (*****) are the function usefulness in my
|
||||||
opinion. The more starts, the more useful it is. 5 stars (*****) is the
|
opinion. The more starts, the more useful it is. 5 stars (*****) is the
|
||||||
|
@ -26,25 +27,7 @@ How to use
|
||||||
If you want to add ` to a string, you should always escape it using $\`
|
If you want to add ` to a string, you should always escape it using $\`
|
||||||
because the header file macro functions use ` to separate parameters.
|
because the header file macro functions use ` to separate parameters.
|
||||||
|
|
||||||
1. Include LogicLib.nsh
|
1. Include Header file
|
||||||
----------------------
|
|
||||||
|
|
||||||
!include "LogicLib.nsh"
|
|
||||||
|
|
||||||
LogicLib.nsh has to be inside Include directory, so you don't have to
|
|
||||||
specify a path.
|
|
||||||
|
|
||||||
You have to put this command before including the StrFunc.nsh header
|
|
||||||
file.
|
|
||||||
|
|
||||||
Some functions from this header file depend on LogicLib. This means that
|
|
||||||
functions are less likely to have bugs and easier to understand. Extra
|
|
||||||
options from LogicLib header file do not work as most of the functions
|
|
||||||
are still using the default coding.
|
|
||||||
|
|
||||||
Functions that use LogicLib are mentioned on their descriptions.
|
|
||||||
|
|
||||||
2. Include Header file
|
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
!include "StrFunc.nsh"
|
!include "StrFunc.nsh"
|
||||||
|
@ -54,6 +37,53 @@ How to use
|
||||||
|
|
||||||
You have to put this command before any command used in this header file.
|
You have to put this command before any command used in this header file.
|
||||||
|
|
||||||
|
2. Defines
|
||||||
|
----------
|
||||||
|
|
||||||
|
This header file contains defines that automatizes the life of some who
|
||||||
|
fear of a lot of changes sometimes imposed in this header file or who have
|
||||||
|
applications that put it to work at maximum capacity. Before you try
|
||||||
|
these, give a look on the information below:
|
||||||
|
|
||||||
|
- Every item on a define value is separated by a "|", and every subitem
|
||||||
|
(items in an item) is separated by " ".
|
||||||
|
|
||||||
|
- Use ${StrTok} $var "${DefineName}" "|" "$counter" "0" to get every
|
||||||
|
item inside the define. For subitems, use ${StrTok} $var2 "$var" " "
|
||||||
|
"$counter2" "0" after getting the value for a desidered item.
|
||||||
|
|
||||||
|
- ${StrFunc_List} is automatically made by the header file. The rest
|
||||||
|
is manually added to the header.
|
||||||
|
|
||||||
|
2.1 Defines List:
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
StrFunc_List - Lists all function names currently available on StrFunc
|
||||||
|
header file.
|
||||||
|
|
||||||
|
*_List - Lists all parameter names currently available for "*"
|
||||||
|
function. (* = function name - i.e. StrTok_List).
|
||||||
|
|
||||||
|
*_TypeList - Lists the types of all parameters on "*" function.
|
||||||
|
(* = function name - i.e. StrTok_List). Possible types
|
||||||
|
for each parameter:
|
||||||
|
|
||||||
|
- Output - Needs a variable to output a function result.
|
||||||
|
|
||||||
|
- Text - Needs text or number to be inputed.
|
||||||
|
|
||||||
|
- Mixed - Needs text, number or option to be inputed.
|
||||||
|
Each subitem following the "Mixed" word is an
|
||||||
|
option. The first option is ever the default
|
||||||
|
one. Two following spaces " " means that
|
||||||
|
that subitem is empty.
|
||||||
|
|
||||||
|
- Option - Needs an option to be inputed. Each subitem
|
||||||
|
following the "Option" word is an option.
|
||||||
|
The first option is ever the default one. Two
|
||||||
|
following spaces " " means that that subitem
|
||||||
|
is empty.
|
||||||
|
|
||||||
3. Commands
|
3. Commands
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
@ -111,7 +141,7 @@ How to use
|
||||||
=========================================================================
|
=========================================================================
|
||||||
** ${StrCase}
|
** ${StrCase}
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
ResultVar String Type(L|U|T|S|<>|"")
|
ResultVar String Type(|L|U|T|S|<>)
|
||||||
=========================================================================
|
=========================================================================
|
||||||
Converts "String" to "Type" Case. Uses LogicLib.
|
Converts "String" to "Type" Case. Uses LogicLib.
|
||||||
|
|
||||||
|
@ -126,12 +156,12 @@ How to use
|
||||||
Type
|
Type
|
||||||
Type of string case to convert to:
|
Type of string case to convert to:
|
||||||
|
|
||||||
|
- "" = Original Case (same as "String")
|
||||||
- L = Lower Case (this is just an example. a very simple one.)
|
- L = Lower Case (this is just an example. a very simple one.)
|
||||||
- U = Upper Case (THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE.)
|
- U = Upper Case (THIS IS JUST AN EXAMPLE. A VERY SIMPLE ONE.)
|
||||||
- T = Title Case (This Is Just An Example. A Very Simple One.)
|
- T = Title Case (This Is Just An Example. A Very Simple One.)
|
||||||
- S = Sentence Case (This is just an example. A very simple one.)
|
- S = Sentence Case (This is just an example. A very simple one.)
|
||||||
- <> = Switch Case (This is just an example. A very simple one.)
|
- <> = Switch Case (This is just an example. A very simple one.)
|
||||||
- "" = Original Case (same as "String")
|
|
||||||
|
|
||||||
Default value is "" (Original Case).
|
Default value is "" (Original Case).
|
||||||
|
|
||||||
|
@ -142,13 +172,14 @@ How to use
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
${StrCase} $0 '"Você" is "You" in English.' "U"
|
${StrCase} $0 '"Você" is "You" in English.' "U"
|
||||||
|
[__(_)__()___()__()__(____)_]
|
||||||
|
|
||||||
$0 = '"VOCÊ" IS "YOU" IN ENGLISH.'
|
$0 = '"VOCÊ" IS "YOU" IN ENGLISH.'
|
||||||
|
|
||||||
=========================================================================
|
=========================================================================
|
||||||
* ${StrClb}
|
* ${StrClb}
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
ResultVar String Action(>|<|<>|)
|
ResultVar String Action(|>|<|<>)
|
||||||
=========================================================================
|
=========================================================================
|
||||||
Makes an action with the clipboard depending on value of parameter
|
Makes an action with the clipboard depending on value of parameter
|
||||||
"Action". Uses LogicLib.
|
"Action". Uses LogicLib.
|
||||||
|
@ -161,10 +192,10 @@ How to use
|
||||||
Action
|
Action
|
||||||
Can be one of the following values:
|
Can be one of the following values:
|
||||||
|
|
||||||
|
- "" = Cleans the clipboard.
|
||||||
- ">" = Set string to clipboard.
|
- ">" = Set string to clipboard.
|
||||||
- "<" = Get string from clipboard.
|
- "<" = Get string from clipboard.
|
||||||
- "<>" = Swap string with clipboard's.
|
- "<>" = Swap string with clipboard's.
|
||||||
- "" = Cleans the clipboard.
|
|
||||||
|
|
||||||
Result Value -> ResultVar:
|
Result Value -> ResultVar:
|
||||||
|
|
||||||
|
@ -194,16 +225,17 @@ How to use
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
${StrIOToNSIS} $0 "\r\n\t\\This is just an example\\"
|
${StrIOToNSIS} $0 "\r\n\t\\This is just an example\\"
|
||||||
|
[()()()()_______________________()]
|
||||||
|
|
||||||
$0 = "$\r$\n$\t\This is just an example\"
|
$0 = "$\r$\n$\t\This is just an example\"
|
||||||
|
|
||||||
=========================================================================
|
=========================================================================
|
||||||
* ${StrLoc}
|
* ${StrLoc}
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
ResultVar String StrToSearchFor OffsetDirection(>|<)
|
ResultVar String StrToSearchFor CounterDirection(>|<)
|
||||||
=========================================================================
|
=========================================================================
|
||||||
Searches for "StrToSearchFor" in "String" and returns its location,
|
Searches for "StrToSearchFor" in "String" and returns its location,
|
||||||
according to "OffsetDirection".
|
according to "CounterDirection".
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
|
@ -216,9 +248,9 @@ How to use
|
||||||
StrToSearchFor
|
StrToSearchFor
|
||||||
String to search in "String".
|
String to search in "String".
|
||||||
|
|
||||||
OffsetDirection(>|<)
|
CounterDirection(>|<)
|
||||||
Direction where the counter goes to. Default is ">".
|
Direction where the counter increases to. Default is ">".
|
||||||
(> = left to right, < = right to left)
|
(> = increases from left to right, < = increases from right to left)
|
||||||
|
|
||||||
Result Value -> ResultVar:
|
Result Value -> ResultVar:
|
||||||
|
|
||||||
|
@ -227,6 +259,7 @@ How to use
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
${StrLoc} $0 "This is just an example" "just" "<"
|
${StrLoc} $0 "This is just an example" "just" "<"
|
||||||
|
(__)<<<<<<<<<<<
|
||||||
|
|
||||||
$0 = "11"
|
$0 = "11"
|
||||||
|
|
||||||
|
@ -254,9 +287,103 @@ How to use
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
${StrNSISToIO} $0 "$\r$\n$\t\This is just an example\"
|
${StrNSISToIO} $0 "$\r$\n$\t\This is just an example\"
|
||||||
|
[(_)(_)(_)^_______________________^]
|
||||||
|
|
||||||
$0 = "\r\n\t\\This is just an example\\"
|
$0 = "\r\n\t\\This is just an example\\"
|
||||||
|
|
||||||
|
=========================================================================
|
||||||
|
***** ${StrRep}
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
ResultVar String StrToReplace ReplacementString
|
||||||
|
=========================================================================
|
||||||
|
Searches for all "StrToReplace" in "String" replacing those with
|
||||||
|
"ReplacementString".
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
|
||||||
|
ResultVar
|
||||||
|
Destination where result is returned.
|
||||||
|
|
||||||
|
String
|
||||||
|
String where to search "StrToReplace".
|
||||||
|
|
||||||
|
StrToReplaceFor
|
||||||
|
String to search in "String".
|
||||||
|
|
||||||
|
StringToBeReplacedWith
|
||||||
|
String to replace "StringToReplace" when it is found in "String".
|
||||||
|
|
||||||
|
Result Value -> ResultVar:
|
||||||
|
|
||||||
|
"String" with all occurences of "StringToReplace" replaced with
|
||||||
|
"ReplacementString".
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
${StrRep} $0 "This is just an example" "an" "one"
|
||||||
|
[____________()_______]
|
||||||
|
|
||||||
|
$0 = "This is just one example"
|
||||||
|
|
||||||
|
=========================================================================
|
||||||
|
*** ${StrSort}
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
ResultVar String LeftStr CenterStr RightStr IncludeLeftStr(1|0)
|
||||||
|
IncludeCenterStr(1|0) IncludeRightStr(1|0)
|
||||||
|
=========================================================================
|
||||||
|
Searches for "CenterStr" in "String", and returns only the value
|
||||||
|
between "LeftStr" and "RightStr", including or not the "CenterStr" using
|
||||||
|
"IncludeCenterStr" and/or the "LeftStr" using "IncludeLeftStr" and
|
||||||
|
"RightStr" using "IncludeRightStr".
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
|
||||||
|
ResultVar
|
||||||
|
Destination where result is returned.
|
||||||
|
|
||||||
|
String
|
||||||
|
String where to search "CenterStr".
|
||||||
|
|
||||||
|
LeftStr
|
||||||
|
The first occurrence of "LeftStr" on the left of "CenterStr".
|
||||||
|
If it is an empty value, or was not found, will return
|
||||||
|
everything on the left of "CenterStr".
|
||||||
|
|
||||||
|
CenterStr
|
||||||
|
String to search in "String".
|
||||||
|
|
||||||
|
RightStr
|
||||||
|
The first occurrence of "RightStr" on the right of "CenterStr".
|
||||||
|
If it is an empty value, or was not found, will return
|
||||||
|
everything on the right of "CenterStr".
|
||||||
|
|
||||||
|
IncludeLeftStr(1|0)
|
||||||
|
Include or not the "LeftStr" in the result value. Default is 1
|
||||||
|
(True). (1 = True, 0 = False)
|
||||||
|
|
||||||
|
IncludeCenterStr(1|0)
|
||||||
|
Include or not the "CenterStr" in the result value. Default is 1
|
||||||
|
(True). (1 = True, 0 = False)
|
||||||
|
|
||||||
|
IncludeRightStr(1|0)
|
||||||
|
Include or not the "RightStr" in the result value. Default is 1
|
||||||
|
(True). (1 = True, 0 = False)
|
||||||
|
|
||||||
|
Result Value -> ResultVar:
|
||||||
|
|
||||||
|
String between "LeftStr" and "RightStr" of a found "CenterStr"
|
||||||
|
including or not the "LeftStr" and "RightStr" if
|
||||||
|
"IncludeLeftRightStr" is 1 and/or the "CenterStr" if
|
||||||
|
"IncludeCenterStr" is 1.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
${StrSort} $0 "This is just an example" " just" "" "ple" "0" "0"
|
||||||
|
[_______(___)_______]( )
|
||||||
|
C R
|
||||||
|
|
||||||
|
$0 = "This is an exam"
|
||||||
|
|
||||||
=========================================================================
|
=========================================================================
|
||||||
***** ${StrStr}
|
***** ${StrStr}
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
@ -277,11 +404,13 @@ How to use
|
||||||
|
|
||||||
Result Value -> ResultVar:
|
Result Value -> ResultVar:
|
||||||
|
|
||||||
"StrToSearchFor" + the string after where it was found in "String".
|
"StrToSearchFor" + the string after where "StrToSearchFor" was found in
|
||||||
|
"String".
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
${StrStr} $0 "This is just an example" "just"
|
${StrStr} $0 "This is just an example" "just"
|
||||||
|
>>>>>>>>>{_)____________]
|
||||||
|
|
||||||
$0 = "just an example"
|
$0 = "just an example"
|
||||||
|
|
||||||
|
@ -289,10 +418,10 @@ How to use
|
||||||
***** ${StrStrAdv}
|
***** ${StrStrAdv}
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
ResultVar String StrToSearchFor SearchDirection(>|<)
|
ResultVar String StrToSearchFor SearchDirection(>|<)
|
||||||
ResultStrDirection(>|<) DisplayStrToSearch(1|0) Loops CaseSensitive
|
ResultStrDirection(>|<) DisplayStrToSearch(1|0) Loops CaseSensitive(0|1)
|
||||||
=========================================================================
|
=========================================================================
|
||||||
Searches for "StrToSearchFor" in "String" in the direction specified by
|
Searches for "StrToSearchFor" in "String" in the direction specified by
|
||||||
"SearchDirection" and looping "Loops" times. Uses LogicLib.
|
"SearchDirection" and looping "Loops" times.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
|
@ -322,7 +451,7 @@ How to use
|
||||||
Number of times the code will search "StrToSearchFor" in "String" not
|
Number of times the code will search "StrToSearchFor" in "String" not
|
||||||
including the original execution. Default is "0" (1 code execution).
|
including the original execution. Default is "0" (1 code execution).
|
||||||
|
|
||||||
CaseSensitive
|
CaseSensitive(0|1)
|
||||||
If "1" the search will be case-sensitive (diferenciates between cases).
|
If "1" the search will be case-sensitive (diferenciates between cases).
|
||||||
If "0" it is case-insensitive (does not diferenciate between cases).
|
If "0" it is case-insensitive (does not diferenciate between cases).
|
||||||
Default is "0" (Case-Insensitive).
|
Default is "0" (Case-Insensitive).
|
||||||
|
@ -343,122 +472,37 @@ How to use
|
||||||
When you put nothing in "String", will return an empty string and set
|
When you put nothing in "String", will return an empty string and set
|
||||||
error flag.
|
error flag.
|
||||||
|
|
||||||
Example (!define LOGICLIB_STRCMP activated):
|
Example:
|
||||||
|
|
||||||
|
${StrStrAdv} $0 "This IS really just an example" "IS " ">" ">" "1" "0" "1"
|
||||||
|
>>>>>( )[____________________]
|
||||||
|
|
||||||
${StrStrAdv} $0 "This IS really just an example" "IS " ">" ">" "1" "0"
|
|
||||||
"1"
|
|
||||||
|
|
||||||
$0 = "really just an example"
|
$0 = "really just an example"
|
||||||
|
|
||||||
=========================================================================
|
|
||||||
***** ${StrRep}
|
|
||||||
-------------------------------------------------------------------------
|
|
||||||
ResultVar String StrToReplace ReplacementString
|
|
||||||
=========================================================================
|
|
||||||
Searches for all "StrToReplaceFor" in "String" replacing those with
|
|
||||||
"ReplacementString".
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
|
|
||||||
ResultVar
|
|
||||||
Destination where result is returned.
|
|
||||||
|
|
||||||
String
|
|
||||||
String where to search "StrToReplaceFor".
|
|
||||||
|
|
||||||
StrToReplaceFor
|
|
||||||
String to search in "String".
|
|
||||||
|
|
||||||
StringToBeReplacedWith
|
|
||||||
String to replace "StringToReplace" when it is found in "String".
|
|
||||||
|
|
||||||
Result Value -> ResultVar:
|
|
||||||
|
|
||||||
"String" with all occurences of "StringToReplace" replaced with
|
|
||||||
"ReplacementString".
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
${StrRep} $0 "This is just an example" "an" "one"
|
|
||||||
|
|
||||||
$0 = "This is just one example"
|
|
||||||
|
|
||||||
=========================================================================
|
|
||||||
*** ${StrSort}
|
|
||||||
-------------------------------------------------------------------------
|
|
||||||
ResultVar String CenterStr LeftStr RightStr IncludeLeftRightStr(1|0)
|
|
||||||
IncludeCenterStr(1|0)
|
|
||||||
=========================================================================
|
|
||||||
Searches for "CenterStr" in "String", and returns only the value
|
|
||||||
between "LeftStr" and "RightStr", including or not the "CenterStr" using
|
|
||||||
"IncludeCenterStr" and/or the "LeftStr" and "RightStr" using
|
|
||||||
"IncludeLeftRightStr".
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
|
|
||||||
ResultVar
|
|
||||||
Destination where result is returned.
|
|
||||||
|
|
||||||
String
|
|
||||||
String where to search "CenterStr".
|
|
||||||
|
|
||||||
CenterStr
|
|
||||||
String to search in "String".
|
|
||||||
|
|
||||||
LeftStr
|
|
||||||
The first occurrence of "LeftStr" on the left of "CenterStr".
|
|
||||||
If it is an empty value, or was not found, will return
|
|
||||||
everything on the left of "CenterStr".
|
|
||||||
|
|
||||||
RightStr
|
|
||||||
The first occurrence of "RightStr" on the right of "CenterStr".
|
|
||||||
If it is an empty value, or was not found, will return
|
|
||||||
everything on the right of "CenterStr".
|
|
||||||
|
|
||||||
IncludeLeftRightStr(1|0)
|
|
||||||
Include or not the "LeftStr" and "RightStr" in the result value.
|
|
||||||
Default is 1 (True). (1 = True, 0 = False)
|
|
||||||
|
|
||||||
IncludeCenterStr(1|0)
|
|
||||||
Include or not the "CenterStr" in the result value. Default is 1
|
|
||||||
(True). (1 = True, 0 = False)
|
|
||||||
|
|
||||||
Result Value -> ResultVar:
|
|
||||||
|
|
||||||
String between "LeftStr" and "RightStr" of a found "CenterStr"
|
|
||||||
including or not the "LeftStr" and "RightStr" if
|
|
||||||
"IncludeLeftRightStr" is 1 and/or the "CenterStr" if
|
|
||||||
"IncludeCenterStr" is 1.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
${StrSort} $0 "This is just an example" " just" "" "ple" "0" "0"
|
|
||||||
|
|
||||||
$0 = "This is an exam"
|
|
||||||
|
|
||||||
=========================================================================
|
=========================================================================
|
||||||
**** ${StrTok}
|
**** ${StrTok}
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
ResultVar StrToTokenize Separators ResultPart SkipEmptyParts(1|0)
|
ResultVar String Separators ResultPart[L] SkipEmptyParts(1|0)
|
||||||
=========================================================================
|
=========================================================================
|
||||||
Returns the part "ResultPart" between two "Separators" inside
|
Returns the part "ResultPart" between two "Separators" inside
|
||||||
"StrToTokenize".
|
"String".
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
ResultVar
|
ResultVar
|
||||||
Destination where result is returned.
|
Destination where result is returned.
|
||||||
|
|
||||||
StrToTokenize
|
String
|
||||||
String where to search for "Separators".
|
String where to search for "Separators".
|
||||||
|
|
||||||
Separators
|
Separators
|
||||||
Characters to find in "StrToTokenize".
|
Characters to find on "String".
|
||||||
|
|
||||||
ResultPart
|
ResultPart[L]
|
||||||
The part want to be found in "StrToTokenize" between two "Separators".
|
The part want to be found on "StrToTokenize" between two "Separators".
|
||||||
Can be any number, starting at 1, and "L" that is the last part.
|
Can be any number, starting at 0, and "L" that is the last part.
|
||||||
Default is L.
|
Default is L (Last part).
|
||||||
|
|
||||||
SkipEmptyParts(1|0)
|
SkipEmptyParts(1|0)
|
||||||
Skips empty string parts between two "Separators". Default is 1 (True).
|
Skips empty string parts between two "Separators". Default is 1 (True).
|
||||||
|
@ -466,16 +510,18 @@ How to use
|
||||||
|
|
||||||
Result Value -> ResultVar:
|
Result Value -> ResultVar:
|
||||||
|
|
||||||
"StrToTokenize" part "Part" between two "Separators".
|
"String" part number "Part" between two "Separators".
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
1) ${StrTok} $0 "This is, or is not, just an example" " ," "5" "1"
|
1) ${StrTok} $0 "This is, or is not, just an example" " ," "4" "1"
|
||||||
|
( ) () () () [_] ( ) () ( )
|
||||||
|
0 1 2 3 4 5 6 7
|
||||||
$0 = "not"
|
$0 = "not"
|
||||||
|
|
||||||
2) ${StrTok} $0 "This is, or is not, just an example" " ," "5" "0"
|
2) ${StrTok} $0 "This is, or is not, just an example" " ," "4" "0"
|
||||||
|
( ) () ^() [] ( ) ^( ) () ( )
|
||||||
|
0 1 23 4 5 67 8 9
|
||||||
$0 = "is"
|
$0 = "is"
|
||||||
|
|
||||||
=========================================================================
|
=========================================================================
|
||||||
|
@ -500,6 +546,7 @@ How to use
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
${StrTrimNewLines} $0 "$\r$\nThis is just an example$\r$\n$\r$\n"
|
${StrTrimNewLines} $0 "$\r$\nThis is just an example$\r$\n$\r$\n"
|
||||||
|
[_____________________________(_)(_)(_)(_)]
|
||||||
|
|
||||||
$0 = "$\r$\nThis is just an example"
|
$0 = "$\r$\nThis is just an example"
|
||||||
|
|
||||||
|
@ -507,18 +554,8 @@ Functions included and not included
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|
||||||
11 functions have been included
|
11 functions have been included
|
||||||
3 were included as are in Archive
|
They are not available on Archive
|
||||||
8 were not included in Archive
|
They are on LogicLib format
|
||||||
3 were made with LogicLib coding
|
|
||||||
StrClb
|
|
||||||
StrStrAdv (AdvStrStr)
|
|
||||||
StrCase
|
|
||||||
5 were made with normal NSIS coding
|
|
||||||
StrTok (AdvStrTok)
|
|
||||||
StrLoc
|
|
||||||
StrSort (AdvStrSort)
|
|
||||||
NSISToIO
|
|
||||||
IOToNSIS
|
|
||||||
|
|
||||||
15 functions have not been included
|
15 functions have not been included
|
||||||
12 were not included because of better functions
|
12 were not included because of better functions
|
||||||
|
@ -547,10 +584,19 @@ Functions included and not included
|
||||||
Version History
|
Version History
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
1.08 - 10/12/2004
|
||||||
|
|
||||||
|
- Converted all the functions to LogicLib.
|
||||||
|
- StrSort: Totally remade and it can break old scripts. See
|
||||||
|
documentation for details.
|
||||||
|
- Added defines: StrFunc_List, *_List and *_TypeList.
|
||||||
|
- Fixed StrStrAdv: Variables $R0-$R3 couldn't be used on scripts before
|
||||||
|
calling.
|
||||||
|
- StrRep: Cut down some variables.
|
||||||
|
- Arranged correctly the order of StrSort on the documentation.
|
||||||
|
|
||||||
1.07 - 09/21/2004
|
1.07 - 09/21/2004
|
||||||
|
|
||||||
- LogicLib is required now, because of the remodelation of StrStrAdv,
|
|
||||||
StrCase and StrClb functions.
|
|
||||||
- Removed ${UnStrFunc} command. Now you can just include uninstall
|
- Removed ${UnStrFunc} command. Now you can just include uninstall
|
||||||
functions commands like ${UnStrStr} to be supported by uninstall functions
|
functions commands like ${UnStrStr} to be supported by uninstall functions
|
||||||
and sections.
|
and sections.
|
||||||
|
@ -626,7 +672,7 @@ Made by Diego Pedroso (aka deguix).
|
||||||
Functions Credits
|
Functions Credits
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
- StrCase, StrClb, StrLoc, StrSort, StrStrAdv and StrTok (Adv) made
|
- StrCase, StrClb, StrLoc, StrSort, StrStrAdv and StrTok made
|
||||||
by Diego Pedroso, some based on functions made by Dave Laundon,
|
by Diego Pedroso, some based on functions made by Dave Laundon,
|
||||||
"Afrow UK" and "bigmac666".
|
"Afrow UK" and "bigmac666".
|
||||||
- StrRep made by Hendri Adriaens.
|
- StrRep made by Hendri Adriaens.
|
||||||
|
@ -651,4 +697,4 @@ it freely, subject to the following restrictions:
|
||||||
product documentation would be appreciated but is not required.
|
product documentation would be appreciated but is not required.
|
||||||
2. Altered versions must be plainly marked as such,
|
2. Altered versions must be plainly marked as such,
|
||||||
and must not be misrepresented as being the original header file.
|
and must not be misrepresented as being the original header file.
|
||||||
3. This notice may not be removed or altered from any distribution.
|
3. This notice may not be removed or altered from any distribution.
|
Loading…
Add table
Add a link
Reference in a new issue