From eb5d1dc6027d394144c6f9b8a8fb0a25753848d6 Mon Sep 17 00:00:00 2001 From: Beman Date: Wed, 29 May 2013 09:43:25 -0400 Subject: [PATCH] Merge develop --- conversion.html | 25 +++++++++++++------------ index.html | 5 +++-- types.html | 20 +++++++++++--------- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/conversion.html b/conversion.html index 7efc721..ae07043 100644 --- a/conversion.html +++ b/conversion.html @@ -35,6 +35,9 @@ Endian Types + +

+ + <boost/endian/conversion.hpp>
+ <boost/endian/types.hpp>
@@ -56,27 +59,20 @@
- <boost/endian/conversion.hpp>
- <boost/endian/types.hpp>

Introduction

-

Header boost/endian/conversion.hpp +

Header boost/endian/conversion.hpp provides byte order reversal and conversion functions that convert objects of the multi-byte built-in integer types, and also types float and double, between native, big, or little endian byte ordering. User defined types are also supported.

- - - - -
Caution: Only big endianness and little endianness is supported; - middle endianness is not supported.
-

Reference

Functions are implemented inline if appropriate. noexcept is @@ -178,7 +174,7 @@ type (possibly const) ReversibleValue.

reverse_value(x) -

ReversibleValue +

ReversibleValue

The returned value is the value of x with the order of its constituent bytes reversed. @@ -201,6 +197,11 @@ modifiable lvalue of type Reversible.

reversed. +

See +udt_conversion_example.cpp for an example of a UDT that can used in the +big_endian, +little_endian, and +convert function templates.

Functions

int16_t  reverse_value(int16_t x) noexcept;
 int32_t  reverse_value(int32_t x) noexcept;
@@ -335,7 +336,7 @@ provided.

support endian conversion as separate from endian integer types. Phil Endecott suggested the form of the value returning signatures. Vicente Botet and other reviewers suggested supporting floating point types and user defined types. General reverse template implementation approach using std::reverse suggested by Mathias Gaunard. Portable implementation approach for 16, 32, and 64-bit integers suggested by tymofey, with avoidance of undefined behavior as suggested by Giovanni Piero Deretta, and a further refinement suggested by Pyry Jahkola. Intrinsic builtins implementation approach for 16, 32, and 64-bit integers suggested by several reviewers, and by David Stone, who provided his Boost licensed macro implementation that became the starting point for boost/endian/detail/intrinsic.hpp.


Last revised: -28 May, 2013

+29 May, 2013

© 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/index.html b/index.html index 9ca091a..a134079 100644 --- a/index.html +++ b/index.html @@ -34,6 +34,7 @@ Endian Types +

+ <boost/endian/conversion.hpp>
+ <boost/endian/types.hpp>
@@ -59,8 +60,8 @@
- <boost/endian/conversion.hpp>
- <boost/endian/types.hpp>
diff --git a/types.html b/types.html index 0af5a86..ed6c2f7 100644 --- a/types.html +++ b/types.html @@ -37,6 +37,8 @@ +

+ + <boost/endian/conversion.hpp>
+ <boost/endian/types.hpp>
@@ -48,8 +50,7 @@ Example
Limitations
Feature set
- Typedefs
-     Comment on naming
+ Enums and typedefs
Class template endian
    Synopsis
@@ -69,13 +70,13 @@
- <boost/endian/conversion.hpp>
- <boost/endian/types.hpp>

Introduction

-

Header <boost/endian/types.hpp> provides -integer-like byte-holder binary types with explicit control over +

Header boost/endian/types.hpp +provides integer and floating point binary types with explicit control over byte order, value type, size, and alignment. Typedefs provide easy-to-use names for common configurations.

These types provide portable byte-holders for integer data, independent of @@ -100,7 +101,8 @@ arithmetic operators are +, +=, -, ^, ^=, <<, <<=, >>, >>=. Binary relational operators are ==, !=, <, <=, >, >=.

-

Automatic conversion is provided to the underlying integer value type.

+

Automatic implicit conversion to the underlying value type is provided. An +explicit conversion constructor from the underlying value type is provided.

Example

The endian_example.cpp program writes a binary file containing four byte big-endian and little-endian integers:

@@ -169,7 +171,7 @@ int main(int, char* []) }
-

After compiling and executing endian_example.cpp, +

After compiling and executing endian_example.cpp, a hex dump of test.dat shows:

01020304 00000010 01000000 04030201
@@ -614,7 +616,7 @@ differs from endian representation size. Vicente Botet and other reviewers suggested supporting floating point types.


Last revised: -28 May, 2013

+29 May, 2013

© Copyright Beman Dawes, 2006-2009, 2013

Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt