Questions tagged [superobject]

The SuperObject JSON library created by Henri Gourvest for Delphi and FreePascal(Lazarus, CodeTyphon, etc)

After Henri Gourvest quitted his involvement in Delphi and shut down his original site, his projects were moved to OpenSource source hosts, mostly onto Google Code.

The very name and design (and usage patterns) may be were influenced by this concept http://communitywiki.org/en/SuperObject

57 questions
10
votes
4 answers

How to create JSON-file in Delphi using SuperObject lib?

I'm using Delphi 2010 and superobject library. I have understand how to parse json-file, but I have no ideas how to create json? The algorithm is: Parsing JSON and load in TStringGrid Adding data Save all TStringGrid data to json. Need some…
Romowski
  • 1,518
  • 5
  • 25
  • 50
9
votes
1 answer

How to use SuperObject to invoke methods that uses an Object as parameter in Delphi?

We can use the SuperObject library to invoke methods of a certain object by its name and giving its parameters as a json string using the SOInvoker method like in this answer I'd like to know how do I send a created object as a parameter. I tried to…
Haruki
  • 674
  • 1
  • 9
  • 24
8
votes
3 answers

Delphi / SuperObject - Accessing Subnodes

I have the following JSON from my server: { "userid":"12", "username":"TestChar", "logged":"yes", "status":"Premium User", "areas":{ "SERVICEAREA_XX1":{ "id":"1", "area":"SERVICEAREA_XX1", …
Michael Grenzer
  • 503
  • 1
  • 9
  • 20
7
votes
2 answers

How to check if a particular element exists in SuperObject?

I widely use the SuperObject JSON library. I need to be able to check if a particular element exists in an object or not. I can check the value of an element, for example an integer that doesn't exist returns 0. However, 0 is one of the possible…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
6
votes
0 answers

JUST SHARE - MySQL DataSet into Json Format using delphi SuperObject

Just share my experience using Json using Delphi SuperObject The idea is how to convert my query result into json format easily. I use string to represent all data format (including BLOB, DATE, DATETIME). In future the json file can be imported…
yuda
  • 121
  • 1
  • 7
6
votes
2 answers

How to serialize JSON key containing dots (like e.g. IP address) with SuperObject?

I'm trying to save JSON where IP is a key. Expected JSON result is: {"SnmpManagers":[{"10.112.25.235":162}]} The Delphi SuperObject code: const IpAddr = '10.112.25.235'; Port = 162; var tmp: TSuperObject; begin tmp := TSuperObject.Create; …
Dr.eel
  • 1,837
  • 3
  • 18
  • 28
6
votes
1 answer

SuperObject - Extract All

How to get ALL 'id' member values from a generic JSON. Without knowing structure of it. Because its very complex and it has a lot of sub objects. It has to loop through all the sub objects. Again for people that keep on asking where is the example…
Nuno Jemaio
  • 163
  • 2
  • 11
5
votes
2 answers

Why does my code not compile, but rather gets E2506 Method of parameterized type declared in interface section must not use local symbol

I am using Delphi XE. The following unit fails to compile with this error: [DCC Error] GTSJSONSerializer.pas(27): E2506 Method of parameterized type declared in interface section must not use local symbol…
Nick Hodges
  • 16,902
  • 11
  • 68
  • 130
5
votes
2 answers

Delphi XE7: How to change a JSON value using System.JSON (versus SuperObject)

I need to load a JSON file, change a value and then write it back to disk. This is easy using SuperObject, but how do I do the same thing using the System.JSON unit? const PathToX =…
Rob
  • 155
  • 1
  • 12
4
votes
1 answer

Delphi Superobject, generic list to json

I have a object with some TObjectList<>-fields that I try to encode as JSON with help form SuperObject. TLogs = TObjectList; TMyObject = class(TObject) private FLogs: TLogs; end; Deep inside SuperObjects code, there is a ToClass procedure,…
Vegar
  • 12,828
  • 16
  • 85
  • 151
4
votes
1 answer

Why TJson.ObjectToJsonObject/ObjectToJsonString represents record fields as a JSON array?

There is an inconsistency of how SuperObject and TJson.ObjectToJsonObject represent certain parts of a class (i.e. Record fields). Let's have the following code snippet: Uses rest.json, superobject; type TSimplePersonRec = record …
iPath ツ
  • 2,468
  • 20
  • 31
4
votes
1 answer

Alternative to using StringReplace to remove unwanted characters from a JSON response

I am working on a small project that that requires me to parse a JSON file and place the results in a database. I am using SuperOjbect to parse the file and generate the results, but I have hit a bit of a roadblock and could use some…
user3839120
  • 113
  • 1
  • 6
4
votes
2 answers

SuperObject - Parsing data from a fieldname with a "." literal

I recently came up against a wall when parsing JSON. You see, when working with the CloudFlare Client Interface API, i wanted to lookup the "threat rating" for a specific IP. The issue is that due to the design of the API, the format is something…
Scott P
  • 1,462
  • 1
  • 19
  • 31
3
votes
1 answer

Alter Json with SuperObect

I'm using SuperObject to work with Json/Delphi I have a function that take a string and create a var superobject type, I need to check if it has an object (in my case is 'smtp') and if it don't, i create. The problem is: 'smtp' has children, example…
3
votes
1 answer

How to check if SuperObject is valid?

When creating a SuperObject from a string, it might happen that the string is no valid JSon. Unfortunately the command SO doesn't raise an exception in that case. I end up with a object where I THINK I can store data in, but the "stored" data goes…
ralfiii
  • 584
  • 4
  • 13
1
2 3 4