2024-07-11 12:00:43 +00:00
|
|
|
struct String8 {
|
|
|
|
u8* str;
|
|
|
|
u64 size;
|
|
|
|
|
2024-07-11 12:59:59 +00:00
|
|
|
const char *c() const { return reinterpret_cast<const char *>(str); }
|
2024-08-01 12:08:29 +00:00
|
|
|
u8 operator[](u64 idx) const {
|
|
|
|
assert(idx < size);
|
|
|
|
return str[idx];
|
|
|
|
}
|
2024-07-11 12:00:43 +00:00
|
|
|
};
|
|
|
|
|
2024-07-18 13:32:32 +00:00
|
|
|
#define str8(s) String8 { (u8*)(s), sizeof(s) - 1 }
|
2024-07-11 12:00:43 +00:00
|
|
|
|
2024-07-29 09:59:56 +00:00
|
|
|
struct String8_Node {
|
|
|
|
String8_Node *next;
|
2024-08-02 07:45:37 +00:00
|
|
|
String8_Node *first_child, *last_child;
|
2024-07-29 09:59:56 +00:00
|
|
|
String8 str;
|
|
|
|
};
|