<div dir="ltr"><div>+1 for wrapping the old C code in some cleaner abstractions!</div><div><br></div><div>But +10 for switching to a from the ground up C++ JSON library unless there are clear reasons for a core C library (I don't think there are)</div><div><br></div>If we are talking about this kind of code, there are several things that have bugged me in general about GDAL for a long time.<div><br></div><div>* Passing char *psz yada all over the place in pure C++ code.  A const std::string is usually not a noticeable expense and is a lot safer</div><div>* CPLString when std::string will do just fine.  And we can write free functions to operate on strings.  I'm generally bothered by subclassing of std::string as CPLString.  After reading large amounts of C++ code, I think it adds more confusion than it ever helps over having clean free functions.  Interop and analysis with CPLString's is no fun.</div><div>  <a href="https://stackoverflow.com/questions/6006860/why-should-one-not-derive-from-c-std-string-class">https://stackoverflow.com/questions/6006860/why-should-one-not-derive-from-c-std-string-class</a></div><div><br></div><div>-kurt</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 5, 2018 at 7:44 AM, Sean Gillies <span dir="ltr"><<a href="mailto:sean@mapbox.com" target="_blank">sean@mapbox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Dmitry,<div><br></div><div>I scanned the PR and it seems reasonable to me. I'm barely a C++ programmer at all and it's clear to me, more clear than before. That said, I'm not a fan of wrapping things that could be replaced. Have you looked into whether a more performant C++ JSON library could be used? I haven't run the benchmarks, but json-c compares pretty poorly to others in <a href="https://github.com/miloyip/nativejson-benchmark" target="_blank">https://github.com/miloyip/<wbr>nativejson-benchmark</a>.</div><div><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Wed, Jan 3, 2018 at 12:04 PM, Dmitry Baryshnikov <span dir="ltr"><<a href="mailto:bishop.dev@gmail.com" target="_blank">bishop.dev@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everybody,<br>
<br>
Happy new year and lot of success in 2018!<br>
<br>
I would like to discuss my pull request <a href="https://github.com/OSGeo/gdal/pull/282" rel="noreferrer" target="_blank">https://github.com/OSGeo/gdal/<wbr>pull/282</a><br>
<br>
I created a thin wrapper around the json-c library which wide using in GDAL.<br>
<br>
This is C++ interface which hides C memory management and provides nice API. The web or disk json documents reading chunk by chunk with progress indication also added.<br>
<br>
In future, the json-c can be easily switch to something other without breaking the existing code.<br>
<br>
The CPLJSONDocument/CPLJSONObject/<wbr>CPLJSONArray usage examples can be found in frmts/pds driver and c++ unit test in autotest/cpp/test_cpl.cpp.<br>
<br>
Is this ready to merge into the trunk? Any objections?<br>
<br>
Best regards,<br>
    Dmitry<br>
<br>
<br>
______________________________<wbr>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/gdal-dev</a></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_1374895766268508935gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Sean Gillies</div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/gdal-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div></div>
</div>