NSJSONSerialization: Implement NSJSONWritingSortedKeys

This commit is contained in:
Hugo Melder 2025-04-18 09:35:04 +02:00
parent 0606cb9db4
commit cc0d8d88e5
3 changed files with 58 additions and 10 deletions

View file

@ -50,7 +50,13 @@ enum
* If this is not set, then the writer will not generate any superfluous
* whitespace, producing space-efficient but not very human-friendly JSON.
*/
NSJSONWritingPrettyPrinted = (1UL << 0)
NSJSONWritingPrettyPrinted = (1UL << 0),
#if OS_API_VERSION(MAC_OS_X_VERSION_10_13, GS_API_LATEST)
/**
* When writing JSON, sort keys in lexicographic order.
*/
NSJSONWritingSortedKeys = (1UL << 1)
#endif
};
/**
* A bitmask containing flags from the NSJSONWriting* set, specifying options