1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Add more information about DynamicObject::writeAsJSON() to BREAKING_CHANGES.md

This commit is contained in:
attila 2023-12-12 13:12:54 +01:00
parent b91fec7787
commit 38f10fcacd

View file

@ -33,15 +33,25 @@ more extensible JSON::FormatOptions argument.
**Possible Issues**
Code that overrides this function will fail to compile.
Code that overrides or calls this function will fail to compile.
**Workaround**
Update the signatures of overriding functions. Use Formatter::getIndentLevel()
and Formatter::getMaxDecimalPlaces() as necessary. To find whether the output
should be multi-line, compare the result of Formatter::getSpacing() with
Update the signatures of overriding functions. Use FormatOptions::getIndentLevel()
and FormatOptions::getMaxDecimalPlaces() as necessary. To find whether the output
should be multi-line, compare the result of FormatOptions::getSpacing() with
JSON::Spacing::multiLine.
Callers of the function can construct the new argument type using the old
arguments accordingly
```
JSON::FormatOptions{}.withIndentLevel (indentLevel)
.withSpacing (allOnOneLine ? JSON::Spacing::singleLine
: JSON::Spacing::multiLine)
.withMaxDecimalPlaces (maximumDecimalPlaces);
```
**Rationale**
The previous signature made it impossible to add new formatting options. Now,