reinstate theme editor and fix bugs

This commit is contained in:
IntelOrca committed 2016-02-03 18:23:45 +00:00
1 parent caf9bd9939
commit 7e1ce4fcc6
11 files changed
+369 -493

No files matched your search

+28 -1
View File
@@ -10,6 +10,11 @@ extern "C"
namespace String
{
bool IsNullOrEmpty(const utf8 * str)
{
return str == nullptr || str[0] == '\0';
}
bool Equals(const utf8 * a, const utf8 * b, bool ignoreCase)
{
if (a == b) return true;
@@ -51,6 +56,28 @@ namespace String
}
}
size_t LastIndexOf(const utf8 * str, utf8 match)
{
const utf8 * lastOccurance = nullptr;
const utf8 * ch = str;
for (; ch != '\0'; ch++)
{
if (*ch == match)
{
lastOccurance = ch;
}
}
if (lastOccurance == nullptr)
{
return SIZE_MAX;
}
else
{
return (size_t)(lastOccurance - str);
}
}
size_t LengthOf(const utf8 * str)
{
return utf8_length(str);
@@ -137,7 +164,7 @@ namespace String
return replacement;
}
utf8 * DiscardDuplicate(utf8 * * ptr, utf8 * replacement)
utf8 * DiscardDuplicate(utf8 * * ptr, const utf8 * replacement)
{
return DiscardUse(ptr, String::Duplicate(replacement));
}