From fbedc9bb9fcca166c1bf2e549535537ac8a10769 Mon Sep 17 00:00:00 2001 From: Beman Date: Wed, 29 May 2013 08:36:40 -0400 Subject: [PATCH] Remove another bin_manip file. Note that all the bin-manip files have been copied to git@github.com:Beman/bin-manip.git --- include/boost/io/detail/bin_manip.hpp | 80 --------------------------- 1 file changed, 80 deletions(-) delete mode 100644 include/boost/io/detail/bin_manip.hpp diff --git a/include/boost/io/detail/bin_manip.hpp b/include/boost/io/detail/bin_manip.hpp deleted file mode 100644 index 2ccc90d..0000000 --- a/include/boost/io/detail/bin_manip.hpp +++ /dev/null @@ -1,80 +0,0 @@ -// boost/io/detail/bin_manip.hpp -----------------------------------------------------// - -// Copyright Beman Dawes 2009, 2011 - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - -#ifndef BOOST_BIN_MANIP_HPP -#define BOOST_BIN_MANIP_HPP - -#include -#include -#include -#include -#include // for strlen - -#ifndef BOOST_NO_CWCHAR -# include // for wcslen -#endif - -// unformatted binary (as opposed to formatted character) input and output manipulator - -// Caution: Use only on streams opened with filemode std::ios_base::binary. Thus -// unformatted binary I/O should not be with the standard streams (cout, cin, etc.) -// since they are opened in text mode. Use on text streams may produce incorrect -// results, such as insertion of unwanted characters or premature end-of-file. -// For example, on Windows 0x0D would become 0x0D, 0x0A. - -namespace boost -{ - -namespace detail -{ - template - struct const_binary_data - { - const char* ptr; - explicit const_binary_data(const T& x) : ptr(reinterpret_cast(&x)) {} - }; - template - struct binary_data - { - char* ptr; - explicit binary_data(T& x) : ptr(reinterpret_cast(&x)) {} - }; -} - -template -inline detail::const_binary_data bin(const T& x) -{ - return detail::const_binary_data(x); -} - -template -inline detail::binary_data bin(T& x) -{ - return detail::binary_data(x); -} - -template -inline std::ostream& operator<<(std::ostream& os, detail::const_binary_data x) -{ - return os.write(x.ptr, sizeof(T)); -} - -template -inline std::ostream& operator<<(std::ostream& os, detail::binary_data x) -{ - return os.write(x.ptr, sizeof(T)); -} - -template -inline std::istream& operator>>(std::istream& is, detail::binary_data x) -{ - return is.read(x.ptr, sizeof(T)); -} - -} // namespace boost - -#endif // BOOST_BIN_MANIP_HPP