-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Json unicode escape && preserveOrder keys sync #2145
Conversation
aleks-f
commented
Feb 7, 2018
- JSON Stringify Unicode Escape functionality breaking change with 1.8.0 JSON Stringify Unicode Escape functionality breaking change with 1.8.0 #2137
- JSON::Object preserveOrder keys not synced on assignment JSON::Object preserveOrder keys not synced on assignment #2142
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my inline comment.
JSON/include/Poco/JSON/Object.h
Outdated
|
||
explicit Object(bool preserveInsertionOrder = false); | ||
explicit Object(bool preserveInsertionOrder = false, bool escapeUnicode = false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should think about introducing an options enum for the various places where we use preserveInsertionOrder and escapeUnicode, and use an int options
instead of a potentially growing list of bool args. If we just change the Object constructor to:
Object(int options = 0);
and define:
enum Options
{
JSON_OPT_PRESERVE_INSERTION_ORDER = 1,
JSON_OPT_ESCAPE_UNICODE = 2
};
Then the new constructor taking int
will be backwards compatible to the one taking bool
.
This looks great, thanks again! |
* Only escape compulsory characters for JSON by default * add enable/disable unicode escaping flags to stringify pocoproject#2137 * JSON::Object preserveOrder keys not synced on assignment pocoproject#2142 * fix assignment preserveOrder and add object copy tests * add object move tests * fix comment * enum for JSON::Object options
Signed-off-by: Lloyd-Pottiger <[email protected]>
* Pick pocoproject#2145 Signed-off-by: Lloyd-Pottiger <[email protected]> * Pick pocoproject#2153 Signed-off-by: Lloyd-Pottiger <[email protected]> --------- Signed-off-by: Lloyd-Pottiger <[email protected]>