Description
When extracting data out of a GNDS file, we will want to have the data in natural C++ data structures (e.g., std::vector< double >
, std::variant<...>
, etc.). It would be good to do this in GNDStk so that each project the uses GNDStk doesn't have to do that conversion on their own.
The official GNDS documentation is based on some JSON files that contain descriptions of the contents of each of the different GNDS containers. It's possible, that these JSON files could be parsed/interpreted to automate the process so that we don't have to do a lot of work whenever GNDS changes—which it will.
Here is an example. Suppose I have a GNDStk Node
representing a <values>
container:
<values>
1.0e-05 2.04360800e+01 2.0e-05 2.04360800e+01
</values>
I would like to do something like this:
GNDStk::Node valuesNode = ...; // This is defined somewhere else
std::vector< double > data1 = valuesNode.values();
// or
auto data2 = valuesNode.values();
The exact API for this is to be determined, but something natural to C++.
In addition, being able to read the provided JSON files, we can support different versions of GNDS. I anticipate something like this:
#include "GNDStk/version/1_9.hpp"
// or
#include "GNDStk/version/2_0.hpp"