mirror of
https://github.com/ceph/ceph
synced 2024-12-28 22:43:29 +00:00
buffer: implement ptr::end_c_str()
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
43d0554d01
commit
3bf531708c
@ -900,6 +900,18 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
|
||||
buffer_c_str_accesses.inc();
|
||||
return _raw->get_data() + _off;
|
||||
}
|
||||
const char *buffer::ptr::end_c_str() const {
|
||||
assert(_raw);
|
||||
if (buffer_track_c_str)
|
||||
buffer_c_str_accesses.inc();
|
||||
return _raw->get_data() + _off + _len;
|
||||
}
|
||||
char *buffer::ptr::end_c_str() {
|
||||
assert(_raw);
|
||||
if (buffer_track_c_str)
|
||||
buffer_c_str_accesses.inc();
|
||||
return _raw->get_data() + _off + _len;
|
||||
}
|
||||
|
||||
unsigned buffer::ptr::unused_tail_length() const
|
||||
{
|
||||
|
@ -209,6 +209,8 @@ namespace buffer CEPH_BUFFER_API {
|
||||
raw *get_raw() const { return _raw; }
|
||||
const char *c_str() const;
|
||||
char *c_str();
|
||||
const char *end_c_str() const;
|
||||
char *end_c_str();
|
||||
unsigned length() const { return _len; }
|
||||
unsigned offset() const { return _off; }
|
||||
unsigned start() const { return _off; }
|
||||
|
Loading…
Reference in New Issue
Block a user