print into the buffer, expanding if needed */
| 100 | print into the buffer, expanding if needed |
| 101 | */ |
| 102 | bool ExpandingString::append(const char *s, uint32_t len) |
| 103 | { |
| 104 | if (allocation_failed) { |
| 105 | return false; |
| 106 | } |
| 107 | if (buflen - used < len && !expand(len)) { |
| 108 | return false; |
| 109 | } |
| 110 | if (s != nullptr) { |
| 111 | memcpy(&buf[used], s, len); |
| 112 | } |
| 113 | used += len; |
| 114 | return true; |
| 115 | } |
| 116 | |
| 117 | ExpandingString::~ExpandingString() |
| 118 | { |