2023-06-21 14:42:23 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
namespace glcr {
|
|
|
|
|
|
|
|
class String {
|
|
|
|
public:
|
2023-10-13 15:03:35 -07:00
|
|
|
String();
|
2023-06-21 14:42:23 -07:00
|
|
|
String(const char* cstr);
|
2023-07-06 10:40:36 -07:00
|
|
|
String(const char* cstr, uint64_t str_len);
|
2023-06-21 14:42:23 -07:00
|
|
|
|
2023-06-22 02:18:44 -07:00
|
|
|
const char* cstr() const { return cstr_; }
|
|
|
|
uint64_t length() const { return length_; }
|
|
|
|
|
2023-06-21 14:42:23 -07:00
|
|
|
bool operator==(const String& str);
|
|
|
|
|
2023-10-24 12:34:52 -07:00
|
|
|
char operator[](uint64_t offset) const;
|
|
|
|
|
2023-06-21 14:42:23 -07:00
|
|
|
private:
|
|
|
|
char* cstr_;
|
|
|
|
uint64_t length_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace glcr
|