MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / Path_MakeAbsolute

Function Path_MakeAbsolute

src/vrcore/pathtools_public.cpp:233–248  ·  view source on GitHub ↗

Makes an absolute path from a relative path and a base path */

Source from the content-addressed store, hash-verified

231
232/** Makes an absolute path from a relative path and a base path */
233std::string Path_MakeAbsolute( const std::string & sRelativePath, const std::string & sBasePath )
234{
235 if( Path_IsAbsolute( sRelativePath ) )
236 return Path_Compact( sRelativePath );
237 else
238 {
239 if( !Path_IsAbsolute( sBasePath ) )
240 return "";
241
242 std::string sCompacted = Path_Compact( Path_Join( sBasePath, sRelativePath ) );
243 if( Path_IsAbsolute( sCompacted ) )
244 return sCompacted;
245 else
246 return "";
247 }
248}
249
250
251/** Fixes the directory separators for the current platform */

Callers 1

Path_FilePathToUrlFunction · 0.70

Calls 3

Path_IsAbsoluteFunction · 0.70
Path_CompactFunction · 0.70
Path_JoinFunction · 0.70

Tested by

no test coverage detected