Skip to content

Commit 67766ee

Browse files
committed
- Correção de compilação para Lazarus para usar type helper ao invés de record helper
- Mudança do Helper de base64 para RALTypes, por padronização do código - Ajuste de versionamento
1 parent d198c93 commit 67766ee

3 files changed

Lines changed: 29 additions & 23 deletions

File tree

src/base/RALConsts.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface
1313

1414
const
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;

src/base/RALTypes.pas

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
interface
99

1010
{$I ..\base\PascalRAL.inc}
11+
{$IFDEF FPC}
12+
{$modeswitch typehelpers}
13+
{$ENDIF}
1114

1215
uses
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+
6273
const
6374
{$IF Defined(FPC) OR Defined(DELPHIXE3UP)}
6475
POSINISTR = Low(String);
@@ -84,6 +95,9 @@ function ISO8601ToDate(const AValue: StringRAL): TDateTime;
8495

8596
implementation
8697

98+
uses
99+
RALBase64;
100+
87101
function RALHighStr(const AStr: StringRAL): integer;
88102
begin
89103
{$IF NOT Defined(FPC) AND NOT Defined(DELPHIXE3UP)}
@@ -151,4 +165,18 @@ function ISO8601ToDate(const AValue: StringRAL): TDateTime;
151165
end;
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+
154182
end.

src/utils/RALBase64.pas

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff 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-
4840
implementation
4941

5042
const
@@ -433,18 +425,4 @@ class function TRALBase64.EncodeAsStream(AValue: TStream): TStream;
433425
Result.Position := 0;
434426
end;
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-
450428
end.

0 commit comments

Comments
 (0)