Improving basic commands
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user