mirror of
https://github.com/boostorg/endian.git
synced 2025-08-02 14:04:29 +02:00
Get test going, start on docs
git-svn-id: http://svn.boost.org/svn/boost/sandbox/endian@72194 b8fc166d-592f-0410-95f2-cb63ce0dd405
This commit is contained in:
@@ -1,14 +1,12 @@
|
|||||||
// boost/binary_stream.hpp ----------------------------------------------------------//
|
// boost/io/detail/bin_manip.hpp -----------------------------------------------------//
|
||||||
|
|
||||||
// Copyright Beman Dawes 2009, 2011
|
// Copyright Beman Dawes 2009, 2011
|
||||||
|
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
// See documentation at http://www.boost.org/libs/utility
|
#ifndef BOOST_BIN_MANIP_HPP
|
||||||
|
#define BOOST_BIN_MANIP_HPP
|
||||||
#ifndef BOOST_BINARY_STREAM_HPP
|
|
||||||
#define BOOST_BINARY_STREAM_HPP
|
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
@@ -20,7 +18,7 @@
|
|||||||
# include <cwchar> // for wcslen
|
# include <cwchar> // for wcslen
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// unformatted binary (as opposed to formatted character) input and output
|
// unformatted binary (as opposed to formatted character) input and output manipulator
|
||||||
|
|
||||||
// Caution: Use only on streams opened with filemode std::ios_base::binary. Thus
|
// 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.)
|
// unformatted binary I/O should not be with the standard streams (cout, cin, etc.)
|
||||||
@@ -79,4 +77,4 @@ inline std::istream& operator>>(std::istream& is, detail::binary_data<T> x)
|
|||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif // BOOST_BINARY_STREAM_HPP
|
#endif // BOOST_BIN_MANIP_HPP
|
||||||
|
@@ -6,12 +6,36 @@
|
|||||||
<meta name="ProgId" content="FrontPage.Editor.Document">
|
<meta name="ProgId" content="FrontPage.Editor.Document">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||||
<title>Binary Stream I/O</title>
|
<title>Binary Stream I/O</title>
|
||||||
<link rel="stylesheet" type="text/css" href="../../../doc/html/minimal.css">
|
<link rel="stylesheet" type="text/css" href="../../../doc/src/minimal.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<table border="0" cellpadding="5" cellspacing="0"
|
||||||
|
style="border-collapse: collapse">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td width="277"><a href="../../../index.htm"><img
|
||||||
|
src="../../../boost.png" alt="boost.png (6897 bytes)" align="middle"
|
||||||
|
width="300" height="86" border="0" /></a></td>
|
||||||
|
<td>
|
||||||
|
<h1 align="center">Binary
|
||||||
|
I/O Manipulators<br>
|
||||||
|
for Binary Streams</h1>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table border="1" cellpadding="5" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p align="center"><b>Binary
|
||||||
|
I/O Manipulators
|
||||||
|
for Strings are not yet accepted into Boost as public components. Thus the
|
||||||
|
header file is currently located in <boost/io/detail/bin_manip.hpp></b></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<h1>Proposal for Binary Stream I/O</h1>
|
|
||||||
<h2>Introduction</h2>
|
<h2>Introduction</h2>
|
||||||
<p>The C++ standard library's stream I/O facilities are type-safe and very
|
<p>The C++ standard library's stream I/O facilities are type-safe and very
|
||||||
convenient for performing formatted (i.e. human readable) I/O. But they offer only
|
convenient for performing formatted (i.e. human readable) I/O. But they offer only
|
||||||
@@ -77,7 +101,7 @@ are implementation supplied types.</p>
|
|||||||
return 0;
|
return 0;
|
||||||
}</pre>
|
}</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>The file produced with be four bytes in length. On a big-endian machine, the
|
<p>The file produced will be four bytes in length. On a big-endian machine, the
|
||||||
contents in hexadecimal are:</p>
|
contents in hexadecimal are:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>01020304</pre>
|
<pre>01020304</pre>
|
||||||
@@ -88,7 +112,7 @@ contents in hexadecimal are:</p>
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
<hr>
|
<hr>
|
||||||
<p>Last revised:
|
<p>Last revised:
|
||||||
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->24 April, 2011<!--webbot bot="Timestamp" endspan i-checksum="29830" --></p>
|
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->26 May, 2011<!--webbot bot="Timestamp" endspan i-checksum="13972" --></p>
|
||||||
<p><EFBFBD> Copyright Beman Dawes, 2009, 2011</p>
|
<p><EFBFBD> Copyright Beman Dawes, 2009, 2011</p>
|
||||||
<p>Distributed under the Boost Software License, Version 1.0. See
|
<p>Distributed under the Boost Software License, Version 1.0. See
|
||||||
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/ LICENSE_1_0.txt</a></p>
|
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/ LICENSE_1_0.txt</a></p>
|
||||||
|
@@ -23,4 +23,5 @@ test-suite "io"
|
|||||||
]
|
]
|
||||||
|
|
||||||
[ run quoted_manip_test.cpp ]
|
[ run quoted_manip_test.cpp ]
|
||||||
|
[ run bin_manip_test.cpp ]
|
||||||
;
|
;
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
// binary_stream_test.cpp ------------------------------------------------------------//
|
// bin_manip_test.cpp ----------------------------------------------------------------//
|
||||||
|
|
||||||
// Copyright Beman Dawes 2009
|
// Copyright Beman Dawes 2009
|
||||||
|
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// See http://www.boost.org/LICENSE_1_0.txt
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/binary_stream.hpp>
|
#include <boost/io/detail/bin_manip.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
Reference in New Issue
Block a user