Slurp should take a const source path
This commit is contained in:
parent
6d52e37c93
commit
a3a6765d38
4
io.cpp
4
io.cpp
@ -15,8 +15,8 @@ using namespace std;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
uint8_t *
|
||||
slurp (boost::filesystem::path& path) {
|
||||
fd_ref fd(open (path.c_str(), O_RDONLY | O_CLOEXEC));
|
||||
slurp (const boost::filesystem::path& path) {
|
||||
fd_ref fd(open (path.string ().c_str (), O_RDONLY)); // | O_CLOEXEC));
|
||||
|
||||
// Calculate the total file size
|
||||
off_t size = lseek (fd, 0, SEEK_END);
|
||||
|
2
io.hpp
2
io.hpp
@ -38,7 +38,7 @@ enum access_t {
|
||||
/// Reads an entire file into memory. Caller frees the result. Guarantees a
|
||||
/// null trailing byte.
|
||||
uint8_t *
|
||||
slurp (boost::filesystem::path&) mustuse;
|
||||
slurp (const boost::filesystem::path&) mustuse;
|
||||
|
||||
/// A simple RAII wrapper for file descriptors
|
||||
struct fd_ref {
|
||||
|
Loading…
Reference in New Issue
Block a user