Графический интерфейс в aria2c RPC http://blindage.org/?p=5385
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

50 lines
777 B

unit json;
interface
uses
SysUtils, fpjson,jsonparser;
type
TJSON = class(TJSONObject)
public
function ifExistKey(aKey: string): Boolean;
function Parse(aString: string): Boolean;
end;
implementation
function TJSON.ifExistKey(aKey: string): Boolean;
begin
result:=(Find(aKey)<>nil);
end;
function TJSON.Parse(aString: string): Boolean;
var
D : TJSONData;
P : TJSONParser;
jodata: TJSONData;
joname: String;
begin
result:=false;
P:=TJSONParser.Create(aString);
D:=P.Parse;
FreeAndNil(P);
Clear;
try
while D.Count>0 do begin
joname:=TJSONObject(D).Names[0];
jodata:=TJSONObject(D).Extract(0);
Add(joname,jodata);
end;
except
FreeAndNil(D);
exit;
end;
FreeAndNil(D);
result:=true;
end;
end.