-
Notifications
You must be signed in to change notification settings - Fork 4
/
lpeval_import_string.inc
76 lines (63 loc) · 5.03 KB
/
lpeval_import_string.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
Author: Niels A.D
Project: Lape (http://code.google.com/p/la-pe/)
License: GNU Lesser GPL (http://www.gnu.org/licenses/lgpl.html)
This include constains all the wrappers for string related functions.
}
{%MainUnit lpeval.pas}
addGlobalType('(tlbsLF, tlbsCRLF, tlbsCR)', 'TTextLineBreakStyle');
addGlobalType('set of (rfReplaceAll, rfIgnoreCase)', 'TReplaceFlags');
addGlobalFunc('function UpperCase(s: string): string;', @_LapeUpperCase);
addGlobalFunc('function LowerCase(s: string): string;', @_LapeLowerCase);
addGlobalFunc('function UpCase(c: AnsiChar): AnsiChar; overload;', @_LapeUpCaseA);
addGlobalFunc('function UpCase(c: WideChar): WideChar; overload;', @_LapeUpCaseW);
addGlobalFunc('function CompareStr(s1, s2: string): Int32;', @_LapeCompareStr);
addGlobalFunc('function CompareText(s1, s2: string): Int32;', @_LapeCompareText);
addGlobalFunc('function SameText(s1, s2: string): EvalBool;', @_LapeSameText);
addGlobalFunc('function AnsiUpperCase(s: string): string;', @_LapeAnsiUpperCase);
addGlobalFunc('function AnsiLowerCase(s: string): string;', @_LapeAnsiLowerCase);
addGlobalFunc('function AnsiCompareStr(s1, s2: string): Int32;', @_LapeAnsiCompareStr);
addGlobalFunc('function AnsiCompareText(s1, s2: string): Int32;', @_LapeAnsiCompareText);
addGlobalFunc('function AnsiSameText(s1,s2: string): EvalBool;', @_LapeAnsiSameText);
addGlobalFunc('function AnsiSameStr(s1,s2: string): EvalBool;', @_LapeAnsiSameStr);
addGlobalFunc('function Trim(s: string): string;', @_LapeTrim);
addGlobalFunc('function TrimLeft(s: string): string;', @_LapeTrimLeft);
addGlobalFunc('function TrimRight(s: string): string;', @_LapeTrimRight);
addGlobalFunc('function PadL(s: string; Len: SizeInt; c: Char = '' ''): string;', @_LapePadL);
addGlobalFunc('function PadR(s: string; Len: SizeInt; c: Char = '' ''): string;', @_LapePadR);
addGlobalFunc('function QuotedStr(s: string): string;', @_LapeQuotedStr);
addGlobalFunc('function AnsiQuotedStr(s: string; Quote: Char): string;', @_LapeAnsiQuotedStr);
addGlobalFunc('function AnsiDequotedStr(s: string; AQuote: Char): string;', @_LapeAnsiDequotedStr);
addGlobalFunc('function WrapText(Line, BreakStr: string; BreakChars: set of AnsiChar; MaxCol: Int32): string;', @_LapeWrapText);
addGlobalFunc('function AdjustLineBreaks(s: string; Style: TTextLineBreakStyle): string;', @_LapeAdjustLineBreaks);
addGlobalFunc('function IntToHex(Value: Int64; Digits: Int32 = 1): string; overload;', @_LapeIntToHex);
addGlobalFunc('function IntToHex(Value: UInt64; Digits: Int32 = 1): string; overload;', @_LapeUIntToHex);
addGlobalFunc('function IntToStr(i: Int64): string; overload;', @_LapeToString_Int64);
addGlobalFunc('function IntToStr(i: UInt64): string; overload;', @_LapeToString_UInt64);
addGlobalFunc('function StrToInt(s: string): Int32;', @_LapeStrToInt);
addGlobalFunc('function StrToIntDef(s: string; Def: Int32): Int32;', @_LapeStrToIntDef);
addGlobalFunc('function StrToInt64(s: string): Int64;', @_LapeStrToInt64);
addGlobalFunc('function StrToInt64Def(s: string; Def: Int64): Int64;', @_LapeStrToInt64Def);
addGlobalFunc('function StrToUInt64(s: string): UInt64;', @_LapeStrToUInt64);
addGlobalFunc('function StrToUInt64Def(s: string; Def: UInt64): UInt64;', @_LapeStrToUInt64Def);
addGlobalFunc('function FloatToStr(f: Extended): string;', @_LapeToString_Extended);
addGlobalFunc('function StrToFloat(s: string): Extended;', @_LapeStrToFloat);
addGlobalFunc('function StrToFloatDef(s: string; Def: Extended): Extended;', @_LapeStrToFloatDef);
addGlobalFunc('function CurrToStr(Value: Currency): string;', @_LapeToString_Currency);
addGlobalFunc('function StrToCurr(s: string): Currency;', @_LapeStrToCurr);
addGlobalFunc('function StrToCurrDef(s: string; Def: Currency): Currency;', @_LapeStrToCurrDef);
addGlobalFunc('function StrToBool(s: string): EvalBool;', @_LapeStrToBool);
addGlobalFunc('function BoolToStr(B: EvalBool; TrueS: string = ''True''; FalseS: string = ''False''): string;', @_LapeBoolToStr);
addGlobalFunc('function StrToBoolDef(s: string; Default: EvalBool): EvalBool;', @_LapeStrToBoolDef);
addGlobalFunc('function Format(Fmt: string; Args: array of Variant): string;', @_LapeFormat);
addGlobalFunc('function FormatFloat(Format: string; Value: Extended): string;', @_LapeFormatFloat);
addGlobalFunc('function FormatCurr(Format: string; Value: Currency): string;', @_LapeFormatCurr);
addGlobalFunc('function LastDelimiter(Delimiters, s: string): SizeInt;', @_LapeLastDelimiter);
addGlobalFunc('function StringReplace(S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;', @_LapeStringReplace);
addGlobalFunc('Function IsDelimiter(Delimiters, s: string; Index: SizeInt): EvalBool;', @_LapeIsDelimiter);
addGlobalFunc('function Pos(Substr: string; Source: string): SizeInt;', @_LapePos);
addGlobalFunc('function StringOfChar(c: Char; l: SizeInt): string;', @_LapeStringOfChar);
addDelayedCode(LapeDelayedFlags +
'function Chr(IntValue: UInt8): AnsiChar; overload; begin Result := AnsiChar(IntValue); end;' + LineEnding +
'function Chr(IntValue: UInt16): WideChar; overload; begin Result := WideChar(IntValue); end;'
, '!addDelayedString');