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

Function CPLProjectRelativeFilenameSafe

port/cpl_path.cpp:1035–1053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1033 */
1034
1035std::string CPLProjectRelativeFilenameSafe(const char *pszProjectDir,
1036 const char *pszSecondaryFilename)
1037
1038{
1039 if (pszProjectDir == nullptr || pszProjectDir[0] == 0 ||
1040 !CPLIsFilenameRelative(pszSecondaryFilename))
1041 {
1042 return pszSecondaryFilename;
1043 }
1044
1045 std::string osRes(pszProjectDir);
1046 if (osRes.back() != '/' && osRes.back() != '\\')
1047 {
1048 osRes += VSIGetDirectorySeparator(pszProjectDir);
1049 }
1050
1051 osRes += pszSecondaryFilename;
1052 return osRes;
1053}
1054
1055/************************************************************************/
1056/* CPLProjectRelativeFilename() */

Callers 15

FullInitializeMethod · 0.85
GDALFootprintProcessFunction · 0.85
GDALTileIndexInternalFunction · 0.85
BuildFilenameMethod · 0.85
GetFileListMethod · 0.85
BuildFullNameFunction · 0.85
OpenMethod · 0.85
GetAbsoluteFileNameFunction · 0.85
OpenMethod · 0.85
XMLInitMethod · 0.85

Calls 2

CPLIsFilenameRelativeFunction · 0.85
VSIGetDirectorySeparatorFunction · 0.85

Tested by

no test coverage detected