rntviewer/src/str.h
2024-08-02 09:45:37 +02:00

18 lines
356 B
C

struct String8 {
u8* str;
u64 size;
const char *c() const { return reinterpret_cast<const char *>(str); }
u8 operator[](u64 idx) const {
assert(idx < size);
return str[idx];
}
};
#define str8(s) String8 { (u8*)(s), sizeof(s) - 1 }
struct String8_Node {
String8_Node *next;
String8_Node *first_child, *last_child;
String8 str;
};