Browse Source

* Added ability to sort TJSONArray

git-svn-id: trunk@32038 -
joost 9 years ago
parent
commit
e388a39e3d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      packages/fcl-json/src/fpjson.pp

+ 6 - 0
packages/fcl-json/src/fpjson.pp

@@ -430,6 +430,7 @@ Type
     procedure Insert(Index: Integer; AnObject: TJSONObject);
     procedure Move(CurIndex, NewIndex: Integer);
     Procedure Remove(Item : TJSONData);
+    Procedure Sort(Compare: TListSortCompare);
     // Easy Access Properties.
     property Items;default;
     Property Types[Index : Integer] : TJSONType Read GetTypes;
@@ -2338,6 +2339,11 @@ begin
   FList.Remove(Item);
 end;
 
+procedure TJSONArray.Sort(Compare: TListSortCompare);
+begin
+  FList.Sort(Compare);
+end;
+
 { TJSONObject }
 
 function TJSONObject.GetArrays(const AName: String): TJSONArray;