Move userspace to a templated StrFormat.

This commit is contained in:
Drew Galbraith 2023-11-03 02:48:21 -07:00
parent d9df1212b7
commit 26b61db021
25 changed files with 263 additions and 217 deletions

View file

@ -0,0 +1,26 @@
#pragma once
#include "glacier/container/vector.h"
#include "glacier/string/string.h"
#include "glacier/string/string_view.h"
namespace glcr {
class StringBuilder : public Vector<char> {
public:
StringBuilder() : Vector<char>() {}
StringBuilder(const StringBuilder&) = delete;
StringBuilder(StringBuilder&& str) : Vector<char>(Move(str)) {}
void PushBack(const StringView& str);
using Vector<char>::PushBack;
String ToString() const;
// Note that this could become invalidated
// at any time if more characters are pushed
// onto the builder.
operator StringView() const;
};
} // namespace glcr