Improving basic commands

This commit is contained in:
krzosa
2025-05-02 12:02:13 +02:00
parent fd8a319b18
commit d7908bee54
9 changed files with 126 additions and 90 deletions

View File

@@ -249,6 +249,14 @@ String16 Copy16(Allocator allocator, char16_t *string) {
return Copy(allocator, s);
}
String16 Concat(Allocator allocator, String16 a, String16 b) {
char16_t *str = AllocArray(allocator, char16_t, a.len + b.len + 1);
MemoryCopy(str, a.data, a.len * 2);
MemoryCopy(str + a.len, b.data, b.len * 2);
str[a.len + b.len] = 0;
return {str, a.len + b.len};
}
void NormalizePathInPlace(String16 s) {
for (int64_t i = 0; i < s.len; i++) {
if (s.data[i] == u'\\')
@@ -304,3 +312,4 @@ String16 SkipWhitespace(String16 *string) {
}
return begin;
}