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

replace default json serializer to improve readability #13185

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Jul 23, 2024

The default JSON serializer is done not in a very customizable fashion.
The default output is very naive and verbose, putting every single value on its own line, causing JSON dumps to take many many lines that make it hard to read.

E.g.:

    "principal-point": [
        317.4702453613281,
        237.2671356201172
    ]

Will now be:

    "principal-point": [317.4702453613281,237.2671356201172]

To do this, we have to override the default operator<< that json uses. This collides with the default implementation, so we disable json's default I/O, but this has other impacts.

Still, everything seems to work, but it adds many lines of code most of which are simply copies of the original.

Note we cannot override json::dump().

@maloel maloel requested a review from OhadMeir July 23, 2024 10:51
@maloel maloel merged commit 7e8a476 into IntelRealSense:development Jul 24, 2024
22 checks passed
@maloel maloel deleted the serializer branch July 24, 2024 08:46
maloel added a commit to maloel/librealsense that referenced this pull request Jul 25, 2024
maloel added a commit that referenced this pull request Jul 25, 2024
maloel added a commit to maloel/librealsense that referenced this pull request Jul 29, 2024
maloel added a commit that referenced this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants