29 #ifndef CEREAL_ARCHIVES_BINARY_HPP_
30 #define CEREAL_ARCHIVES_BINARY_HPP_
67 auto const writtenSize =
itsStream.rdbuf()->sputn(
reinterpret_cast<const char*
>( data ), size );
69 if(writtenSize != size)
102 auto const readSize =
itsStream.rdbuf()->sgetn(
reinterpret_cast<char*
>( data ), size );
116 template<
class T>
inline
124 template<
class T>
inline
132 template <
class Archive,
class T>
inline
140 template <
class Archive,
class T>
inline
148 template <
class T>
inline
155 template <
class T>
inline
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
Definition: json.hpp:25318
Main cereal functionality.
#define CEREAL_REGISTER_ARCHIVE(Archive)
Registers a specific Archive type with cereal.
Definition: cereal.hpp:195
An output archive designed to save data in a compact binary representation.
Definition: binary.hpp:52
std::ostream & itsStream
Definition: binary.hpp:74
~BinaryOutputArchive() CEREAL_NOEXCEPT=default
BinaryOutputArchive(std::ostream &stream)
Construct, outputting to the provided stream.
Definition: binary.hpp:57
void saveBinary(const void *data, std::streamsize size)
Writes size bytes of data to the output stream.
Definition: binary.hpp:65
For holding name value pairs.
Definition: helpers.hpp:140
The base output archive class.
Definition: cereal.hpp:319
A wrapper around size metadata.
Definition: helpers.hpp:313
#define CEREAL_NOEXCEPT
Defines the CEREAL_NOEXCEPT macro to use instead of noexcept.
Definition: macros.hpp:130
type
The type the bitset is encoded with.
Definition: bitset.hpp:44
in certain simple scenarios. They should probably not be used if maximizing performance is the main o...
Definition: access.hpp:42
std::enable_if< std::is_arithmetic< T >::value, void >::type CEREAL_LOAD_FUNCTION_NAME(BinaryInputArchive &ar, T &t)
Loading for POD types from binary.
Definition: binary.hpp:126
CEREAL_SERIALIZE_FUNCTION_NAME(Archive &ar, NameValuePair< T > &t)
Serializing NVP types to binary.
Definition: binary.hpp:134
std::enable_if< std::is_arithmetic< T >::value, void >::type CEREAL_SAVE_FUNCTION_NAME(BinaryOutputArchive &ar, T const &t)
Saving for POD types to binary.
Definition: binary.hpp:118
@ AllowEmptyClassElision
Definition: cereal.hpp:185
Definition: json.hpp:5678
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1282
A wrapper around data that can be serialized in a binary fashion.
Definition: helpers.hpp:212
PT data
pointer to beginning of data
Definition: helpers.hpp:221
uint64_t size
size in bytes
Definition: helpers.hpp:222
An exception class thrown when things go wrong at runtime.
Definition: helpers.hpp:49
#define CEREAL_SETUP_ARCHIVE_TRAITS(InputArchive, OutputArchive)
Sets up traits that relate an input archive to an output archive.
Definition: traits.hpp:169
#define CEREAL_ARCHIVE_RESTRICT(INTYPE, OUTTYPE)
A macro to use to restrict which types of archives your function will work for.
Definition: traits.hpp:1315
#define const
Definition: zconf.h:233