diff options
| author | Alan D. Snow <alansnow21@gmail.com> | 2020-10-19 10:20:27 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-19 17:20:27 +0200 |
| commit | 084f5f6cb39b3732c4cd930ebffcff86cdb24932 (patch) | |
| tree | b6e3d9bd87eecafbfe0f6f2634c4db9d00bc8e05 /src/ctx.cpp | |
| parent | 85137d93549f2bb3dfe4fcfd371a0f1925e26417 (diff) | |
| download | PROJ-084f5f6cb39b3732c4cd930ebffcff86cdb24932.tar.gz PROJ-084f5f6cb39b3732c4cd930ebffcff86cdb24932.zip | |
C API: add proj_context_clone() (#2383)
Fixes #2382
Diffstat (limited to 'src/ctx.cpp')
| -rw-r--r-- | src/ctx.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp index 5575d3aa..6dbe0de5 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -226,6 +226,19 @@ projCtx pj_ctx_alloc() } /************************************************************************/ +/* proj_context_clone() */ +/* Create a new context based on a custom context */ +/************************************************************************/ + +PJ_CONTEXT *proj_context_clone (PJ_CONTEXT *ctx) +{ + if (nullptr==ctx) + return pj_ctx_alloc (); + + return new (std::nothrow) projCtx_t(*ctx); +} + +/************************************************************************/ /* pj_ctx_free() */ /************************************************************************/ |
