29 #ifndef CEREAL_ARCHIVES_BINARY_HPP_ 30 #define CEREAL_ARCHIVES_BINARY_HPP_ 67 auto const writtenSize =
static_cast<std::size_t
>( itsStream.rdbuf()->sputn( reinterpret_cast<const char*>( data ), size ) );
69 if(writtenSize != size)
70 throw Exception(
"Failed to write " + std::to_string(size) +
" bytes to output stream! Wrote " + std::to_string(writtenSize));
74 std::ostream & itsStream;
102 auto const readSize =
static_cast<std::size_t
>( itsStream.rdbuf()->sgetn( reinterpret_cast<char*>( data ), size ) );
105 throw Exception(
"Failed to read " + std::to_string(size) +
" bytes from input stream! Read " + std::to_string(readSize));
109 std::istream & itsStream;
116 template<
class T>
inline 117 typename std::enable_if<std::is_arithmetic<T>::value,
void>::type
124 template<
class T>
inline 125 typename std::enable_if<std::is_arithmetic<T>::value,
void>::type
132 template <
class Archive,
class T>
inline 140 template <
class Archive,
class T>
inline 148 template <
class T>
inline 155 template <
class T>
inline 169 #endif // CEREAL_ARCHIVES_BINARY_HPP_ #define CEREAL_SETUP_ARCHIVE_TRAITS(InputArchive, OutputArchive)
Sets up traits that relate an input archive to an output archive.
Definition: traits.hpp:169
PT data
pointer to beginning of data
Definition: helpers.hpp:219
A wrapper around size metadata.
Definition: helpers.hpp:273
#define CEREAL_SERIALIZE_FUNCTION_NAME
The serialization/deserialization function name to search for.
Definition: macros.hpp:78
Definition: access.hpp:40
#define CEREAL_REGISTER_ARCHIVE(Archive)
Registers a specific Archive type with cereal.
Definition: cereal.hpp:141
#define CEREAL_ARCHIVE_RESTRICT(INTYPE, OUTTYPE)
A macro to use to restrict which types of archives your function will work for.
Definition: traits.hpp:1293
Main cereal functionality.
For holding name value pairs.
Definition: helpers.hpp:137
#define CEREAL_LOAD_FUNCTION_NAME
The deserialization (load) function name to search for.
Definition: macros.hpp:85
#define CEREAL_NOEXCEPT
Defines the CEREAL_NOEXCEPT macro to use instead of noexcept.
Definition: macros.hpp:130
void saveBinary(const void *data, std::size_t size)
Writes size bytes of data to the output stream.
Definition: binary.hpp:65
BinaryOutputArchive(std::ostream &stream)
Construct, outputting to the provided stream.
Definition: binary.hpp:57
A wrapper around data that can be serialized in a binary fashion.
Definition: helpers.hpp:209
The base output archive class.
Definition: cereal.hpp:234
#define CEREAL_SAVE_FUNCTION_NAME
The serialization (save) function name to search for.
Definition: macros.hpp:92
uint64_t size
size in bytes
Definition: helpers.hpp:220
An exception class thrown when things go wrong at runtime.
Definition: helpers.hpp:48
An output archive designed to save data in a compact binary representation.
Definition: binary.hpp:51