20 assert(begin_ && end_);
21 assert((end_ - begin_) >= 0);
39 size_t read(
char *to,
size_t sz,
size_t count);
44 size_t avail =
Size() / sz;
45 count = std::min(count, avail);
46 size_t fullsize = sz * count;
47 assert(fullsize <=
Size());
48 memcpy(to,
begin, fullsize);
Definition ByteRange.h:12
ByteRange(const char *begin_, size_t size)
Definition ByteRange.h:23
const char & operator[](size_t idx) const
Definition ByteRange.h:36
size_t Size() const
Definition ByteRange.h:34
size_t read(char *to, size_t sz, size_t count)
Definition ByteRange.h:42
ByteRange(const char *begin_, const char *end_)
Definition ByteRange.h:16
bool Empty() const
Definition ByteRange.h:33
const char * end
Definition ByteRange.h:31
ByteRange()
Definition ByteRange.h:13
const char * begin
Definition ByteRange.h:30
const char & operator*() const
Definition ByteRange.h:37