|
OpenTTD Source 20251117-master-g7398d2e290
|
Compose data into a growing std::string. More...
#include <string_builder.hpp>
Public Types | |
| using | back_insert_iterator = std::back_insert_iterator< std::string > |
Public Types inherited from BaseStringBuilder | |
| using | size_type = std::string_view::size_type |
Public Member Functions | |
| StringBuilder (std::string &dest) | |
| Construct StringBuilder into destination string. | |
| bool | AnyBytesWritten () const noexcept |
| Check whether any bytes have been written. | |
| size_type | GetBytesWritten () const noexcept |
| Get number of already written bytes. | |
| const std::string & | GetWrittenData () const noexcept |
| Get already written data. | |
| std::string & | GetString () noexcept |
| Get mutable already written data. | |
| void | PutBuffer (std::span< const char > str) override |
| Append buffer. | |
| StringBuilder & | operator+= (std::string_view str) |
| Append string. | |
| back_insert_iterator | back_inserter () |
| Create a back-insert-iterator. | |
Public Member Functions inherited from BaseStringBuilder | |
| void | Put (std::string_view str) |
| Append string. | |
| void | PutUint8 (uint8_t value) |
| Append binary uint8. | |
| void | PutSint8 (int8_t value) |
| Append binary int8. | |
| void | PutUint16LE (uint16_t value) |
| Append binary uint16 using little endian. | |
| void | PutSint16LE (int16_t value) |
| Append binary int16 using little endian. | |
| void | PutUint32LE (uint32_t value) |
| Append binary uint32 using little endian. | |
| void | PutSint32LE (int32_t value) |
| Append binary int32 using little endian. | |
| void | PutUint64LE (uint64_t value) |
| Append binary uint64 using little endian. | |
| void | PutSint64LE (int64_t value) |
| Append binary int64 using little endian. | |
| void | PutChar (char c) |
| Append 8-bit char. | |
| void | PutUtf8 (char32_t c) |
| Append UTF.8 char. | |
| template<class T > | |
| void | PutIntegerBase (T value, int base) |
| Append integer 'value' in given number 'base'. | |
Private Attributes | |
| std::string * | dest |
Compose data into a growing std::string.
Definition at line 65 of file string_builder.hpp.
| using StringBuilder::back_insert_iterator = std::back_insert_iterator<std::string> |
Definition at line 102 of file string_builder.hpp.
|
inline |
Construct StringBuilder into destination string.
Definition at line 72 of file string_builder.hpp.
|
inlinenoexcept |
Check whether any bytes have been written.
Definition at line 77 of file string_builder.hpp.
|
inline |
Create a back-insert-iterator.
Definition at line 106 of file string_builder.hpp.
Referenced by FormatBytes(), and FormatString().
|
inlinenoexcept |
Get number of already written bytes.
Definition at line 81 of file string_builder.hpp.
Referenced by MakeEnglishOriginalTownName().
|
inlinenoexcept |
Get mutable already written data.
Definition at line 89 of file string_builder.hpp.
Referenced by MakeCzechTownName(), MakeEnglishAdditionalTownName(), MakeEnglishOriginalTownName(), and MakeFinnishTownName().
|
inlinenoexcept |
Get already written data.
Definition at line 85 of file string_builder.hpp.
|
inline |
Append string.
Definition at line 96 of file string_builder.hpp.
References BaseStringBuilder::Put().
|
overridevirtual |
|
private |
Definition at line 66 of file string_builder.hpp.