summaryrefslogtreecommitdiff
path: root/source/core/slang-io.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2021-12-03 11:45:01 -0500
committerGitHub <noreply@github.com>2021-12-03 11:45:01 -0500
commitda6be80f18014a3972eedf05099cd0066e9eae04 (patch)
tree687cb3853e1794b9478ee2a7b0503590f00f4669 /source/core/slang-io.h
parentf4b86ff23c825f5e776a401f89302bfcd358aae8 (diff)
Split out ExecutableLocation (#2041)
* #include an absolute path didn't work - because paths were taken to always be relative. * Split out ExecutableLocation. * Fixes for changes to ExecutableLocation. * Fix issues around Process on windows. * Improve comments. Kick CI.
Diffstat (limited to 'source/core/slang-io.h')
-rw-r--r--source/core/slang-io.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/core/slang-io.h b/source/core/slang-io.h
index 50ce67784..de761cf4b 100644
--- a/source/core/slang-io.h
+++ b/source/core/slang-io.h
@@ -74,6 +74,11 @@ namespace Slang
static Index findExtIndex(String const& path) { return findExtIndex(path.getUnownedSlice()); }
static Index findExtIndex(UnownedStringSlice const& path);
+ /// True if isn't just a name (ie has any path separator)
+ /// Note this is no the same as having a 'parent' as '/thing' 'has a path', but it doesn't have a parent.
+ static bool hasPath(const UnownedStringSlice& path) { return findLastSeparatorIndex(path) >= 0; }
+ static bool hasPath(const String& path) { return findLastSeparatorIndex(path) >= 0; }
+
static String replaceExt(const String& path, const char* newExt);
static String getFileName(const String& path);
static String getPathWithoutExt(const String& path);