Move userspace to a templated StrFormat.
This commit is contained in:
parent
d9df1212b7
commit
26b61db021
25 changed files with 263 additions and 217 deletions
26
lib/glacier/string/string_builder.h
Normal file
26
lib/glacier/string/string_builder.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue