rntviewer/src/str.h

19 lines
370 B
C
Raw Normal View History

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