Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using fastJSON to serialize a small structure.

The output string has one long line rather than the
multi-line format that I was expecting.
The format I expected essentially puts every simple
variable on its own line. "varname": varvalue

It would just make it much more human readable friendly.

Is there a switch that I'm missing?

Thanks.

Using latest version of fastJSON, as of 16 Jul 2015,
that I just rebuilt from source.
Using Visual Studio 2008 on legacy VB.net project.

fastJSON is amazing - easy to use, small, fast.

current output string:
VB
{"$types":{"xEasyNav.User+uShip_Type, xEasyNav, Version=8.5.5675.16993, Culture=neutral, PublicKeyToken=null":"1"},"$type":"1","LineColor":16711680,"LineWidth":2,"SymbolColor":65535,"symbolsize":36,"DotColor":16711680,"dotsize":2,"cog_extension":0.25,"cog_extension_min_speed":0,"cog_extension_based_on_Time":false,"cog_extension_interval":0.00416666666666667,"YesToFix":false,"FixInterval":0.00208333333333333,"YesToDot":true,"DotInterval":0.000138888888888889,"AutoOpenNextChart":true,"bFwd":0.0246872942725477,"bAft":0.0246872942725477,"bPort":0.00658327847267939,"bStbd":0.00658327847267939,"Reset_Renamed":25,"TrackColor":65280,"TrackColor_Alternate":16711680,"TrackSize":3,"NextChartDistance":0.2,"FillColor":12632256,"Show_Dashed_Line_To_Mark":true,"cog_Change":5,"Rotate_To_Heading":false,"Max_Chart_Ahead":false,"moving_Map":false,"Find_Best_Chart":true,"Show_Rings":true,"Ring_Radius":0.75,"Ring_color":16711680,"Ring_Size":2,"Ring_Count":3,"Always_Plot_Track":false,"River_Mode":false,"Track_By_Distance":false,"Track_Distance":0,"Track_Distance_Units":0}
Posted
Comments
Dave Kreskowiak 16-Jul-15 15:17pm    
This is minimized JSON. All the white space is removed to make it as small as possible.

So what's the problem?

Ask the guy who wrote it in the forum at the bottom of this article[^].
 
Share this answer
 
I was missing a function.
There is a beautify command, which when given the
compressed form returns a string broken into short
lines with meaningful indentation.

A computer doesn't care which form it uses, but
for humans, the "beautified" form is much more pleasant.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900