al::isEqualSubString

This commit is contained in:
shibbo 2020-07-24 19:06:42 -04:00
parent bfc083ee07
commit e512d1b6e4
2 changed files with 11 additions and 1 deletions

View File

@ -1,10 +1,12 @@
#pragma once
#include <sead/seadSafeString.h>
namespace al
{
bool isEqualString(const char16_t *, const char16_t *);
bool isEqualSubString(const char *, const char *);
// isEqualSubString(const sead::SafeStringBase<char> &, const sead::SafeStringBase<char> &)
bool isEqualSubString(const sead::SafeStringBase<char> &, const sead::SafeStringBase<char> &);
bool isStartWithString(const char *, const char *);
bool isEndWithString(const char *, const char *);
bool isEqualString(const char *, const char *);

View File

@ -32,6 +32,14 @@ namespace al
return strstr(pString_0, pString_1);
}
bool isEqualSubString(const sead::SafeStringBase<char> &pString_0, const sead::SafeStringBase<char> &pString_1)
{
pString_0.assureTerminationImpl_();
const char* str = pString_0.mStringTop;
pString_1.assureTerminationImpl_();
return strstr(str, pString_1.mStringTop);
}
bool isStartWithString(const char *pString_0, const char *pString_1)
{
char val = *pString_1;