MCPcopy Create free account
hub / github.com/Kitware/VTK / pj_make_args

Function pj_make_args

ThirdParty/libproj/vtklibproj/src/internal.cpp:365–396  ·  view source on GitHub ↗

/

Source from the content-addressed store, hash-verified

363
364/*****************************************************************************/
365char *pj_make_args (size_t argc, char **argv) {
366/******************************************************************************
367pj_make_args is the inverse of the pj_trim_argc/pj_trim_argv combo: It
368converts free format command line input to something proj_create can consume.
369
370Allocates, and returns, an array of char, large enough to hold a whitespace
371separated copy of the args in argv. It is the duty of the caller to free this
372array.
373******************************************************************************/
374
375 try
376 {
377 std::string s;
378 for( size_t i = 0; i < argc; i++ )
379 {
380 const char* equal = strchr(argv[i], '=');
381 if( equal ) {
382 s += std::string(argv[i], equal - argv[i] + 1);
383 s += pj_double_quote_string_param_if_needed(equal + 1);
384 } else {
385 s += argv[i];
386 }
387 s += ' ';
388 }
389
390 char* p = pj_strdup(s.c_str());
391 return pj_shrink (p);
392 }
393 catch( const std::exception& ) {
394 return nullptr;
395 }
396}
397
398
399

Callers 2

proj_create_argvFunction · 0.85
pj_create_argv_internalFunction · 0.85

Calls 5

pj_strdupFunction · 0.85
pj_shrinkFunction · 0.85
stringClass · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected