Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / JSON file checking

Author
Message
TamBam
12
Years of Service
User Offline
Joined: 29th Nov 2011
Location: India
Posted: 27th Nov 2022 15:14
Is their any function or method that can check coming data is a valid json files ?
Thankyou .
PartTimeCoder
AGK Tool Maker
8
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 30th Nov 2022 10:33
not an inbuild method, you would need either a json plugin that is capable of checking the json DOM or code a rudimentary phaser to check the syntax.
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 30th Nov 2022 11:03
If you are in control of the creation of the json then i would have a confirmation variable that affirmed that the the data was correct
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Nov 2022 23:43
this site has source in c which is handy for the tier1 developers
a plugin could be made or ofcourse converted to tier2
http://www.json.org/JSON_checker/
PK
PartTimeCoder
AGK Tool Maker
8
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 1st Dec 2022 11:29
just include as extern "C" and you can use it in Tier2 but personally speaking in that case I'd just use RapidJSON and have full a json implementation.

Does AppGameKit need full json support??

I'd be happy to code it
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 1st Dec 2022 16:23
I haven't followed this thread completely but maybe it helps that I wrote a JSON reader in tier 1 some time ago.

see here.
https://forum.thegamecreators.com/thread/218297
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Donations are always welcome.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Dec 2022 02:55
Very handy MadBit, you always have produced very professional tools and plugins
PK
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 2nd Dec 2022 08:28
Thank you.

I had made it available when there was no way to export or import JSON files with AppGameKit.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Donations are always welcome.
PartTimeCoder
AGK Tool Maker
8
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 2nd Dec 2022 12:29
Thats a pretty solid library, nice one
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Dec 2022 18:21
I'm gonna have to check that code out myself. Having written an xml importer myself (no export), I an appreciate the hassle it probably took to parse something like this into a procedural language.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda
Pixel-Perfect Collision

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

TamBam
12
Years of Service
User Offline
Joined: 29th Nov 2011
Location: India
Posted: 6th Dec 2022 06:59
Thank you everyone .
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 20th Jan 2023 14:55
Sorry to reply so late, but I thought it's worth mentioning that AppGameKit does have some built-in JSON commands. For example, Types can be converted to and from JSON like so:


(Taken straight from the docs)

Arrays can also be saved and loaded as JSON really easily using MyArray.save("filename.json") and MyArray.load("filename.json").

Can be tricky to find info on this in the docs as it only appears under Guides/Arrays Enhanced, so they don't offer much help when pressing F1, but these built-in JSON commands are super useful and work great.
Bored of the Rings
User Banned
Posted: 23rd Jan 2023 21:25
This thread is about checking the validity of JSON files, not the commands available for JSON support. Anyway, this is all too easy, I will upload examples of JSON validation checking as soon as possible. There are a few ways to achieve this. more to come
Pro Programmer / Data Scientist, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others

Login to post a reply

Server time is: 2024-03-01 06:29:57
Your offset time is: 2024-03-01 06:29:57