Skip to content

Commit

Permalink
Integrate into .rst doxygen-generated doc for custom I/O and network …
Browse files Browse the repository at this point in the history
…functionality
  • Loading branch information
rouault committed Jan 14, 2020
1 parent d0c3df3 commit 929f37b
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
#texinfo_no_detailmenu = False

breathe_projects = {
"cpp_stuff":"../build/xml/",
"doxygen_api":"../build/xml/",
}

import redirects
Expand Down
2 changes: 1 addition & 1 deletion docs/source/development/reference/cpp/common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ common namespace
----------------

.. doxygennamespace:: osgeo::proj::common
:project: cpp_stuff
:project: doxygen_api
:members:
2 changes: 1 addition & 1 deletion docs/source/development/reference/cpp/cpp_general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ General documentation
---------------------

.. doxygenfile:: general_doc.dox.reworked.h
:project: cpp_stuff
:project: doxygen_api
2 changes: 1 addition & 1 deletion docs/source/development/reference/cpp/crs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ crs namespace
-------------

.. doxygennamespace:: osgeo::proj::crs
:project: cpp_stuff
:project: doxygen_api
:members:
2 changes: 1 addition & 1 deletion docs/source/development/reference/cpp/cs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ cs namespace
------------

.. doxygennamespace:: osgeo::proj::cs
:project: cpp_stuff
:project: doxygen_api
:members:
2 changes: 1 addition & 1 deletion docs/source/development/reference/cpp/datum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ datum namespace
---------------

.. doxygennamespace:: osgeo::proj::datum
:project: cpp_stuff
:project: doxygen_api
:members:
2 changes: 1 addition & 1 deletion docs/source/development/reference/cpp/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ io namespace
------------

.. doxygennamespace:: osgeo::proj::io
:project: cpp_stuff
:project: doxygen_api
:members:
2 changes: 1 addition & 1 deletion docs/source/development/reference/cpp/metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata namespace
------------------

.. doxygennamespace:: osgeo::proj::metadata
:project: cpp_stuff
:project: doxygen_api
:members:
2 changes: 1 addition & 1 deletion docs/source/development/reference/cpp/operation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ operation namespace
-------------------

.. doxygennamespace:: osgeo::proj::operation
:project: cpp_stuff
:project: doxygen_api
:members:
2 changes: 1 addition & 1 deletion docs/source/development/reference/cpp/util.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ util namespace
--------------

.. doxygennamespace:: osgeo::proj::util
:project: cpp_stuff
:project: doxygen_api
:members:
39 changes: 38 additions & 1 deletion docs/source/development/reference/datatypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -797,11 +797,48 @@ Logging
.. versionadded:: 5.1.0


Setting custom I/O functions
-------------------------------------------------------------------------------

.. versionadded:: 7.0.0

.. doxygenstruct:: PROJ_FILE_API
:project: doxygen_api
:members:

.. doxygentypedef:: PROJ_FILE_HANDLE
:project: doxygen_api

.. doxygenenum:: PROJ_OPEN_ACCESS
:project: doxygen_api


Network related functionality
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. versionadded:: 7.0.0

.. doxygentypedef:: PROJ_NETWORK_HANDLE
:project: doxygen_api

.. doxygentypedef:: proj_network_open_cbk_type
:project: doxygen_api

.. doxygentypedef:: proj_network_close_cbk_type
:project: doxygen_api

.. doxygentypedef:: proj_network_get_header_value_cbk_type
:project: doxygen_api

.. doxygentypedef:: proj_network_read_range_type
:project: doxygen_api


C API for ISO-19111 functionality
-------------------------------------------------------------------------------

.. doxygengroup:: iso19111_types
:project: cpp_stuff
:project: doxygen_api
:content-only:


50 changes: 49 additions & 1 deletion docs/source/development/reference/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,54 @@ Various
:returns: :c:type:`int` 1 if output units is expected in radians, otherwise 0
Setting custom I/O functions
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. versionadded:: 7.0.0
.. doxygenfunction:: proj_context_set_fileapi
:project: doxygen_api
.. doxygenfunction:: proj_context_set_sqlite3_vfs_name
:project: doxygen_api
Network related functionality
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. versionadded:: 7.0.0
.. doxygenfunction:: proj_context_set_network_callbacks
:project: doxygen_api
.. doxygenfunction:: proj_context_set_enable_network
:project: doxygen_api
.. doxygenfunction:: proj_context_set_url_endpoint
:project: doxygen_api
.. doxygenfunction:: proj_grid_cache_set_enable
:project: doxygen_api
.. doxygenfunction:: proj_grid_cache_set_filename
:project: doxygen_api
.. doxygenfunction:: proj_grid_cache_set_max_size
:project: doxygen_api
.. doxygenfunction:: proj_grid_cache_set_ttl
:project: doxygen_api
.. doxygenfunction:: proj_grid_cache_clear
:project: doxygen_api
.. doxygenfunction:: proj_is_download_needed
:project: doxygen_api
.. doxygenfunction:: proj_download_file
:project: doxygen_api
Cleanup
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down Expand Up @@ -727,6 +775,6 @@ which are not of type CRS (can be tested with :c:func:`proj_is_crs`),
will return an error when used with functions of this section.
.. doxygengroup:: iso19111_functions
:project: cpp_stuff
:project: doxygen_api
:content-only:
10 changes: 10 additions & 0 deletions src/filemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2881,6 +2881,7 @@ NS_PROJ_END
* @param user_data Arbitrary pointer provided by the user, and passed to the
* above callbacks. May be NULL.
* @return TRUE in case of success.
* @since 7.0
*/
int proj_context_set_fileapi(PJ_CONTEXT *ctx, const PROJ_FILE_API *fileapi,
void *user_data) {
Expand Down Expand Up @@ -2926,6 +2927,7 @@ int proj_context_set_fileapi(PJ_CONTEXT *ctx, const PROJ_FILE_API *fileapi,
* @param ctx PROJ context, or NULL
* @param name SQLite3 VFS name. If NULL is passed, default implementation by
* SQLite will be used.
* @since 7.0
*/
void proj_context_set_sqlite3_vfs_name(PJ_CONTEXT *ctx, const char *name) {
if (ctx == nullptr) {
Expand All @@ -2948,6 +2950,7 @@ void proj_context_set_sqlite3_vfs_name(PJ_CONTEXT *ctx, const char *name) {
* @param user_data Arbitrary pointer provided by the user, and passed to the
* above callbacks. May be NULL.
* @return TRUE in case of success.
* @since 7.0
*/
int proj_context_set_network_callbacks(
PJ_CONTEXT *ctx, proj_network_open_cbk_type open_cbk,
Expand Down Expand Up @@ -2979,6 +2982,7 @@ int proj_context_set_network_callbacks(
* @param enable TRUE if network access is allowed.
* @return TRUE if network access is possible. That is either libcurl is
* available, or an alternate interface has been set.
* @since 7.0
*/
int proj_context_set_enable_network(PJ_CONTEXT *ctx, int enable) {
if (ctx == nullptr) {
Expand All @@ -3005,6 +3009,7 @@ int proj_context_set_enable_network(PJ_CONTEXT *ctx, int enable) {
*
* @param ctx PROJ context, or NULL
* @param url Endpoint URL. Must NOT be NULL.
* @since 7.0
*/
void proj_context_set_url_endpoint(PJ_CONTEXT *ctx, const char *url) {
if (ctx == nullptr) {
Expand All @@ -3023,6 +3028,7 @@ void proj_context_set_url_endpoint(PJ_CONTEXT *ctx, const char *url) {
*
* @param ctx PROJ context, or NULL
* @param enabled TRUE if the cache is enabled.
* @since 7.0
*/
void proj_grid_cache_set_enable(PJ_CONTEXT *ctx, int enabled) {
if (ctx == nullptr) {
Expand All @@ -3041,6 +3047,7 @@ void proj_grid_cache_set_enable(PJ_CONTEXT *ctx, int enabled) {
* @param ctx PROJ context, or NULL
* @param fullname Full name to the cache (encoded in UTF-8). If set to NULL,
* caching will be disabled.
* @since 7.0
*/
void proj_grid_cache_set_filename(PJ_CONTEXT *ctx, const char *fullname) {
if (ctx == nullptr) {
Expand All @@ -3059,6 +3066,7 @@ void proj_grid_cache_set_filename(PJ_CONTEXT *ctx, const char *fullname) {
* @param ctx PROJ context, or NULL
* @param max_size_MB Maximum size, in mega-bytes (1024*1024 bytes), or
* negative value to set unlimited size.
* @since 7.0
*/
void proj_grid_cache_set_max_size(PJ_CONTEXT *ctx, int max_size_MB) {
if (ctx == nullptr) {
Expand All @@ -3085,6 +3093,7 @@ void proj_grid_cache_set_max_size(PJ_CONTEXT *ctx, int max_size_MB) {
*
* @param ctx PROJ context, or NULL
* @param ttl_seconds Delay in seconds. Use negative value for no expiration.
* @since 7.0
*/
void proj_grid_cache_set_ttl(PJ_CONTEXT *ctx, int ttl_seconds) {
if (ctx == nullptr) {
Expand All @@ -3100,6 +3109,7 @@ void proj_grid_cache_set_ttl(PJ_CONTEXT *ctx, int ttl_seconds) {
/** Clear the local cache of grid chunks.
*
* @param ctx PROJ context, or NULL
* @since 7.0
*/
void proj_grid_cache_clear(PJ_CONTEXT *ctx) {
if (ctx == nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion src/proj.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ int PROJ_DLL proj_context_get_use_proj4_init_rules(PJ_CONTEXT *ctx, int from_leg
typedef struct PROJ_FILE_HANDLE PROJ_FILE_HANDLE;

/** Open access / mode */
typedef enum
typedef enum PROJ_OPEN_ACCESS
{
/** Read-only access. Equivalent to "rb" */
PROJ_OPEN_ACCESS_READ_ONLY,
Expand Down

0 comments on commit 929f37b

Please sign in to comment.