diff --git a/src/xenia/base/string_buffer.cc b/src/xenia/base/string_buffer.cc index 90d386f23..050ddf9d8 100644 --- a/src/xenia/base/string_buffer.cc +++ b/src/xenia/base/string_buffer.cc @@ -52,6 +52,13 @@ void StringBuffer::Append(char c) { AppendBytes(reinterpret_cast(&c), 1); } +void StringBuffer::Append(char c, size_t count) { + Grow(count + 1); + std::memset(buffer_ + buffer_offset_, c, count); + buffer_offset_ += count; + buffer_[buffer_offset_] = 0; +} + void StringBuffer::Append(const char* value) { AppendBytes(reinterpret_cast(value), std::strlen(value)); } diff --git a/src/xenia/base/string_buffer.h b/src/xenia/base/string_buffer.h index bd6063fe4..16900824a 100644 --- a/src/xenia/base/string_buffer.h +++ b/src/xenia/base/string_buffer.h @@ -29,6 +29,7 @@ class StringBuffer { void Reset(); void Append(char c); + void Append(char c, size_t count); void Append(const char* value); void Append(const std::string_view value);