Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any easy way to create JSON? #1

Open
bubnenkoff opened this issue Sep 18, 2017 · 1 comment
Open

Is there any easy way to create JSON? #1

bubnenkoff opened this issue Sep 18, 2017 · 1 comment

Comments

@bubnenkoff
Copy link

printNode return text. Is the any easy way to make make JSON data-type?

@maxpoulin64
Copy link
Owner

That's a good question. It might be possible to use a normal JSON serializer on the object directly as it theoretically implements everything needed to traverse the object with some template madness, but the easiest route is most likely to just manually recurse into it like the example but store the values in a JSON object from the library of your choice. The example was really just a quick example.

The reason I went with such a weird data structure is that it's effectively a pointer to the right offset in the database file itself so it only ever reads what you use from the database on the fly (athough to be honest I have no idea whether the vtable pointer + slice + type enum ends up taking less space than just being dumb and loading everything in). It's also my first time parsing an unknown format like this on my own so I had a bit of fun making sure it would behave correctly even with broken databases.

I also only really needed the country code for the project I was working on at that time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants