diff --git a/include/crucible/fd.h b/include/crucible/fd.h index ff390aa..89eec2e 100644 --- a/include/crucible/fd.h +++ b/include/crucible/fd.h @@ -1,6 +1,7 @@ #ifndef CRUCIBLE_FD_H #define CRUCIBLE_FD_H +#include "crucible/bytevector.h" #include "crucible/namedptr.h" #include @@ -125,11 +126,14 @@ namespace crucible { // Specialization for strings which reads/writes the string content, not the struct string template<> void write_or_die(int fd, const string& str); template<> void pread_or_die(int fd, string& str, off_t offset); - template<> void pread_or_die>(int fd, vector& str, off_t offset); - template<> void pread_or_die>(int fd, vector& str, off_t offset); template<> void pwrite_or_die(int fd, const string& str, off_t offset); - template<> void pwrite_or_die>(int fd, const vector& str, off_t offset); + template<> void pread_or_die(int fd, ByteVector& str, off_t offset); + template<> void pwrite_or_die(int fd, const ByteVector& str, off_t offset); + // Deprecated + template<> void pread_or_die>(int fd, vector& str, off_t offset); template<> void pwrite_or_die>(int fd, const vector& str, off_t offset); + template<> void pread_or_die>(int fd, vector& str, off_t offset) = delete; + template<> void pwrite_or_die>(int fd, const vector& str, off_t offset) = delete; // A different approach to reading a simple string string read_string(int fd, size_t size); diff --git a/lib/fd.cc b/lib/fd.cc index cbedda2..bc32485 100644 --- a/lib/fd.cc +++ b/lib/fd.cc @@ -458,7 +458,7 @@ namespace crucible { template<> void - pread_or_die>(int fd, vector &text, off_t offset) + pread_or_die(int fd, ByteVector &text, off_t offset) { return pread_or_die(fd, text.data(), text.size(), offset); } @@ -479,7 +479,7 @@ namespace crucible { template<> void - pwrite_or_die>(int fd, const vector &text, off_t offset) + pwrite_or_die(int fd, const ByteVector &text, off_t offset) { return pwrite_or_die(fd, text.data(), text.size(), offset); }