From 3d814f4f527882e746fe27ea31ca641fb7e14a15 Mon Sep 17 00:00:00 2001
From: Beman One class template is provided: Typedefs, such as Last revised:
-17 January, 2015 © Copyright Beman Dawes, 2006-2009, 2013 Distributed under the Boost Software License, Version 1.0. See
www.boost.org/ LICENSE_1_0.txt One class template is provided: Typedefs, such as Last revised:
-17 January, 2015 © Copyright Beman Dawes, 2006-2009, 2013 Distributed under the Boost Software License, Version 1.0. See
www.boost.org/ LICENSE_1_0.txt
-
+
Endian Arithmetic Types
@@ -109,10 +109,11 @@ using namespace boost::endian;
namespace
{
- // This is an extract from a very widely used GIS file format. It seems odd
- // to mix big and little endians in the same file - but this is a real-world
- // format and users wishing to write low level code manipulating these files
- // must deal with the mixed endianness.
+ // This is an extract from a very widely used GIS file format.
+ // Why the designer decided to mix big and little endians in
+ // the same file is not known. But this is a real-world format
+ // and users wishing to write low level code manipulating these
+ // files have to deal with the mixed endianness.
struct header
{
@@ -136,11 +137,13 @@ int main(int, char* [])
h.version = 1;
h.shape_type = 0x01020304;
- // Low-level I/O such as POSIX read/write or <cstdio> fread/fwrite is sometimes
- // used for binary file operations when ultimate efficiency is important. Such
- // I/O is often performed in some C++ wrapper class, but to drive home the
- // point that endian integers are often used in fairly low-level code that does
- // bulk I/O operations, <cstdio> fopen/fwrite is used for I/O in this example.
+ // Low-level I/O such as POSIX read/write or <cstdio>
+ // fread/fwrite is sometimes used for binary file operations
+ // when ultimate efficiency is important. Such I/O is often
+ // performed in some C++ wrapper class, but to drive home the
+ // point that endian integers are often used in fairly
+ // low-level code that does bulk I/O operations, <cstdio>
+ // fopen/fwrite is used for I/O in this example.
std::FILE* fi = std::fopen(filename, "wb"); // MUST BE BINARY
@@ -205,8 +208,9 @@ enum class align {no, yes};
-
template <order Order, typename T, std::size_t n_bits, align A = align::no>
- class endian_arithmetic;
+
template <order Order, typename T, std::size_t n_bits,
+ align Align = align::no>
+class endian_arithmetic;
big_int32_t
, provide convenient naming
@@ -366,9 +370,10 @@ usual operations on integers are supplied.
-
+
Endian Buffer Types
@@ -195,8 +195,9 @@ enum class align {no, yes};
-
template <order Order, typename T, std::size_t Nbits, align A = align::no>
- class endian_buffer;
+
template <order Order, typename T, std::size_t Nbits,
+ align Align = align::no>
+class endian_buffer;
big_int32_buf_t
, provide convenient naming
@@ -356,7 +357,8 @@ usual operations on integers are supplied.
@@ -400,7 +400,7 @@ arithmetic approach.
-
+
Choosing the Approach
Last revised: -17 January, 2015
+19 January, 2015© Copyright Beman Dawes, 2011, 2013, 2014
Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt
diff --git a/doc/conversion.html b/doc/conversion.html index 53d33d6..c23617b 100644 --- a/doc/conversion.html +++ b/doc/conversion.html @@ -1,4 +1,4 @@ - + @@ -15,7 +15,7 @@int8_t endian_reverse()
and templated
endian_reverse_inplace()
implementations.
Last revised: -17 January, 2015
+19 January, 2015© Copyright Beman Dawes, 2011, 2013
Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt
diff --git a/doc/index.html b/doc/index.html index 6836b0d..27e0b10 100644 --- a/doc/index.html +++ b/doc/index.html @@ -15,7 +15,7 @@endian/arithmetic.hpp
and
- endian/conversion.hpp
. endian/buffers.hpp
has been
+ boost/endian/endian.hpp
has been renamed to
+ boost/endian/arithmetic.hpp
. Headers
+ boost/endian/conversion.hpp
and boost/endian/buffers.hpp
have been
added.
Infrastructure file names were changed accordingly.Prior to the official Boost release, class template
+endian_arithmetic
has been used for a decade or more with the same
+functionality but under the name endian
. Other names also changed
+in the official release. If the macro BOOST_ENDIAN_DEPRECATED_NAMES
+is defined, those old now deprecated names are still supported. However, the
+class template endian
name is only provided for compilers
+supporting C++11 template aliases. For C++03 compilers, the name will have to be
+changed to endian_arithmetic
.
To support backward header compatibility, deprecated header boost/endian/endian.hpp
+forwards to boost/endian/arithmetic.hpp
. It requires
+BOOST_ENDIAN_DEPRECATED_NAMES
be defined. It should only be used while
+transitioning to the official Boost release of the library as it will be removed
+in some future release.
Comments and suggestions were received from Adder, Benaka Moorthi, Christopher Kohlhoff, Cliff Green, Daniel James, Gennaro Proto, Giovanni Piero @@ -484,7 +503,7 @@ Blechmann, Tim Moore, tymofey, Tomas Puverle, Vincente Botet, Yuval Ronen and Vitaly Budovsk. Apologies if anyone has been missed.
Last revised: -15 January, 2015
+19 January, 2015© Copyright Beman Dawes, 2011, 2013
Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt
diff --git a/doc/mini_review_topics.html b/doc/mini_review_topics.html index 11c455f..d7a7f3c 100644 --- a/doc/mini_review_topics.html +++ b/doc/mini_review_topics.html @@ -13,7 +13,7 @@11. Stream insertion and extraction of the endian integer/float types should be documented and included in the test coverage.
-Done. See Stream inserter and - Stream extractor.
+Done. See Stream inserter and + Stream extractor.
12. Binary I/O support that was investigated during development of the Endian
library should be put up for mini-review for inclusion in the Boost I/O
@@ -140,7 +140,7 @@ might used inadvertently or inappropriately. The impact of adding an endian_buff
Last revised: -04 January, 2015
+19 January, 2015© Copyright Beman Dawes, 2014
Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt