summaryrefslogtreecommitdiff
path: root/xsd/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:11 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:11 +0100
commit4538829ab86b5a1cd4e845e7eab165029c9d6d46 (patch)
treebbadf39aed0610c8f8f7b41fefff47773b8ac205 /xsd/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx
parent23d41842168ac1a1580111b9c5c73500ceee3d57 (diff)
parentaad5ad9bf0c02aa4e79bc6b7d6c934612fff4026 (diff)
Update upstream source from tag 'upstream/4.2.0'
Update to upstream version '4.2.0' with Debian dir 1b38df7bbcf313223de3c50107ac0255090fe647
Diffstat (limited to 'xsd/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx')
-rw-r--r--xsd/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx177
1 files changed, 0 insertions, 177 deletions
diff --git a/xsd/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx b/xsd/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx
deleted file mode 100644
index 4c89104..0000000
--- a/xsd/examples/cxx/tree/binary/boost/boost-archive-insertion.hxx
+++ /dev/null
@@ -1,177 +0,0 @@
-// file : examples/cxx/tree/binary/boost/boost-archive-insertion.cxx
-// copyright : not copyrighted - public domain
-
-#ifndef BOOST_ARCHIVE_INSERTION_HXX
-#define BOOST_ARCHIVE_INSERTION_HXX
-
-#include <cstddef> // std::size_t
-#include <string>
-
-#include <xsd/cxx/tree/buffer.hxx>
-#include <xsd/cxx/tree/ostream.hxx>
-
-#include <boost/cstdint.hpp>
-
-namespace xsd
-{
- namespace cxx
- {
- namespace tree
- {
- // as_size
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_size<T> x)
- {
- std::size_t v (static_cast<std::size_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- // 8-bit
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_int8<T> x)
- {
- boost::int8_t v (static_cast<boost::int8_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_uint8<T> x)
- {
- boost::uint8_t v (static_cast<boost::uint8_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // 16-bit
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_int16<T> x)
- {
- boost::int16_t v (static_cast<boost::int16_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_uint16<T> x)
- {
- boost::uint16_t v (static_cast<boost::uint16_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // 32-bit
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_int32<T> x)
- {
- boost::int32_t v (static_cast<boost::int32_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_uint32<T> x)
- {
- boost::uint32_t v (static_cast<boost::uint32_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // 64-bit
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_int64<T> x)
- {
- boost::int64_t v (static_cast<boost::int64_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_uint64<T> x)
- {
- boost::uint64_t v (static_cast<boost::uint64_t> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // Boolean
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_bool<T> x)
- {
- bool v (static_cast<bool> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // Floating-point
- //
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_float32<T> x)
- {
- float v (static_cast<float> (x.x_));
- s.impl () << v;
- return s;
- }
-
- template <typename Archive, typename T>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, ostream_common::as_float64<T> x)
- {
- double v (static_cast<double> (x.x_));
- s.impl () << v;
- return s;
- }
-
-
- // Insertion of std::basic_string.
- //
- template <typename Archive, typename C>
- inline ostream<Archive>&
- operator<< (ostream<Archive>& s, const std::basic_string<C>& x)
- {
- s.impl () << x;
- return s;
- }
-
-
- // Insertion of a binary buffer.
- //
- template <typename Archive, typename C>
- ostream<Archive>&
- operator<< (ostream<Archive>& s, const buffer<C>& x)
- {
- // Boost.Serialization needs an lvalue.
- //
- std::size_t size (x.size());
- s.impl () << size;
- s.impl ().save_binary (x.data (), x.size ());
- return s;
- }
- }
- }
-}
-
-#endif // BOOST_ARCHIVE_INSERTION_HXX