corrade-lsl-templates – Diff between revs 14 and 29
?pathlinks?
Rev 14 | Rev 29 | |||
---|---|---|---|---|
Line 1... | Line 1... | |||
1 | /////////////////////////////////////////////////////////////////////////// |
1 | /////////////////////////////////////////////////////////////////////////// |
|
2 | // Copyright (C) Wizardry and Steamworks 2016 - License: GNU GPLv3 // |
2 | // Copyright (C) Wizardry and Steamworks 2016 - License: CC BY 2.0 // |
|
3 | /////////////////////////////////////////////////////////////////////////// |
3 | /////////////////////////////////////////////////////////////////////////// |
|
4 | // |
4 | // |
|
5 | // A wiki module that can memorize strings and recall them by path. |
5 | // A wiki module that can memorize strings and recall them by path. |
|
6 | // |
6 | // |
|
7 | /////////////////////////////////////////////////////////////////////////// |
7 | /////////////////////////////////////////////////////////////////////////// |
|
Line 8... | Line 8... | |||
8 | |
8 | |
|
9 | /////////////////////////////////////////////////////////////////////////// |
9 | /////////////////////////////////////////////////////////////////////////// |
|
10 | // Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // |
10 | // Copyright (C) Wizardry and Steamworks 2014 - License: CC BY 2.0 // |
|
11 | /////////////////////////////////////////////////////////////////////////// |
11 | /////////////////////////////////////////////////////////////////////////// |
|
12 | integer wasIsAlNum(string a) { |
12 | integer wasIsAlNum(string a) { |
|
13 | if(a == "") return FALSE; |
13 | if(a == "") return FALSE; |
|
14 | integer x = llBase64ToInteger("AAAA" + |
14 | integer x = llBase64ToInteger("AAAA" + |
|
15 | llStringToBase64(llGetSubString(a, 0, 0))); |
15 | llStringToBase64(llGetSubString(a, 0, 0))); |
|
16 | return (x >= 65 && x <= 90) || (x >= 97 && x <= 122) || |
16 | return (x >= 65 && x <= 90) || (x >= 97 && x <= 122) || |
|
17 | (x >= 48 && x <= 57); |
17 | (x >= 48 && x <= 57); |
|
18 | } |
18 | } |
|
19 | /////////////////////////////////////////////////////////////////////////// |
19 | /////////////////////////////////////////////////////////////////////////// |
|
20 | // Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3 // |
20 | // Copyright (C) 2014 Wizardry and Steamworks - License: CC BY 2.0 // |
|
21 | /////////////////////////////////////////////////////////////////////////// |
21 | /////////////////////////////////////////////////////////////////////////// |
|
22 | string wasKeyValueGet(string k, string data) { |
22 | string wasKeyValueGet(string k, string data) { |
|
23 | if(llStringLength(data) == 0) return ""; |
23 | if(llStringLength(data) == 0) return ""; |
|
24 | if(llStringLength(k) == 0) return ""; |
24 | if(llStringLength(k) == 0) return ""; |
|
Line 27... | Line 27... | |||
27 | if(i != -1) return llList2String(a, i+1); |
27 | if(i != -1) return llList2String(a, i+1); |
|
28 | return ""; |
28 | return ""; |
|
29 | } |
29 | } |
|
Line 30... | Line 30... | |||
30 | |
30 | |
|
31 | /////////////////////////////////////////////////////////////////////////// |
31 | /////////////////////////////////////////////////////////////////////////// |
|
32 | // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // |
32 | // Copyright (C) 2013 Wizardry and Steamworks - License: CC BY 2.0 // |
|
33 | /////////////////////////////////////////////////////////////////////////// |
33 | /////////////////////////////////////////////////////////////////////////// |
|
34 | string wasKeyValueEncode(list data) { |
34 | string wasKeyValueEncode(list data) { |
|
35 | list k = llList2ListStrided(data, 0, -1, 2); |
35 | list k = llList2ListStrided(data, 0, -1, 2); |
|
36 | list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); |
36 | list v = llList2ListStrided(llDeleteSubList(data, 0, 0), 0, -1, 2); |
|
Line 42... | Line 42... | |||
42 | } while(llGetListLength(k) != 0); |
42 | } while(llGetListLength(k) != 0); |
|
43 | return llDumpList2String(data, "&"); |
43 | return llDumpList2String(data, "&"); |
|
44 | } |
44 | } |
|
Line 45... | Line 45... | |||
45 | |
45 | |
|
46 | /////////////////////////////////////////////////////////////////////////// |
46 | /////////////////////////////////////////////////////////////////////////// |
|
47 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
47 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
48 | /////////////////////////////////////////////////////////////////////////// |
48 | /////////////////////////////////////////////////////////////////////////// |
|
49 | // escapes a string in conformance with RFC1738 |
49 | // escapes a string in conformance with RFC1738 |
|
50 | string wasURLEscape(string i) { |
50 | string wasURLEscape(string i) { |
|
51 | string o = ""; |
51 | string o = ""; |
|
Line 66... | Line 66... | |||
66 | } while(i != ""); |
66 | } while(i != ""); |
|
67 | return o; |
67 | return o; |
|
68 | } |
68 | } |
|
Line 69... | Line 69... | |||
69 | |
69 | |
|
70 | /////////////////////////////////////////////////////////////////////////// |
70 | /////////////////////////////////////////////////////////////////////////// |
|
71 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
71 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
72 | /////////////////////////////////////////////////////////////////////////// |
72 | /////////////////////////////////////////////////////////////////////////// |
|
73 | list wasCSVToList(string csv) { |
73 | list wasCSVToList(string csv) { |
|
74 | list l = []; |
74 | list l = []; |
|
75 | list s = []; |
75 | list s = []; |
|
Line 105... | Line 105... | |||
105 | // postcondition: length(s) = 0 |
105 | // postcondition: length(s) = 0 |
|
106 | return l + m; |
106 | return l + m; |
|
107 | } |
107 | } |
|
Line 108... | Line 108... | |||
108 | |
108 | |
|
109 | /////////////////////////////////////////////////////////////////////////// |
109 | /////////////////////////////////////////////////////////////////////////// |
|
110 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
110 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
111 | /////////////////////////////////////////////////////////////////////////// |
111 | /////////////////////////////////////////////////////////////////////////// |
|
112 | string wasListToCSV(list l) { |
112 | string wasListToCSV(list l) { |
|
113 | list v = []; |
113 | list v = []; |
|
114 | do { |
114 | do { |
|
Line 134... | Line 134... | |||
134 | } while(l != []); |
134 | } while(l != []); |
|
135 | return llDumpList2String(v, ","); |
135 | return llDumpList2String(v, ","); |
|
136 | } |
136 | } |
|
Line 137... | Line 137... | |||
137 | |
137 | |
|
138 | /////////////////////////////////////////////////////////////////////////// |
138 | /////////////////////////////////////////////////////////////////////////// |
|
139 | // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 // |
139 | // Copyright (C) 2015 Wizardry and Steamworks - License: CC BY 2.0 // |
|
140 | /////////////////////////////////////////////////////////////////////////// |
140 | /////////////////////////////////////////////////////////////////////////// |
|
141 | // unescapes a string in conformance with RFC1738 |
141 | // unescapes a string in conformance with RFC1738 |
|
142 | string wasURLUnescape(string i) { |
142 | string wasURLUnescape(string i) { |
|
143 | return llUnescapeURL( |
143 | return llUnescapeURL( |