.. index:: pair: namespace; json_converter .. _doxid-namespacejson__converter: namespace json_converter ======================== .. toctree:: :hidden: Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block namespace json_converter { // global functions static PyObject* :target:`convertJsonToPyDict`(const :ref:`nlohmann::json`& json); static PyObject* :target:`convertJsonToPyList`(const :ref:`nlohmann::json`& json); static void :target:`generatePythonError`(const std::string& errorMessage); PyObject* :ref:`convertJsonToPyObject`(const :ref:`nlohmann::json`& json); template static :ref:`nlohmann::json` :target:`convertNumpyArrayHelper`(const boost::python::numpy::ndarray& npArray); template static bool :target:`compareDtype`(np::dtype dtype); :ref:`nlohmann::json` :target:`convertNumpyArrayToJson`(PyObject* value); static :ref:`nlohmann::json` :target:`convertPyListToJson`(PyObject* value); static :ref:`nlohmann::json` :target:`convertPyTupleToJson`(PyObject* value); static :ref:`nlohmann::json` :target:`convertPyDictToJson`(PyObject* value); static bool :target:`isNumpyInitialized`(); :ref:`nlohmann::json` :ref:`convertPyObjectToJson`(PyObject* value); void :ref:`initNumpy`(); } // namespace json_converter .. _details-namespacejson__converter: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Global Functions ---------------- .. index:: pair: function; convertJsonToPyObject .. _doxid-namespacejson__converter_1a4b3825153dc600863e282a4e2a689503: .. ref-code-block:: cpp :class: doxyrest-title-code-block PyObject* convertJsonToPyObject(const :ref:`nlohmann::json`& json) Converts given JSON object into a python object. .. index:: pair: function; convertPyObjectToJson .. _doxid-namespacejson__converter_1a428c7fca41e33bcd78aa478cf0884167: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`nlohmann::json` convertPyObjectToJson(PyObject* value) Converts given python object into a JSON object. .. index:: pair: function; initNumpy .. _doxid-namespacejson__converter_1a7ee4665219384a54a0c12c47d24117a8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void initNumpy() Initializes numpy array API for this module. The function must be called before using the module. If it's not done, some of the other functions in the module may fail with an exception. The function must be called after Py_Initialize().