mm_mem_io_c: get_buffer() for r/w instances

This commit is contained in:
Moritz Bunkus 2013-04-15 22:06:09 +02:00
parent 3cb1ed9e65
commit 6a187a8702
2 changed files with 9 additions and 0 deletions

View File

@ -819,6 +819,14 @@ mm_mem_io_c::eof() {
return m_pos >= m_mem_size;
}
unsigned char *
mm_mem_io_c::get_buffer()
const {
if (m_read_only)
throw mtx::invalid_parameter_x();
return m_mem;
}
unsigned char *
mm_mem_io_c::get_and_lock_buffer() {
m_free_mem = false;

View File

@ -236,6 +236,7 @@ public:
m_file_name = file_name;
}
virtual unsigned char *get_buffer() const;
virtual unsigned char *get_and_lock_buffer();
virtual std::string get_content() const;