Improving string for C++

This commit is contained in:
Krzosa Karol
2024-01-13 17:09:38 +01:00
parent 3408f3a1ff
commit 1dc0eceeba
12 changed files with 89 additions and 55 deletions

View File

@@ -1,10 +1,14 @@
#include "../core_library/core.c"
int main() {
MA_Scratch scratch;
for (OS_FileIter it = OS_IterateFiles(scratch, "../"_s); OS_IsValid(it); OS_Advance(&it)) {
IO_Printf("is_directory: %d\n", it.is_directory);
IO_Printf("absolute_path: %.*s\n", S8_Expand(it.absolute_path));
IO_Printf("relative_path: %.*s\n", S8_Expand(it.relative_path));
S8_String s = "mrówka";
bool found_two_byte = false;
For(s) {
if (it.utf8_codepoint_byte_size == 2) {
found_two_byte = true;
IO_Assert(it.i == 2);
}
}
IO_Assert(found_two_byte);
}