MCPcopy Create free account
hub / github.com/OSGeo/gdal / GDALGetMessageAboutMissingPluginDriver

Function GDALGetMessageAboutMissingPluginDriver

gcore/gdaldriver.cpp:3395–3443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3393/************************************************************************/
3394
3395std::string
3396GDALGetMessageAboutMissingPluginDriver(GDALDriver *poMissingPluginDriver)
3397{
3398 std::string osMsg =
3399 poMissingPluginDriver->GetMetadataItem("MISSING_PLUGIN_FILENAME");
3400 osMsg += " is not available in your "
3401 "installation.";
3402 if (const char *pszInstallationMsg = poMissingPluginDriver->GetMetadataItem(
3403 GDAL_DMD_PLUGIN_INSTALLATION_MESSAGE))
3404 {
3405 osMsg += " ";
3406 osMsg += pszInstallationMsg;
3407 }
3408
3409 VSIStatBuf sStat;
3410 if (const char *pszGDALDriverPath =
3411 CPLGetConfigOption("GDAL_DRIVER_PATH", nullptr))
3412 {
3413 if (VSIStat(pszGDALDriverPath, &sStat) != 0)
3414 {
3415 if (osMsg.back() != '.')
3416 osMsg += ".";
3417 osMsg += " Directory '";
3418 osMsg += pszGDALDriverPath;
3419 osMsg += "' pointed by GDAL_DRIVER_PATH does not exist.";
3420 }
3421 }
3422 else
3423 {
3424 if (osMsg.back() != '.')
3425 osMsg += ".";
3426#ifdef INSTALL_PLUGIN_FULL_DIR
3427 if (VSIStat(INSTALL_PLUGIN_FULL_DIR, &sStat) != 0)
3428 {
3429 osMsg += " Directory '";
3430 osMsg += INSTALL_PLUGIN_FULL_DIR;
3431 osMsg += "' hardcoded in the GDAL library does not "
3432 "exist and the GDAL_DRIVER_PATH "
3433 "configuration option is not set.";
3434 }
3435 else
3436#endif
3437 {
3438 osMsg += " The GDAL_DRIVER_PATH configuration "
3439 "option is not set.";
3440 }
3441 }
3442 return osMsg;
3443}
3444
3445/************************************************************************/
3446/* GDALClearMemoryCaches() */

Callers 5

MAIN_STARTFunction · 0.85
GDALWarpCreateOutputFunction · 0.85
OpenMethod · 0.85
ValidateFormatMethod · 0.85

Calls 2

VSIStatFunction · 0.85
GetMetadataItemMethod · 0.45

Tested by

no test coverage detected