io: add const begin/end to mapped_file
This commit is contained in:
parent
94dc6274dc
commit
8c5c98f5cc
18
io_posix.cpp
18
io_posix.cpp
@ -77,7 +77,7 @@ mapped_file::empty (void) const
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
uint8_t*
|
||||
mapped_file::data (void) {
|
||||
CHECK (m_size > 0);
|
||||
@ -111,6 +111,22 @@ mapped_file::end (void) {
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
const uint8_t*
|
||||
mapped_file::begin (void) const
|
||||
{
|
||||
return data ();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
const uint8_t*
|
||||
mapped_file::end (void) const
|
||||
{
|
||||
return data () + size ();
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const uint8_t*
|
||||
mapped_file::cbegin (void) const {
|
||||
|
@ -11,7 +11,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Copyright 2010-2014 Danny Robson <danny@nerdcruft.net>
|
||||
* Copyright 2010-2016 Danny Robson <danny@nerdcruft.net>
|
||||
*/
|
||||
|
||||
#ifndef __UTIL_IO_POSIX_HPP
|
||||
@ -39,8 +39,11 @@ namespace util {
|
||||
bool empty (void) const;
|
||||
size_t size (void) const;
|
||||
|
||||
uint8_t* begin (void);
|
||||
uint8_t* end (void);
|
||||
uint8_t* begin (void);
|
||||
uint8_t* end (void);
|
||||
|
||||
const uint8_t* begin (void) const;
|
||||
const uint8_t* end (void) const;
|
||||
|
||||
const uint8_t* cbegin (void) const;
|
||||
const uint8_t* cend (void) const;
|
||||
|
16
io_win32.cpp
16
io_win32.cpp
@ -183,6 +183,22 @@ mapped_file::end (void)
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
const uint8_t*
|
||||
mapped_file::begin (void) const
|
||||
{
|
||||
return cbegin ();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
const uint8_t*
|
||||
mapped_file::end (void) const
|
||||
{
|
||||
return cend ();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
const uint8_t*
|
||||
mapped_file::cbegin (void) const
|
||||
|
@ -11,7 +11,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Copyright 2014 Danny Robson <danny@nerdcruft.net>
|
||||
* Copyright 2014-2016 Danny Robson <danny@nerdcruft.net>
|
||||
*/
|
||||
|
||||
#ifndef __UTIL_IO_WIN32_HPP
|
||||
@ -50,8 +50,11 @@ namespace util {
|
||||
size_t size (void) const;
|
||||
bool empty (void) const;
|
||||
|
||||
uint8_t* begin (void);
|
||||
uint8_t* end (void);
|
||||
uint8_t* begin (void);
|
||||
uint8_t* end (void);
|
||||
|
||||
const uint8_t* begin (void) const;
|
||||
const uint8_t* end (void) const;
|
||||
|
||||
const uint8_t* cbegin (void) const;
|
||||
const uint8_t* cend (void) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user