summaryrefslogtreecommitdiff
path: root/source/core
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-06-19 10:23:16 -0700
committerGitHub <noreply@github.com>2017-06-19 10:23:16 -0700
commitbb9ca29160f5d95f3860504262693ea650d96be5 (patch)
tree04f502283ed818f661e368b3d8d1ba5ce875d1d2 /source/core
parentcafed774d99f95bce6f182599913f3417dc68a3a (diff)
parent634522da69b14b38c15b14d6b717b1289812e9bb (diff)
Merge pull request #29 from tfoleyNV/auto-import
Allow for automatic importing of Slang code
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-io.h5
-rw-r--r--source/core/slang-string.h10
2 files changed, 11 insertions, 4 deletions
diff --git a/source/core/slang-io.h b/source/core/slang-io.h
index 869fad873..2f140c3ad 100644
--- a/source/core/slang-io.h
+++ b/source/core/slang-io.h
@@ -20,11 +20,8 @@ namespace Slang
class Path
{
public:
-#ifdef _WIN32
- static const char PathDelimiter = '\\';
-#else
static const char PathDelimiter = '/';
-#endif
+
static String TruncateExt(const String & path);
static String ReplaceExt(const String & path, const char * newExt);
static String GetFileName(const String & path);
diff --git a/source/core/slang-string.h b/source/core/slang-string.h
index 80eb00605..448b351aa 100644
--- a/source/core/slang-string.h
+++ b/source/core/slang-string.h
@@ -141,6 +141,16 @@ namespace Slang
memcpy(buffer.Ptr(), str, length + 1);
}
}
+ String(const char* textBegin, char const* textEnd)
+ {
+ if (textBegin != textEnd)
+ {
+ length = (int)(textEnd - textBegin);
+ buffer = new char[length + 1];
+ memcpy(buffer.Ptr(), textBegin, length + 1);
+ buffer.Ptr()[length] = 0;
+ }
+ }
String(char chr)
{
if (chr)