io: give mapped_file begin/end accessors

This commit is contained in:
Danny Robson 2014-07-15 19:48:59 +10:00
parent f559f3d912
commit 1a461eddf0
2 changed files with 31 additions and 0 deletions

25
io.cpp
View File

@ -233,5 +233,30 @@ mapped_file::data (void) const {
return m_data;
}
uint8_t*
mapped_file::begin (void) {
return data ();
}
uint8_t*
mapped_file::end (void) {
return data () + size ();
}
const uint8_t*
mapped_file::begin (void) const {
return data ();
}
const uint8_t*
mapped_file::end (void) const {
return data () + size ();
}
#endif

6
io.hpp
View File

@ -126,6 +126,12 @@ namespace util {
const uint8_t* data (void) const;
uint8_t* data (void);
size_t size (void) const;
uint8_t* begin (void);
uint8_t* end (void);
const uint8_t* begin (void) const;
const uint8_t* end (void) const;
};
#endif