MyraMath
|
Wraps a std::vector<char>, presents it as both an InputStream and OutputStream. Useful for hygienic unit testing of classes that serialize. More...
#include <VectorStream.h>
Public Member Functions | |
VectorStream () | |
Default constructs an empty VectorStream. | |
virtual void | write_binary (const char *p, size_t n) |
Writes n bytes into buffer, using push_back() | |
virtual void | read_binary (char *p, size_t n) |
Reads n bytes from buffer, writing into p. | |
void | swap (std::vector< char > &that) |
Swap internal contents into that, overwriting it. | |
![]() | |
template<class T > | |
T | read () |
![]() | |
template<class T > | |
void | write (const T &t) |
Wraps a std::vector<char>, presents it as both an InputStream and OutputStream. Useful for hygienic unit testing of classes that serialize.