[#Unserialize-004] = Unserialize :mrdocs: `Unserialize` overloads == Synopses Declared in `<serialize.h>` Unserialize a boolean from a single byte in a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-0ff.adoc[Unserialize]( Stream& s, bool& a); ---- [.small]#xref:Unserialize-0ff.adoc[_» more..._]# Unserialize a byte from a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-0f8.adoc[Unserialize]( Stream& s, std::byte& a); ---- [.small]#xref:Unserialize-0f8.adoc[_» more..._]# Unserialize a signed 16‐bit little‐endian integer from a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-02.adoc[Unserialize]( Stream& s, int16_t& a); ---- [.small]#xref:Unserialize-02.adoc[_» more..._]# Unserialize a signed 32‐bit little‐endian integer from a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-0af.adoc[Unserialize]( Stream& s, int32_t& a); ---- [.small]#xref:Unserialize-0af.adoc[_» more..._]# Unserialize a signed 64‐bit little‐endian integer from a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-07.adoc[Unserialize]( Stream& s, int64_t& a); ---- [.small]#xref:Unserialize-07.adoc[_» more..._]# Unserialize a signed 8‐bit integer from a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-0ba.adoc[Unserialize]( Stream& s, int8_t& a); ---- [.small]#xref:Unserialize-0ba.adoc[_» more..._]# Unserialize an unsigned 16‐bit little‐endian integer from a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-01c.adoc[Unserialize]( Stream& s, uint16_t& a); ---- [.small]#xref:Unserialize-01c.adoc[_» more..._]# Unserialize an unsigned 32‐bit little‐endian integer from a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-0aa.adoc[Unserialize]( Stream& s, uint32_t& a); ---- [.small]#xref:Unserialize-0aa.adoc[_» more..._]# Unserialize an unsigned 64‐bit little‐endian integer from a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-05.adoc[Unserialize]( Stream& s, uint64_t& a); ---- [.small]#xref:Unserialize-05.adoc[_» more..._]# Unserialize an unsigned 8‐bit integer from a stream. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Stream> void xref:Unserialize-04.adoc[Unserialize]( Stream& s, uint8_t& a); ---- [.small]#xref:Unserialize-04.adoc[_» more..._]# Unserialize a string written as a CompactSize length followed by its bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename C> void xref:Unserialize-08a.adoc[Unserialize]( Stream& is, std::basic_string<C>& str); ---- [.small]#xref:Unserialize-08a.adoc[_» more..._]# Deleted: a string view cannot own storage to unserialize into. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename C> void xref:Unserialize-0d63.adoc[Unserialize]( Stream& is, std::basic_string_view<C>& str) = delete; ---- [.small]#xref:Unserialize-0d63.adoc[_» more..._]# Unserialize any object that provides an Unserialize member function. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename T> requires Unserializable<T, Stream> void xref:Unserialize-09.adoc[Unserialize]( Stream& is, T&& a); ---- [.small]#xref:Unserialize-09.adoc[_» more..._]# Unserialize into a newly constructed object owned by a shared_ptr. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename T> void xref:Unserialize-0e.adoc[Unserialize]( Stream& os, std::shared_ptr<T const>& p); ---- [.small]#xref:Unserialize-0e.adoc[_» more..._]# Unserialize into a newly constructed object owned by a unique_ptr. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename T> void xref:Unserialize-01b.adoc[Unserialize]( Stream& os, std::unique_ptr<T const>& p); ---- [.small]#xref:Unserialize-01b.adoc[_» more..._]# Deleted overload that forbids unserializing char; use uint8_t or int8_t instead. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:CharNotInt8.adoc[CharNotInt8] V> void xref:Unserialize-0a9.adoc[Unserialize]( Stream& s, V v) = delete; ---- [.small]#xref:Unserialize-0a9.adoc[_» more..._]# Unserialize a dynamic‐extent span of basic bytes from raw bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:BasicByte.adoc[BasicByte] B> void xref:Unserialize-0c8.adoc[Unserialize]( Stream& s, std::span<B> span); ---- [.small]#xref:Unserialize-0c8.adoc[_» more..._]# Unserialize a pair as its first then second element. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename K, typename T> void xref:Unserialize-03.adoc[Unserialize]( Stream& is, std::pair<K, T>& item); ---- [.small]#xref:Unserialize-03.adoc[_» more..._]# Unserialize a prevector. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, unsigned int N, typename T> void xref:Unserialize-0bf.adoc[Unserialize]( Stream& is, xref:prevector-0c.adoc[prevector<N, T>]& v); ---- [.small]#xref:Unserialize-0bf.adoc[_» more..._]# Unserialize a vector. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename T, typename A> void xref:Unserialize-0cc.adoc[Unserialize]( Stream& is, std::vector<T, A>& v); ---- [.small]#xref:Unserialize-0cc.adoc[_» more..._]# Unserialize a fixed‐extent span of basic bytes from raw bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:BasicByte.adoc[BasicByte] B, size_t N> void xref:Unserialize-0d61.adoc[Unserialize]( Stream& s, std::span<B, N> span); ---- [.small]#xref:Unserialize-0d61.adoc[_» more..._]# Unserialize a std::array of basic bytes from raw bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:BasicByte.adoc[BasicByte] B, size_t N> void xref:Unserialize-088.adoc[Unserialize]( Stream& s, std::array<B, N>& a); ---- [.small]#xref:Unserialize-088.adoc[_» more..._]# Unserialize a C array of basic bytes from raw bytes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, xref:BasicByte.adoc[BasicByte] B, size_t N> void xref:Unserialize-00a.adoc[Unserialize]( Stream& s, B(& a)[]); ---- [.small]#xref:Unserialize-00a.adoc[_» more..._]# Unserialize a set written as a CompactSize count followed by its elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename K, typename Pred, typename A> void xref:Unserialize-0d1.adoc[Unserialize]( Stream& is, std::set<K, Pred, A>& m); ---- [.small]#xref:Unserialize-0d1.adoc[_» more..._]# Unserialize a map written as a CompactSize count followed by its entries. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Stream, typename K, typename T, typename Pred, typename A> void xref:Unserialize-017.adoc[Unserialize]( Stream& is, std::map<K, T, Pred, A>& m); ---- [.small]#xref:Unserialize-017.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *s* | The input stream. | *a* | The boolean value to read into. | *is* | The input stream. | *str* | The string to fill. | *os* | The input stream. | *p* | The shared pointer to populate. | *v* | The char value that must not be unserialized. | *span* | The span of bytes to read into. | *item* | The pair to fill. | *m* | The set to fill. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#