Skip to content

Commit e7d880b

Browse files
authored
Atualização (#387)
2 parents ef3a238 + f1fcbd8 commit e7d880b

30 files changed

Lines changed: 1392 additions & 1224 deletions

CORE/Packages/Delphi/Connectors/Indy/RESTDWSocketIndy.dof

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,13 @@ OriginalFilename=
134134
ProductName=RESTDWSocketIndy
135135
ProductVersion=1.0.0.0
136136
ProgramID=com.embarcadero.RESTDWSocketIndy
137+
[HistoryLists\hlConditionals]
138+
Count=1
139+
Item0=DEBUG
140+
[HistoryLists\hlUnitAliases]
141+
Count=1
142+
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143+
[HistoryLists\hlUnitOutputDirectory]
144+
Count=2
145+
Item0=..\..\..\..\compiled
146+
Item1=..\..\..\compiled

CORE/Packages/Delphi/Connectors/Indy/RESTDWSocketIndy.dproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@
173173
</DelphiCompile>
174174
<DCCReference Include="RESTDWCore.dcp"/>
175175
<DCCReference Include="IndySystem.dcp"/>
176-
<DCCReference Include="IndyProtocols.dcp"/>
177176
<DCCReference Include="IndyCore.dcp"/>
177+
<DCCReference Include="IndyProtocols.dcp"/>
178178
<DCCReference Include="..\..\..\..\Source\Sockets\Indy\uRESTDWIdBase.pas"/>
179179
<BuildConfiguration Include="Base">
180180
<Key>Base</Key>
@@ -221,6 +221,12 @@
221221
<DeployFile LocalName="..\..\..\..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\22.0\Bpl\RESTDWSocketIndy.bpl" Configuration="Debug" Class="ProjectOutput"/>
222222
<DeployFile LocalName="..\..\..\..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\22.0\Bpl\Win64\RESTDWSocketIndy.bpl" Configuration="Debug" Class="ProjectOutput"/>
223223
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\RESTDWSocketIndy.bpl" Configuration="Debug" Class="ProjectOutput"/>
224+
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\RESTDWSocketIndy.bpl" Configuration="Debug" Class="ProjectOutput">
225+
<Platform Name="Win32">
226+
<RemoteName>RESTDWSocketIndy.bpl</RemoteName>
227+
<Overwrite>true</Overwrite>
228+
</Platform>
229+
</DeployFile>
224230
<DeployClass Name="AdditionalDebugSymbols">
225231
<Platform Name="OSX32">
226232
<Operation>1</Operation>

CORE/Packages/Delphi/RESTDWCore.dproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@
205205
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
206206
<DCC_DcuOutput>..\..\compiled</DCC_DcuOutput>
207207
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
208-
<VerInfo_Keys>CompanyName=XyberPower Desenvolvimento;FileDescription=$(MSBuildProjectName);FileVersion=2.1.0.98;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
208+
<VerInfo_Keys>CompanyName=XyberPower Desenvolvimento;FileDescription=$(MSBuildProjectName);FileVersion=2.1.0.101;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
209209
<VerInfo_Locale>1033</VerInfo_Locale>
210210
<VerInfo_MajorVer>2</VerInfo_MajorVer>
211211
<VerInfo_MinorVer>1</VerInfo_MinorVer>
212212
<DCC_Description>REST Dataware - Core</DCC_Description>
213-
<VerInfo_Build>98</VerInfo_Build>
213+
<VerInfo_Build>101</VerInfo_Build>
214214
<VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
215215
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
216216
</PropertyGroup>

CORE/Packages/Delphi/ShellTools/RESTDWShellServicesDesign.dof

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,3 @@ OriginalFilename=
134134
ProductName=RESTDWShellServicesDesign
135135
ProductVersion=1.0.0.0
136136
ProgramID=com.embarcadero.RESTDWShellServicesDesign
137-
[HistoryLists\hlConditionals]
138-
Count=1
139-
Item0=DEBUG
140-
[HistoryLists\hlUnitAliases]
141-
Count=1
142-
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
143-
[HistoryLists\hlUnitOutputDirectory]
144-
Count=1
145-
Item0=..\..\..\compiled

CORE/Source/Basic/Mechanics/uRESTDWBuffer.pas

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
AByteCount : Integer = -1;
7373
AAppend : Boolean = True;
7474
AIndex : Integer = -1);
75+
Procedure ExtractToBytesB (Var VBytes : TRESTDWBytes;
76+
AByteCount : Integer);
7577
Function IndexOf (Const AByte : Byte;
7678
AStartPos : Integer = 0) : Integer; Overload;
7779
Function IndexOf (Const ABytes : TRESTDWBytes;
@@ -212,6 +214,25 @@ implementation
212214
End;
213215
End;
214216

217+
Procedure TRESTDWBuffer.ExtractToBytesB(Var VBytes : TRESTDWBytes;
218+
AByteCount : Integer);
219+
Var
220+
LOldPosition,
221+
LOldSize : Integer;
222+
Begin
223+
If AByteCount < 0 Then
224+
AByteCount := Size;
225+
If AByteCount > 0 Then
226+
Begin
227+
LOldSize := 0;
228+
If Length(FBytes) > 0 Then
229+
Begin
230+
SetLength(VBytes, Length(FBytes));
231+
Move(FBytes[0], VBytes[0], Length(FBytes));
232+
End;
233+
End;
234+
End;
235+
215236
Procedure TRESTDWBuffer.ExtractToBuffer(ABuffer : TRESTDWBuffer;
216237
AByteCount : Integer = -1;
217238
Const AIndex : Integer = -1);

CORE/Source/Basic/Mechanics/uRESTDWCoder.pas

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ interface
7676
Procedure Decode(Const AIn : String); Overload;
7777
Procedure Decode(ASrcStream : TStream;
7878
Const ABytes : Integer = -1); Overload; Virtual; Abstract;
79-
Class Function DecodeString (Const AIn : String) : String;
80-
Class Function DecodeBytes (Const AIn : String) : TRESTDWBytes;
81-
Class procedure DecodeStream(Const AIn : String;
79+
Class Function DecodeString (Const AIn : AnsiString) : String;
80+
Class Function DecodeBytes (Const AIn : AnsiString) : TRESTDWBytes;
81+
Class procedure DecodeStream(Const AIn : AnsiString;
8282
ADestStream : TStream);
8383
End;
8484
TRESTDWDecoderClass = Class Of TRESTDWDecoder;
@@ -114,7 +114,7 @@ interface
114114
End;
115115
End;
116116

117-
Class Function TRESTDWDecoder.DecodeString(Const AIn : String) : String;
117+
Class Function TRESTDWDecoder.DecodeString(Const AIn : AnsiString) : String;
118118
Var
119119
LStream : TMemoryStream;
120120
Begin
@@ -128,7 +128,7 @@ interface
128128
End;
129129
End;
130130

131-
Class Function TRESTDWDecoder.DecodeBytes(const AIn : String) : TRESTDWBytes;
131+
Class Function TRESTDWDecoder.DecodeBytes(const AIn : AnsiString) : TRESTDWBytes;
132132
Var
133133
LStream : TMemoryStream;
134134
Begin
@@ -143,7 +143,7 @@ interface
143143
End;
144144
End;
145145

146-
Class Procedure TRESTDWDecoder.DecodeStream(Const AIn : String;
146+
Class Procedure TRESTDWDecoder.DecodeStream(Const AIn : AnsiString;
147147
ADestStream : TStream);
148148
Var
149149
LDecoder : TRESTDWDecoder;

CORE/Source/Basic/Mechanics/uRESTDWDataUtils.pas

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ interface
8181
VersionNumber,
8282
RecordCount,
8383
ParamsCount : DWInteger; //new for ver15
84-
DataSize : DWInt64; //new for ver15
84+
DataSize : DWInt64; //new for ver15
8585
End;
8686

8787
TTokenValue = Class
@@ -1991,14 +1991,11 @@ implementation
19911991
Cmd := Cmd + URLDecode(Params.Text)
19921992
Else
19931993
Cmd := URLDecode(Query);
1994-
// Uri := TIdURI.Create(Cmd);
19951994
Try
1996-
// vParams.Delimiter := '|';
19971995
vParams.Text := StringReplace(Cmd, '&', sLineBreak, [rfReplaceAll]);
19981996
If vParams.count = 0 Then
19991997
If Trim(Cmd) <> '' Then
20001998
vParams.DelimitedText := StringReplace(Cmd, sLineBreak, '&', [rfReplaceAll]); //Alterações enviadas por "joaoantonio19"
2001-
//vParams.Add(Cmd);
20021999
Finally
20032000
encodestrings := False;
20042001
For I := 0 To vParams.Count - 1 Do
@@ -2024,28 +2021,37 @@ implementation
20242021
If (vParams.names[I] <> '') And
20252022
(Trim(Query) <> '') Then
20262023
Begin
2027-
JSONParam.ParamName := Trim(Copy(vParams[I], 1, Pos('=', vParams[I]) - 1));
2028-
JSONParam.AsString := Trim(Copy(vParams[I], Pos('=', vParams[I]) + 1, Length(vParams[I])));
2024+
JSONParam.ParamName := vParamName;
2025+
vValue := Trim(Copy(vParams[I], Pos('=', vParams[I]) + 1, Length(vParams[I])));
20292026
If pos('dwencodestrings', lowercase(JSONParam.ParamName)) > 0 Then
2030-
encodestrings := StringToBoolean(JSONParam.AsString)
2027+
encodestrings := StringToBoolean(vValue)
20312028
Else If (encodestrings) And
20322029
(pos('dwwelcomemessage', lowercase(JSONParam.ParamName)) = 0) And
2033-
(pos('dwaccesstag', lowercase(JSONParam.ParamName)) = 0) And
2034-
(pos('datacompression', lowercase(JSONParam.ParamName)) = 0) And
2035-
(pos('dwencodestrings', lowercase(JSONParam.ParamName)) = 0) And
2036-
(pos('dwusecript', lowercase(JSONParam.ParamName)) = 0) And
2037-
(pos('dwassyncexec', lowercase(JSONParam.ParamName)) = 0) And
2038-
(pos('binaryrequest', lowercase(JSONParam.ParamName)) = 0) And
2030+
(pos('dwaccesstag', lowercase(JSONParam.ParamName)) = 0) And
2031+
(pos('datacompression', lowercase(JSONParam.ParamName)) = 0) And
2032+
(pos('dwencodestrings', lowercase(JSONParam.ParamName)) = 0) And
2033+
(pos('dwusecript', lowercase(JSONParam.ParamName)) = 0) And
2034+
(pos('dwassyncexec', lowercase(JSONParam.ParamName)) = 0) And
2035+
(pos('binaryrequest', lowercase(JSONParam.ParamName)) = 0) And
20392036
(pos('dwconnectiondefs', lowercase(JSONParam.ParamName)) = 0) And
20402037
(pos('dwservereventname', lowercase(JSONParam.ParamName)) = 0) Then
2041-
JSONParam.AsString := DecodeStrings(JSONParam.AsString{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF});
2038+
Begin
2039+
JSONParam.Encoded := False;
2040+
If MethodType = rtPost Then
2041+
JSONParam.AsString := DecodeStrings(DecodeStrings(vValue{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF})
2042+
{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF})
2043+
Else
2044+
JSONParam.AsString := DecodeStrings(vValue{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF});
2045+
End;
2046+
If JSONParam.IsNull Then
2047+
JSONParam.AsString := vValue;
20422048
End
20432049
Else
20442050
Begin
2045-
JSONParam.ParamName := IntToStr(I);
2046-
JSONParam.AsString := vParams[I];
2051+
JSONParam.ParamName := IntToStr(I);
2052+
vValue := vParams[I];
20472053
If pos('dwencodestrings', lowercase(JSONParam.ParamName)) > 0 Then
2048-
encodestrings := StringToBoolean(JSONParam.AsString)
2054+
encodestrings := StringToBoolean(vValue)
20492055
Else If (encodestrings) And
20502056
(pos('dwwelcomemessage', lowercase(JSONParam.ParamName)) = 0) And
20512057
(pos('dwaccesstag', lowercase(JSONParam.ParamName)) = 0) And
@@ -2056,7 +2062,16 @@ implementation
20562062
(pos('binaryrequest', lowercase(JSONParam.ParamName)) = 0) And
20572063
(pos('dwconnectiondefs', lowercase(JSONParam.ParamName)) = 0) And
20582064
(pos('dwservereventname', lowercase(JSONParam.ParamName)) = 0) Then
2059-
JSONParam.AsString := DecodeStrings(JSONParam.AsString{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF});
2065+
Begin
2066+
JSONParam.Encoded := False;
2067+
If MethodType = rtPost Then
2068+
JSONParam.AsString := DecodeStrings(DecodeStrings(vValue{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF})
2069+
{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF})
2070+
Else
2071+
JSONParam.AsString := DecodeStrings(vValue{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF});
2072+
End;
2073+
If JSONParam.IsNull Then
2074+
JSONParam.AsString := vValue;
20602075
End;
20612076
{$IFDEF RESTDWLAZARUS}
20622077
JSONParam.DatabaseCharSet := DatabaseCharSet;
@@ -2438,3 +2453,4 @@ implementation
24382453

24392454
end.
24402455

2456+

0 commit comments

Comments
 (0)