GitHub - ustcfdm/matlab_jsonc: This repository have been merged into mango_matlab (https://github.com/ustcfdm/mango_matlab) · GitHub
Skip to content
This repository was archived by the owner on Feb 28, 2020. It is now read-only.

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

matlab_jsonc

MgRemoveJsoncComments: Remove comments in a json string for matlab to decode.
MgReadJsoncFile: Read and decode jsonc file.
MgSaveToJsonFile: Write structure to json file.

  • This code uses c library rapidjson.
  • C++ style comments are supported.
  • Tail comma is supported.

Example

% read json string with comments from a file
jsc = fileread("filename.jsonc");
% remove comments
js = MgRemoveJsoncComments(jsc);
% decode json string with internal function jsondecode
jo = jsondecode(js);

% directly read jsonc file
j = MgReadJsoncFile("filename.jsonc");

% write structure to json file
MgSaveToJsonFile(j, "filename2.jsonc");

About

This repository have been merged into mango_matlab (https://github.com/ustcfdm/mango_matlab)

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages