You've already forked lazarus-ccr
Define TBinaryString ( = ansistring ) and use it in base64 BinaryData
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@532 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -274,7 +274,7 @@ type
|
|||||||
|
|
||||||
TBase64StringRemotable = class(TAbstractSimpleRemotable)
|
TBase64StringRemotable = class(TAbstractSimpleRemotable)
|
||||||
private
|
private
|
||||||
FBinaryData : string;
|
FBinaryData : TBinaryString;
|
||||||
private
|
private
|
||||||
function GetEncodedString : string;
|
function GetEncodedString : string;
|
||||||
procedure SetEncodedString(const AValue : string);
|
procedure SetEncodedString(const AValue : string);
|
||||||
@ -294,7 +294,7 @@ type
|
|||||||
|
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
function Equal(const ACompareTo : TBaseRemotable) : Boolean;override;
|
function Equal(const ACompareTo : TBaseRemotable) : Boolean;override;
|
||||||
property BinaryData : string read FBinaryData write FBinaryData;
|
property BinaryData : TBinaryString read FBinaryData write FBinaryData;
|
||||||
property EncodedString : string read GetEncodedString write SetEncodedString;
|
property EncodedString : string read GetEncodedString write SetEncodedString;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -619,7 +619,7 @@ type
|
|||||||
|
|
||||||
TBase64StringExtRemotable = class(TBaseComplexSimpleContentRemotable)
|
TBase64StringExtRemotable = class(TBaseComplexSimpleContentRemotable)
|
||||||
private
|
private
|
||||||
FBinaryData : string;
|
FBinaryData : TBinaryString;
|
||||||
private
|
private
|
||||||
function GetEncodedString() : string;
|
function GetEncodedString() : string;
|
||||||
procedure SetEncodedString(const AValue : string);
|
procedure SetEncodedString(const AValue : string);
|
||||||
@ -629,7 +629,7 @@ type
|
|||||||
public
|
public
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
function Equal(const ACompareTo : TBaseRemotable) : Boolean;override;
|
function Equal(const ACompareTo : TBaseRemotable) : Boolean;override;
|
||||||
property BinaryData : string read FBinaryData write FBinaryData;
|
property BinaryData : TBinaryString read FBinaryData write FBinaryData;
|
||||||
property EncodedString : string read GetEncodedString write SetEncodedString;
|
property EncodedString : string read GetEncodedString write SetEncodedString;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ type
|
|||||||
TBaseXOptions = set of TBaseXOption;
|
TBaseXOptions = set of TBaseXOption;
|
||||||
|
|
||||||
function Base64Encode(const ALength : PtrInt; const AInBuffer) : string;overload;
|
function Base64Encode(const ALength : PtrInt; const AInBuffer) : string;overload;
|
||||||
function Base64Encode(const AInBuffer : string) : string;overload;
|
function Base64Encode(const AInBuffer : TBinaryString) : string;overload;
|
||||||
|
|
||||||
function Base64Decode(const AInBuffer : string; const AOptions : TBaseXOptions = [xoDecodeIgnoreIllegalChar]) : string;
|
function Base64Decode(const AInBuffer : string; const AOptions : TBaseXOptions = [xoDecodeIgnoreIllegalChar]) : TBinaryString;
|
||||||
|
|
||||||
resourcestring
|
resourcestring
|
||||||
s_InvalidEncodedData = 'Invalid encoded data.';
|
s_InvalidEncodedData = 'Invalid encoded data.';
|
||||||
@ -111,7 +111,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Base64Encode(const AInBuffer : string) : string;
|
function Base64Encode(const AInBuffer : TBinaryString) : string;
|
||||||
begin
|
begin
|
||||||
if ( Length(AInBuffer) = 0 ) then
|
if ( Length(AInBuffer) = 0 ) then
|
||||||
Result := ''
|
Result := ''
|
||||||
@ -119,7 +119,7 @@ begin
|
|||||||
Result := Base64Encode(Length(AInBuffer),AInBuffer[1]);
|
Result := Base64Encode(Length(AInBuffer),AInBuffer[1]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Base64Decode(const AInBuffer : string; const AOptions : TBaseXOptions) : string;
|
function Base64Decode(const AInBuffer : string; const AOptions : TBaseXOptions) : TBinaryString;
|
||||||
var
|
var
|
||||||
locBuffer : PByte;
|
locBuffer : PByte;
|
||||||
locInLen, locInIndex, i, locPadded : PtrInt;
|
locInLen, locInIndex, i, locPadded : PtrInt;
|
||||||
|
@ -100,7 +100,7 @@ type
|
|||||||
AVisibility : TPasMemberVisibility;
|
AVisibility : TPasMemberVisibility;
|
||||||
const ASourceFilename : String;
|
const ASourceFilename : String;
|
||||||
ASourceLinenumber : Integer
|
ASourceLinenumber : Integer
|
||||||
): TPasElement;override;overload;
|
): TPasElement;overload;override;
|
||||||
function CreateArray(
|
function CreateArray(
|
||||||
const AName : string;
|
const AName : string;
|
||||||
AItemType : TPasType;
|
AItemType : TPasType;
|
||||||
|
@ -20,6 +20,9 @@ interface
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
{ reprents an array of Byte }
|
||||||
|
TBinaryString = ansistring;
|
||||||
|
|
||||||
{ TDataObject }
|
{ TDataObject }
|
||||||
|
|
||||||
TDataObject = class
|
TDataObject = class
|
||||||
|
Reference in New Issue
Block a user