feat(string): add SStrCmp

This commit is contained in:
fallenoak 2020-11-14 17:58:34 -06:00
parent e74eb83854
commit 0d07d79ed0
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
3 changed files with 26 additions and 0 deletions

View file

@ -1,6 +1,7 @@
#include "storm/String.hpp"
#include "storm/Error.hpp"
#include "storm/string/bjhash.hpp"
#include <cstring>
uint8_t bytesFromUTF8[256] = {
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -128,6 +129,10 @@ void GetNextTextUpper(uint32_t* orig, const char** string, uint32_t* upper) {
}
}
int32_t SStrCmp(const char* string1, const char* string2, size_t maxchars) {
return strncmp(string1, string2, maxchars);
}
size_t SStrCopy(char* dest, const char* source, size_t destsize) {
STORM_ASSERT(dest);
STORM_ASSERT(source);