diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-06-19 17:01:27 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-06-19 17:01:27 +0100 |
| commit | b8908f2dc6113fb38571a98be777128a0a2abe79 (patch) | |
| tree | 528203bce51d03ecd4c680499126ee401e35e329 /src/string.hh | |
| parent | f2ba54b2d476deedb9494109340013abf3f1024a (diff) | |
Add a String::resize method
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string.hh b/src/string.hh index 390eacf1..fb48137e 100644 --- a/src/string.hh +++ b/src/string.hh @@ -125,6 +125,7 @@ public: void push_back(char c) { m_data.append(&c, 1); } void force_size(ByteCount size) { m_data.force_size((size_t)size); } void reserve(ByteCount size) { m_data.reserve((size_t)size); } + void resize(ByteCount size, char c); static const String ms_empty; @@ -165,6 +166,7 @@ public: template<bool copy = true> void reserve(size_t new_capacity); + void set_size(size_t size); void force_size(size_t new_size); void append(const char* str, size_t len); void clear(); @@ -172,7 +174,6 @@ public: private: void release(); void set_empty() { s.size = 1; } - void set_size(size_t size); void set_short(const char* data, size_t size); }; |
