Endian: add extractors and many more types to binary_stream.hpp, add binary_stream_test.

git-svn-id: http://svn.boost.org/svn/boost/sandbox/endian@51775 b8fc166d-592f-0410-95f2-cb63ce0dd405
This commit is contained in:
bemandawes committed 2009-03-14 13:54:35 +00:00
1 parent f8687695f1
commit 10e151fd46
7 files changed
+417 -93

No files matched your search

+9 -4
View File
@@ -7,6 +7,7 @@
// See library home page at http://www.boost.org/libs/endian
#include <boost/integer/endian.hpp>
#include <boost/integer/endian_io.hpp>
#include <iostream>
@@ -15,10 +16,14 @@ using namespace boost::integer;
int main()
{
long value = 3224115L; // integer value of ASCII { '1', '2', '3' }
big24_t big( value );
little24_t little( value );
int_least32_t value = 0x313233L; // = 3224115 = ASCII { '1', '2', '3' }
big24_t big( value );
little24_t little( value );
std::cout << "Hello, endian world "<< value << ' ' << big << ' ' << little << '\n';
std::cout << "Hello, endian world!\n";
std::cout << " cout << value--: " << value << " sizeof(value): " << sizeof(value)
<< "\n cout << big----: " << big << " sizeof(big): " << sizeof(big)
<< "\n cout << little-: " << little << " sizeof(little): " << sizeof(little)
<< '\n';
}