author | unc0rr |
Sun, 25 Jan 2015 00:08:42 +0300 | |
branch | qmlfrontend |
changeset 10751 | 97d00ace1aed |
parent 10616 | 20a2d5e6930a |
child 10757 | f71275973737 |
permissions | -rw-r--r-- |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
1 |
unit uFLUtils; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
2 |
interface |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
3 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
4 |
function str2PChar(const s: shortstring): PChar; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
5 |
function intToStr(n: LongInt): shortstring; |
10616 | 6 |
function strToInt(s: shortstring): LongInt; |
10440 | 7 |
function midStr(s: shortstring; pos: byte): shortstring; |
10517 | 8 |
procedure underScore2Space(var s: shortstring); |
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
9 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
10 |
implementation |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
11 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
12 |
var |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
13 |
str2PCharBuffer: array[0..255] of char; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
14 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
15 |
function str2PChar(const s: shortstring): PChar; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
16 |
var i: Integer; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
17 |
begin |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
18 |
for i:= 1 to Length(s) do |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
19 |
begin |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
20 |
str2PCharBuffer[i - 1] := s[i]; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
21 |
end; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
22 |
str2PCharBuffer[Length(s)]:= #0; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
23 |
str2PChar:= @(str2PCharBuffer[0]); |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
24 |
end; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
25 |
|
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
26 |
function intToStr(n: LongInt): shortstring; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
27 |
begin |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
28 |
str(n, intToStr) |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
29 |
end; |
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
30 |
|
10616 | 31 |
function strToInt(s: shortstring): LongInt; |
32 |
begin |
|
33 |
val(s, strToInt); |
|
34 |
end; |
|
35 |
||
10440 | 36 |
function midStr(s: shortstring; pos: byte): shortstring; |
37 |
begin |
|
38 |
midStr:= copy(s, pos, length(s) - pos + 1) |
|
39 |
end; |
|
40 |
||
10517 | 41 |
procedure underScore2Space(var s: shortstring); |
42 |
var i: LongInt; |
|
43 |
begin |
|
44 |
for i:= length(s) downto 1 do |
|
45 |
if s[i] = '_' then s[i]:= ' ' |
|
46 |
end; |
|
47 |
||
10434
1614b13ad35e
Themes model, also add some files I forgot to add previously
unc0rr
parents:
diff
changeset
|
48 |
end. |