A helper class to build string in-place without additional cost of allocations, locales and format parsing.
More...
#include <StringBuilder.h>
|
| | StringBuilder (std::span< char > buffer) noexcept |
| |
| template<typename T > |
| std::enable_if< std::is_arithmetic_v< T > >::type | Append (const T value) noexcept |
| |
| void | Append (const char ch) |
| |
| void | Append (const std::string_view str) noexcept |
| |
| std::string_view | Str () noexcept |
| | Returns a string_view to a null-terminated string. More...
|
| |
A helper class to build string in-place without additional cost of allocations, locales and format parsing.
Prefer to use the class with stack allocated buffers over standard tools in high-load cases. TODO: in case of overflow it might use a heap allocated storage.
◆ StringBuilder()
| PS::StringBuilder::StringBuilder |
( |
std::span< char > |
buffer | ) |
|
|
inlinenoexcept |
◆ Append() [1/3]
| void PS::StringBuilder::Append |
( |
const char |
ch | ) |
|
|
inline |
◆ Append() [2/3]
| void PS::StringBuilder::Append |
( |
const std::string_view |
str | ) |
|
|
inlinenoexcept |
◆ Append() [3/3]
| std::enable_if< std::is_arithmetic_v< T > >::type PS::StringBuilder::Append |
( |
const T |
value | ) |
|
|
inlinenoexcept |
◆ Str()
| std::string_view PS::StringBuilder::Str |
( |
| ) |
|
|
inlinenoexcept |
Returns a string_view to a null-terminated string.
◆ m_Buffer
| std::span<char> PS::StringBuilder::m_Buffer |
|
private |
◆ m_BufferBegin
| char* PS::StringBuilder::m_BufferBegin |
|
private |
The documentation for this class was generated from the following file:
- /home/jenkins/jenkins/workspace/technical-docs/source/ps/strings/StringBuilder.h