From a70e477087ff05ab24a54b806d89b5e4b970ec0a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 18 Dec 2019 21:00:00 +0100 Subject: Rename PJ_CONTEXT::fileapi member as fileapi_legacy --- src/ctx.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ctx.cpp') diff --git a/src/ctx.cpp b/src/ctx.cpp index bcb6e1cc..4536582d 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -95,7 +95,7 @@ projCtx_t projCtx_t::createDefault() projCtx_t ctx; ctx.debug_level = PJ_LOG_NONE; ctx.logger = pj_stderr_logger; - ctx.fileapi = pj_get_default_fileapi(); + ctx.fileapi_legacy = pj_get_default_fileapi(); if( getenv("PROJ_DEBUG") != nullptr ) { @@ -133,7 +133,7 @@ projCtx_t::projCtx_t(const projCtx_t& other) debug_level = other.debug_level; logger = other.logger; logger_app_data = other.logger_app_data; - fileapi = other.fileapi; + fileapi_legacy = other.fileapi_legacy; epsg_file_exists = other.epsg_file_exists; set_search_paths(other.search_paths); file_finder = other.file_finder; @@ -268,7 +268,7 @@ void pj_ctx_set_fileapi( projCtx ctx, projFileAPI *fileapi ) { if (nullptr==ctx) return; - ctx->fileapi = fileapi; + ctx->fileapi_legacy = fileapi; } /************************************************************************/ @@ -280,6 +280,6 @@ projFileAPI *pj_ctx_get_fileapi( projCtx ctx ) { if (nullptr==ctx) return nullptr; - return ctx->fileapi; + return ctx->fileapi_legacy; } -- cgit v1.2.3 From 2dfe2cdd1f4e963e6faaccd5ca29bc6d8fe4ae30 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 18 Dec 2019 23:38:16 +0100 Subject: Add a FileManager and File class --- src/ctx.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src/ctx.cpp') diff --git a/src/ctx.cpp b/src/ctx.cpp index 4536582d..da90d4d7 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -258,28 +258,3 @@ void *pj_ctx_get_app_data( projCtx ctx ) return nullptr; return ctx->logger_app_data; } - -/************************************************************************/ -/* pj_ctx_set_fileapi() */ -/************************************************************************/ - -void pj_ctx_set_fileapi( projCtx ctx, projFileAPI *fileapi ) - -{ - if (nullptr==ctx) - return; - ctx->fileapi_legacy = fileapi; -} - -/************************************************************************/ -/* pj_ctx_get_fileapi() */ -/************************************************************************/ - -projFileAPI *pj_ctx_get_fileapi( projCtx ctx ) - -{ - if (nullptr==ctx) - return nullptr; - return ctx->fileapi_legacy; -} - -- cgit v1.2.3 From a06f4a258f618dbad2ce01feadab6908db00bda5 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 19 Dec 2019 21:24:53 +0100 Subject: Add proj_context_set_network_callbacks() with an empty implementation --- src/ctx.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ctx.cpp') diff --git a/src/ctx.cpp b/src/ctx.cpp index da90d4d7..a7cf8cb3 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -33,6 +33,7 @@ #include "proj_experimental.h" #include "proj_internal.h" +#include "filemanager.hpp" /************************************************************************/ /* pj_get_ctx() */ @@ -96,6 +97,7 @@ projCtx_t projCtx_t::createDefault() ctx.debug_level = PJ_LOG_NONE; ctx.logger = pj_stderr_logger; ctx.fileapi_legacy = pj_get_default_fileapi(); + NS_PROJ::FileManager::fillDefaultNetworkInterface(&ctx); if( getenv("PROJ_DEBUG") != nullptr ) { @@ -139,6 +141,7 @@ projCtx_t::projCtx_t(const projCtx_t& other) file_finder = other.file_finder; file_finder_legacy = other.file_finder_legacy; file_finder_user_data = other.file_finder_user_data; + networking = other.networking; } /************************************************************************/ -- cgit v1.2.3 From f085b39752d00a296c288be42dfc69b39b73823f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 27 Dec 2019 12:25:03 +0100 Subject: Handle context reassignment for Grid/GridSet/File objects --- src/ctx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ctx.cpp') diff --git a/src/ctx.cpp b/src/ctx.cpp index a7cf8cb3..6172b3c8 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -61,9 +61,9 @@ void pj_set_ctx( projPJ pj, projCtx ctx ) if (pj==nullptr) return; pj->ctx = ctx; - if( pj->is_pipeline ) + if( pj->reassign_context ) { - pj_pipeline_assign_context_to_steps(pj, ctx); + pj->reassign_context(pj, ctx); } for( const auto &alt: pj->alternativeCoordinateOperations ) { -- cgit v1.2.3