[Smtk-developers] JSON in SMTK

Bob Obara bob.obara at kitware.com
Thu Sep 14 11:06:29 EDT 2017


Sounds like a plan - I’d say lets go ahead - unless anyone has any questions/objections.

I’m wondering if the same mechanism you used to have it understand UUID would work with our other objects (attributes, models, etc..)?  We would still need to have the ability to deal with different versions when storing the JSON info in files.


Bob

Robert M. O'Bara, MEng.
Assistant Director of Scientific Computing

Kitware Inc.
28 Corporate Drive
Suite 101
Clifton Park, NY 12065

Phone: (518) 881- 4931




> On Sep 14, 2017, at 10:52 AMEDT, David Thompson <david.thompson at kitware.com> wrote:
> 
> I think since it is header-only that we would not need to mangle it, but rather install it inside the smtk include tree (e.g., include/smtk/thirdparty/nlohmann_json) so that others can use exactly the version SMTK is compiled with. We can define a macro (yes!) for nlohmann's include path so that it is possible to use an external version or third party version:
> 
> #include "smtk/Options.h"
> #include SMTK_NLOHMANN_JSON_H
> 
>     David
> 
> On Sep 14, 2017, at 10:44, Bob Obara <bob.obara at kitware.com <mailto:bob.obara at kitware.com>> wrote:
> 
>> I definitely like the nlohmann version better - did we determine if we need to mangle it?  
>> 
>> So should it and pugiXML be moved into the superbuild in the near future as external projects?
>> 
>> Bob
>> 
>> 
>> Robert M. O'Bara, MEng.
>> Assistant Director of Scientific Computing
>> 
>> Kitware Inc.
>> 28 Corporate Drive
>> Suite 101
>> Clifton Park, NY 12065
>> 
>> Phone: (518) 881- 4931
>> 
>> 
>> 
>> 
>>> On Sep 13, 2017, at 5:37 PMEDT, David Thompson <david.thompson at kitware.com <mailto:david.thompson at kitware.com>> wrote:
>>> 
>>> Hi all,
>>> 
>>> I've looked a little more into jsoncpp and nlohmann_json. Attached is my experiment with syntax and getting UUIDs and arrays of UUIDs serialized. nlohmann does not require calls to converter functions nor does it even require a converter... UUIDs just worked (however, we probably want a converter as its default behavior writes UUIDs as JSON arrays of unsigned integers).
>>> 
>>> I continue to like nlohmann and dislike jsoncpp in terms of terseness and legibility of the resulting code. The one thing I dislike about nlohmann is that the repo seems to contain super-huge test files, making it slow to clone.
>>> 
>>> Attached are example programs for each library that do the same thing (create JSON data including UUIDs). I have not tried parsing/dumping large objects.
>>> 
>>> 	David
>>> 
>>> 
>>> <json.tar.gz>
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/smtk-developers/attachments/20170914/7718fc0a/attachment.html>


More information about the Smtk-developers mailing list