From d55c958ca5df106738f6b8654716c93116c1ea4f Mon Sep 17 00:00:00 2001
From: bemandawes The Boost Endian Library provides facilities to deal with endianness. See
+Introduction to endianness below for
+the basics of endianness. The library provides two approaches to dealing with integer endianness: Endian conversions for native integers - The application uses the
+built-in integer types, and calls the provided conversion functions to swap
+bytes as needed. Both mutating and non-mutating conversions are supplied, and
+each comes in unconditional and conditional variants. This approach is simple
+and efficient, but is less flexible in terms of size and alignment, and can be
+hard to manage in code with many logical paths involving endianness transitions. Endian integer types Consider a C++ program that defines variables x, y, and z as 16, 32, and
+64-bit integers, respectively. There are several ways a processor might layout
+the individual bytes for these variables in memory: The most-significant byte first ordering is traditionally called "big endian"
+ordering and the least-significant byte first is traditionally called
+"little-endian" ordering. Although some other orderings are possible, most
+modern uses are as shown above. The names are derived from
+
+Jonathan Swift's satirical novel
+
+Gulliver’s Travels, where rival kingdom's opened their soft-boiled eggs
+at different ends. Intel processors are traditionally little endian while many others are big
+endian. Some processors can switch endianness, so which is in use depends on the
+operating system. The Wikipedia's
+Endianness entry lists
+details for many processors and operating systems. External memory, such as disks, generally uses the same endianness as the
+operating system. Networks traditionally use big endian ordering, so this is
+sometimes referred as network endianness. Last revised:
+27 May, 2011 © Copyright Beman Dawes, 2011 Distributed under the Boost Software License, Version 1.0. See
+www.boost.org/ LICENSE_1_0.txt
+
+
+
+
+
+
+
+
+ Endian Library
+
+
+
+
+
+Boost Home Conversion Reference
+ Types Reference Tutorial
+ Introduction
+
+
+
+
+
+Introduction to endianness
+
+
+
+
+
+
+ int16_t x = 0x0A0B;
+
+
+ Big Endian
+ Little Endian
+
+
+ Value
+ 0A
+ 0B
+ Value
+ 0B
+ 0A
+
+
+Address
+ ...0
+ ...1
+ Address
+ ...0
+ ...1
+
+
+
+
+
+
+
+ int32_t y = 0x0A0B0C0D;
+
+
+ Big Endian
+ Little Endian
+
+
+ Value
+ 0A
+ 0B
+ 0C
+ 0D
+ Value
+ 0D
+ 0C
+ 0B
+ 0A
+
+
+Address
+ ...0
+ ...1
+ ...2
+ ...3
+ Address
+ ...0
+ ...1
+ ...2
+ ...3
+
+
+
+
+
+
+
+ int64_t z = 0x0A0B0C0D0E0F0102;
+
+
+ Big Endian
+ Little Endian
+
+
+ Value
+ 0A
+ 0B
+ 0C
+ 0D
+ 0E
+ 0F
+ 01
+ 02
+ Value
+ 02
+ 01
+ 0F
+ 0E
+ 0D
+ 0C
+ 0B
+ 0A
+
+
+Address
+ ...0
+ ...1
+ ...2
+ ...3
+ ...4
+ ...5
+ ...6
+ ...7
+ Address
+ ...0
+ ...1
+ ...2
+ ...3
+ ...4
+ ...5
+ ...6
+ ...7
+
+
Last revised: -25 March, 2009
+27 May, 2011© Copyright Beman Dawes, 2006-2009
-Distributed under the Boost Software License, Version 1.0. (See accompanying -file LICENSE_1_0.txt or copy at -www.boost.org/ LICENSE_1_0.txt)
+Distributed under the Boost Software License, Version 1.0. See +www.boost.org/ LICENSE_1_0.txt
diff --git a/libs/endian/index.html b/libs/endian/index.html new file mode 100644 index 0000000..3ebbb5a --- /dev/null +++ b/libs/endian/index.html @@ -0,0 +1,14 @@ + + + + + +Automatic redirection failed, please go to +doc/index.html.© Copyright Beman Dawes, 2001
+Distributed under the Boost Software License, Version 1.0. +(See www.boost.org/LICENSE_1_0.txt) + +
+ + \ No newline at end of file