-
Notifications
You must be signed in to change notification settings - Fork 159
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
Consider public TJsonWriter #32
Comments
JsonDataObject uses Data-Objects and is per definition a DOM parser. Changing JsonDataObject to be a SAX parser won't happen in the near future as I personally don't need it (yet). But pull requests are welcome. |
I'm with you. I think DOM parser is fine. What I suggested is actually more like a json string builder. at present, it is done by two steps: json.FromSimpleObject(obj); An intermediate DOM is not necessary in this task. P.S. FromSimpleObject is close and very limited. |
I don't need To/FromSimpleObject myself. I only added it to have at least something simple (and Delphi 2009 compatible) in the unit for others. Your example of a TJsonWriter wouldn't be that hard to implement, so I may consider it. |
A fluent interface JsonWriter is very welcome! It is now in my TODO list. Righ now I'm using it mostly to write log as Json, like this:
For my fluent interface I have methods like:
I also have methods for Array, Null, and need to implement for Date, so it will be handled by the overloaded method. |
It is often not necessary to create DOM (JsonObject) when serializing objects to a stream. It is more efficient to expose a public TJsonWriter to perform such task.
TJsonOutputWriter is used internally so far. Also, UTF8String should be considered in this part.
The text was updated successfully, but these errors were encountered: