File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ interface
1313
1414const
1515 // Versionamento
16- RALVERSION = ' 0.11.0-16 alpha' ;
16+ RALVERSION = ' 0.11.0-18 alpha' ;
1717 RALVERSION_MAJOR = 0 ;
1818 RALVERSION_MINOR = 11 ;
1919 RALVERSION_PATCH = 0 ;
Original file line number Diff line number Diff line change 88interface
99
1010{ $I ..\base\PascalRAL.inc}
11+ { $IFDEF FPC}
12+ { $modeswitch typehelpers}
13+ { $ENDIF}
1114
1215uses
1316 { $IFDEF FPC}
@@ -59,6 +62,14 @@ interface
5962 TRALExecBehavior = (ebSingleThread, ebMultiThread);
6063 TRALDateTimeFormat = (dtfUnix, dtfISO8601, dtfCustom);
6164
65+ { $IF Defined(FPC) or Defined(DELPHIXE3UP)}
66+ TRALBase64StringHelper = { $IFDEF FPC} type { $ELSE} record { $ENDIF} helper for StringRAL
67+ public
68+ function toBase64 : StringRAL;
69+ function fromBase64 : StringRAL;
70+ end ;
71+ { $IFEND}
72+
6273const
6374 { $IF Defined(FPC) OR Defined(DELPHIXE3UP)}
6475 POSINISTR = Low(String);
@@ -84,6 +95,9 @@ function ISO8601ToDate(const AValue: StringRAL): TDateTime;
8495
8596implementation
8697
98+ uses
99+ RALBase64;
100+
87101function RALHighStr (const AStr: StringRAL): integer;
88102begin
89103 { $IF NOT Defined(FPC) AND NOT Defined(DELPHIXE3UP)}
@@ -151,4 +165,18 @@ function ISO8601ToDate(const AValue: StringRAL): TDateTime;
151165end ;
152166{ $IFEND}
153167
168+ { TRALBase64StringHelper }
169+
170+ { $IF Defined(FPC) or defined(DELPHIXE3UP)}
171+ function TRALBase64StringHelper.fromBase64 : StringRAL;
172+ begin
173+ Result := TRALBase64.Decode(Self);
174+ end ;
175+
176+ function TRALBase64StringHelper.toBase64 : StringRAL;
177+ begin
178+ Result := TRALBase64.Encode(Self);
179+ end ;
180+ { $IFEND}
181+
154182end .
Original file line number Diff line number Diff line change @@ -37,14 +37,6 @@ TRALBase64 = class
3737 class function GetSizeDecode (ASize: Int64RAL): Int64RAL;
3838 end ;
3939
40- { $IF Defined(FPC) or Defined(DELPHIXE3UP)}
41- TRALBase64StringHelper = record helper for StringRAL
42- public
43- function toBase64 : StringRAL;
44- function fromBase64 : StringRAL;
45- end ;
46- { $IFEND}
47-
4840implementation
4941
5042const
@@ -433,18 +425,4 @@ class function TRALBase64.EncodeAsStream(AValue: TStream): TStream;
433425 Result.Position := 0 ;
434426end ;
435427
436- { TRALBase64StringHelper }
437-
438- { $IF Defined(FPC) or defined(DELPHIXE3UP)}
439- function TRALBase64StringHelper.fromBase64 : StringRAL;
440- begin
441- Result := TRALBase64.Decode(Self);
442- end ;
443-
444- function TRALBase64StringHelper.toBase64 : StringRAL;
445- begin
446- Result := TRALBase64.Encode(Self);
447- end ;
448- { $IFEND}
449-
450428end .
You can’t perform that action at this time.
0 commit comments