1
0
mirror of https://github.com/Zygo/bees.git synced 2025-06-16 17:46:16 +02:00

fd: start deprecating vector<uint8_t> for p{read,write}_or_die

Add support for pread and pwrite of ByteVector objects alongside
vector<uint8_t>.  A later commit will delete the template specializations
for vector<uint8_t>, but existing users have to be updated to use
ByteVector first.

Nothing currently uses vector<char>, so we can delete that immediately.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell
2021-10-12 12:12:14 -04:00
parent bba6f4f183
commit 99709d889f
2 changed files with 9 additions and 5 deletions

View File

@ -458,7 +458,7 @@ namespace crucible {
template<>
void
pread_or_die<vector<char>>(int fd, vector<char> &text, off_t offset)
pread_or_die<ByteVector>(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<vector<char>>(int fd, const vector<char> &text, off_t offset)
pwrite_or_die<ByteVector>(int fd, const ByteVector &text, off_t offset)
{
return pwrite_or_die(fd, text.data(), text.size(), offset);
}