* Add joIgnoreDuplicates

git-svn-id: trunk@45840 -
This commit is contained in:
michael 2020-07-24 11:03:25 +00:00
parent e1c1bd3d60
commit 3d333a1d17
2 changed files with 3 additions and 2 deletions

View File

@ -129,7 +129,8 @@ begin
// Add to existing structural type
if (FStruct is TJSONObject) then
begin
TJSONObject(FStruct).Add(FKey,AValue);
if (Not (joIgnoreDuplicates in options)) or (TJSONObject(FStruct).IndexOfName(FKey)=-1) then
TJSONObject(FStruct).Add(FKey,AValue);
FKey:='';
end
else if (FStruct is TJSONArray) then

View File

@ -51,7 +51,7 @@ type
EScannerError = class(EParserError);
TJSONOption = (joUTF8,joStrict,joComments,joIgnoreTrailingComma);
TJSONOption = (joUTF8,joStrict,joComments,joIgnoreTrailingComma,joIgnoreDuplicates);
TJSONOptions = set of TJSONOption;
Const