mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-14 18:00:54 +00:00
Add IsRelativePath helper
This commit is contained in:
1 parent
506954ffb8
commit
95225d12b4
4 files changed
+20
-1
No files matched your search
@@ -237,6 +237,7 @@ string GetReplayAppFilename();
|
||||
|
||||
void CreateParentDirectory(const string &filename);
|
||||
|
||||
bool IsRelativePath(const string &path);
|
||||
string GetFullPathname(const string &filename);
|
||||
|
||||
void GetExecutableFilename(string &selfName);
|
||||
|
||||
@@ -83,6 +83,14 @@ void CreateParentDirectory(const string &filename)
|
||||
}
|
||||
}
|
||||
|
||||
bool IsRelativePath(const string &path)
|
||||
{
|
||||
if(path.empty())
|
||||
return false;
|
||||
|
||||
return path.front() != '/';
|
||||
}
|
||||
|
||||
string GetFullPathname(const string &filename)
|
||||
{
|
||||
char path[PATH_MAX + 1] = {0};
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <tchar.h>
|
||||
@@ -166,6 +167,15 @@ void GetExecutableFilename(string &selfName)
|
||||
selfName = StringFormat::Wide2UTF8(wstring(curFile));
|
||||
}
|
||||
|
||||
bool IsRelativePath(const string &path)
|
||||
{
|
||||
if(path.empty())
|
||||
return false;
|
||||
|
||||
wstring wpath = StringFormat::UTF82Wide(path.c_str());
|
||||
return PathIsRelativeW(wpath.c_str()) != 0;
|
||||
}
|
||||
|
||||
string GetFullPathname(const string &filename)
|
||||
{
|
||||
wstring wfn = StringFormat::UTF82Wide(filename);
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>ws2_32.lib;kernel32.lib;user32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>ws2_32.lib;kernel32.lib;user32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>$(ProjectDir)os\win32\comexport.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
|
||||
Reference in new issue
Block a user