raw(const raw &other);
const raw& operator=(const raw &other);
+ virtual char *get_data() {
+ return data;
+ }
virtual raw* clone_empty() = 0;
raw *clone() {
raw *c = clone_empty();
return len;
}
- bool is_page_aligned() {
+ virtual bool is_page_aligned() {
return ((long)data & ~CEPH_PAGE_MASK) == 0;
}
bool is_n_page_sized() {
bool buffer::ptr::at_buffer_tail() const { return _off + _len == _raw->len; }
- const char *buffer::ptr::c_str() const { assert(_raw); return _raw->data + _off; }
- char *buffer::ptr::c_str() { assert(_raw); return _raw->data + _off; }
+ const char *buffer::ptr::c_str() const {
+ assert(_raw);
+ return _raw->get_data() + _off;
+ }
+ char *buffer::ptr::c_str() {
+ assert(_raw);
+ return _raw->get_data() + _off;
+ }
unsigned buffer::ptr::unused_tail_length() const
{
{
assert(_raw);
assert(n < _len);
- return _raw->data[_off + n];
+ return _raw->get_data()[_off + n];
}
char& buffer::ptr::operator[](unsigned n)
{
assert(_raw);
assert(n < _len);
- return _raw->data[_off + n];
+ return _raw->get_data()[_off + n];
}
const char *buffer::ptr::raw_c_str() const { assert(_raw); return _raw->data; }