[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

@ -11,10 +11,18 @@ class Vector {
Vector() : data_(nullptr), size_(0), capacity_(0) {}
Vector(const Vector&) = delete;
// TODO: Implement Move
Vector(Vector&&) = delete;
Vector(Vector&& other)
: data_(other.data_), size_(other.size_), capacity_(other.capacity_) {
other.data_ = nullptr;
other.size_ = 0;
other.capacity_ = 0;
}
~Vector() { delete[] data_; }
~Vector() {
if (data_) {
delete[] data_;
}
}
// FIXME: Handle downsizing.
void Resize(uint64_t capacity);