rntviewer/src/str.h

19 lines
315 B
C
Raw Normal View History

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); }
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;
String8 str;
};