[Glacier] Add a StringView class and StrSplit method.

This commit is contained in:
Drew Galbraith 2023-11-02 20:23:28 -07:00
parent b6c220a350
commit a2e80952c8
8 changed files with 159 additions and 4 deletions

View file

@ -2,6 +2,8 @@
#include <stdint.h>
#include "glacier/string/string_view.h"
namespace glcr {
class String {
@ -9,6 +11,7 @@ class String {
String();
String(const char* cstr);
String(const char* cstr, uint64_t str_len);
String(StringView str);
const char* cstr() const { return cstr_; }
uint64_t length() const { return length_; }
@ -16,6 +19,7 @@ class String {
bool operator==(const String& str);
char operator[](uint64_t offset) const;
operator StringView() const;
private:
char* cstr_;