Skip to content

Commit

Permalink
Drop OverrideStream
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtowns committed Nov 1, 2023
1 parent 48a43f5 commit ae5838a
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions src/streams.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,45 +45,6 @@ inline void Xor(Span<std::byte> write, Span<const std::byte> key, size_t key_off
}
} // namespace util

template<typename Stream>
class OverrideStream
{
Stream* stream;

const int nVersion;

public:
OverrideStream(Stream* stream_, int nVersion_) : stream{stream_}, nVersion{nVersion_} {}

template<typename T>
OverrideStream<Stream>& operator<<(const T& obj)
{
::Serialize(*this, obj);
return (*this);
}

template<typename T>
OverrideStream<Stream>& operator>>(T&& obj)
{
::Unserialize(*this, obj);
return (*this);
}

void write(Span<const std::byte> src)
{
stream->write(src);
}

void read(Span<std::byte> dst)
{
stream->read(dst);
}

int GetVersion() const { return nVersion; }
size_t size() const { return stream->size(); }
void ignore(size_t size) { return stream->ignore(size); }
};

/* Minimal stream for overwriting and/or appending to an existing byte vector
*
* The referenced vector will grow as necessary
Expand Down

0 comments on commit ae5838a

Please sign in to comment.