diff options
Diffstat (limited to 'src/util/ConstBuffer.hxx')
-rw-r--r-- | src/util/ConstBuffer.hxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util/ConstBuffer.hxx b/src/util/ConstBuffer.hxx index 74fe297b5..ad795911e 100644 --- a/src/util/ConstBuffer.hxx +++ b/src/util/ConstBuffer.hxx @@ -289,6 +289,19 @@ struct ConstBuffer { size = end() - new_data; data = new_data; } + + /** + * Move the end pointer to the given address (by adjusting the + * size). + */ + void SetEnd(pointer_type new_end) { +#ifndef NDEBUG + assert(IsNull() == (new_end == nullptr)); + assert(new_end >= begin()); +#endif + + size = new_end - data; + } }; #endif |