Move io functions into the util namespace
This commit is contained in:
parent
6b0db35db7
commit
f02501eb5e
3
io.cpp
3
io.cpp
@ -11,10 +11,11 @@
|
|||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace util;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
uint8_t *
|
uint8_t *
|
||||||
slurp (const boost::filesystem::path& path) {
|
util::slurp (const boost::filesystem::path& path) {
|
||||||
fd_ref fd(open (path.string ().c_str (), O_RDONLY)); // | O_CLOEXEC));
|
fd_ref fd(open (path.string ().c_str (), O_RDONLY)); // | O_CLOEXEC));
|
||||||
|
|
||||||
// Calculate the total file size
|
// Calculate the total file size
|
||||||
|
6
io.hpp
6
io.hpp
@ -25,8 +25,10 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem/path.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
namespace util {
|
||||||
/// Specifies bitwise combinations of IO access rights.
|
/// Specifies bitwise combinations of IO access rights.
|
||||||
enum access_t {
|
enum access_t {
|
||||||
ACCESS_READ = 1 << 0,
|
ACCESS_READ = 1 << 0,
|
||||||
@ -76,6 +78,6 @@ class mapped_file {
|
|||||||
size_t size (void) const;
|
size_t size (void) const;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace util;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parsing
|
* Parsing
|
||||||
|
Loading…
Reference in New Issue
Block a user