Skip to content

Commit

Permalink
Migrate TALJsonDocument to TALJsonNode
Browse files Browse the repository at this point in the history
* The support for doNodeAutoCreate has been removed.
* The properties TALJsonDocument.Duplicates and TALJsonDocument.Sorted are now
  only applied to the child nodes list and are not inherited anymore.
* The properties TALJsonDocument.ParseOptions and TALJsonDocument.Options have
  been moved as parameters for the methods loadFromJson/saveToJson and
  loadFromBson/saveToBson.
* TALJsonDocument.Duplicates has been moved to the child nodes list.
* The ClearChildNodes parameter from loadFromJson/saveToJson has been moved to
  the options of loadFromJson/saveToJson.
* The property TALJSONNode.ownerDocument has been removed.
* FormatSettings has been removed.
* The property TALJsonDocument.Tag has been removed.
* TALJsonDocument.PathSeparator has been replaced by ALDefaultJsonPathSeparator.
* TALJsonDocument.NodeIndentStr has been replaced by ALDefaultJsonNodeIndentA.
* TALJsonDocument.node has been removed.
* TALJsonDocument.create now returns a TALJsonNode.
* TALJsonDocument.IsEmptyDoc has been replaced by hasChildNodes.
* The method TALJsonDocument.ExtractNode has been removed.
* The property TALJsonDocument.Active has been removed.
* The method TALJsonDocument.ReleaseDoc has been removed.
* The ParseStartDocument and ParseEndDocument events have been removed.
* TALJsonDocument.clear has been moved to childnodes.clear.
* The events onParseText, onParseStartObject, onParseEndObject,
  onParseStartArray, and onParseEndArray have been moved to ParseBSON/ParseJSON.
  • Loading branch information
Zeus64 committed Jul 19, 2023
1 parent e686af7 commit e023d5e
Show file tree
Hide file tree
Showing 19 changed files with 10,567 additions and 20,595 deletions.
33 changes: 19 additions & 14 deletions Demos/ALDatabaseBenchmark/_Source/Unit1.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ object Form1: TForm1
item
Width = 200
end>
ExplicitTop = 743
ExplicitWidth = 999
end
object Panel3: TPanel
Left = 0
Expand All @@ -37,25 +39,27 @@ object Form1: TForm1
Align = alClient
Caption = 'Panel2'
TabOrder = 2
ExplicitWidth = 999
ExplicitHeight = 414
object Splitter4: TSplitter
Left = 709
Left = 705
Top = 1
Height = 414
Height = 413
Align = alRight
ExplicitLeft = 624
ExplicitTop = -3
ExplicitHeight = 469
end
object Panel5: TPanel
Left = 712
Left = 708
Top = 1
Width = 294
Height = 414
Height = 413
Align = alRight
Caption = 'Panel2'
TabOrder = 0
ExplicitLeft = 708
ExplicitHeight = 413
ExplicitLeft = 704
ExplicitHeight = 412
object ALMemoResult: TcxMemo
Left = 1
Top = 1
Expand All @@ -71,6 +75,7 @@ object Form1: TForm1
Style.Font.Style = []
Style.IsFontAssigned = True
TabOrder = 0
ExplicitHeight = 410
Height = 411
Width = 292
end
Expand All @@ -83,11 +88,13 @@ object Form1: TForm1
Align = alClient
Caption = 'Panel2'
TabOrder = 1
ExplicitWidth = 700
ExplicitHeight = 412
object GridThread: TcxGrid
Left = 1
Top = 1
Width = 706
Height = 412
Width = 702
Height = 411
Align = alClient
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Expand All @@ -96,8 +103,8 @@ object Form1: TForm1
Font.Style = []
ParentFont = False
TabOrder = 0
ExplicitWidth = 702
ExplicitHeight = 411
ExplicitWidth = 698
ExplicitHeight = 410
object TableViewThread: TcxGridTableView
Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.First.Visible = False
Expand Down Expand Up @@ -187,17 +194,15 @@ object Form1: TForm1
TabOrder = 0
Properties.ActivePage = Firebird
Properties.CustomButtons.Buttons = <>
ExplicitWidth = 999
ClientRectBottom = 324
ClientRectLeft = 5
ClientRectRight = 998
ClientRectTop = 27
object Firebird: TcxTabSheet
Caption = 'Firebird'
ImageIndex = 2
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 993
ExplicitHeight = 0
ExplicitWidth = 989
object Label2: TcxLabel
Left = 71
Top = 93
Expand Down
15 changes: 5 additions & 10 deletions Demos/ALDatabaseBenchmark/_Source/Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3035,7 +3035,7 @@ procedure TMongoDBBenchmarkThread.Execute;
aSelector: AnsiString;
aSkip: integer;
aFirst: integer;
aJSONDATA: TALJSONDocumentA;
aJSONDATA: TALJSONNodeA;
begin

aJSONDATA := TALJSONDocumentA.create;
Expand Down Expand Up @@ -3087,7 +3087,7 @@ procedure TMongoDBBenchmarkThread.Execute;
nil));

//update the data
aJSONDATA.Clear;
aJSONDATA.ChildNodes.Clear;
aStopWatch := TStopWatch.StartNew;
if fCMD = 'SELECT' then Tform1(fOwner).MongoDBConnectionPoolClient.SelectData(
aFullCollectionName,
Expand All @@ -3097,7 +3097,7 @@ procedure TMongoDBBenchmarkThread.Execute;
'', // rowtag
aSkip,
aFirst,
aJSONDATA.Node)
aJSONDATA)
else if fCMD = 'UPDATE' then Tform1(fOwner).MongoDBConnectionPoolClient.UpdateData(
aFullCollectionName,
aQuery,
Expand Down Expand Up @@ -3688,7 +3688,7 @@ procedure TForm1.ALButtonMemcachedVersionClick(Sender: TObject);
{***********************************************************}
procedure TForm1.ALButtonMongoDBSelectClick(Sender: TObject);
Var aMongoDBClient: TAlMongoDBClient;
aJSONDATA: TALJSONDocumentA;
aJSONDATA: TALJSONNodeA;
aStopWatch: TstopWatch;
aFlags: TALMongoDBClientSelectDataFlags;
begin
Expand All @@ -3703,11 +3703,6 @@ procedure TForm1.ALButtonMongoDBSelectClick(Sender: TObject);
aJSONDATA := TALJSONDocumentA.create;
Try

With aJSONDATA Do Begin
Options := [TALJSONDocOption(doNodeAutoIndent)];
ParseOptions := [];
end;

aflags := [];
if CheckGroupMongoDBSelectFlags.States[0] = cbsChecked then aflags := aflags + [sfSlaveOk];
if CheckGroupMongoDBSelectFlags.States[1] = cbsChecked then aflags := aflags + [sfPartial];
Expand Down Expand Up @@ -3753,7 +3748,7 @@ procedure TForm1.ALButtonMongoDBSelectClick(Sender: TObject);
SQLFastTagReplaceFunct,
True,
nil)),
aJSONDATA.Node);
aJSONDATA);
aStopWatch.Stop;

TableViewThread.DataController.RecordCount := 1;
Expand Down
2 changes: 1 addition & 1 deletion Demos/ALJsonDoc/_Source/ALJsonDocDemo.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ProjectGuid>{E9B8CD6B-2DE3-408B-8DE3-5D9DECEE4A5A}</ProjectGuid>
<MainSource>ALJsonDocDemo.dpr</MainSource>
<Base>True</Base>
<Config Condition="&#39;$(Config)&#39;==&#39;&#39;">Debug</Config>
<Config Condition="&#39;$(Config)&#39;==&#39;&#39;">Release</Config>
<TargetedPlatforms>3</TargetedPlatforms>
<AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType>
Expand Down
47 changes: 0 additions & 47 deletions Demos/ALJsonDoc/_Source/superdate.pas

This file was deleted.

Loading

0 comments on commit e023d5e

Please sign in to comment.