mirror of
https://github.com/boostorg/endian.git
synced 2025-08-02 05:54:31 +02:00
Endian: get ready to test on more compilers
git-svn-id: http://svn.boost.org/svn/boost/sandbox/endian@51856 b8fc166d-592f-0410-95f2-cb63ce0dd405
This commit is contained in:
@@ -281,19 +281,19 @@ usual operations on integers are supplied.</p>
|
|||||||
namespace integer
|
namespace integer
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace <a name="endianness">endianness</a> { enum enum_t { big, little, native }; } // simulate C++0x scoped enum
|
enum class <a name="endianness">endianness</a> { big, little, native }; // scoped enum emulated on C++03
|
||||||
namespace <a name="alignment">alignment</a> { enum enum_t { unaligned, aligned }; } // simulate C++0x scoped enum
|
enum class <a name="alignment">alignment</a> { unaligned, aligned }; // scoped enum emulated on C++03
|
||||||
|
|
||||||
template <endianness::enum_t E, typename T, std::size_t n_bits,
|
template <endianness E, typename T, std::size_t n_bits,
|
||||||
alignment::enum_t A = alignment::unaligned>
|
alignment A = alignment::unaligned>
|
||||||
class endian : <a href="../../../boost/integer/cover_operators.hpp">integer_cover_operators</a>< endian<E, T, n_bits, A>, T >
|
class endian : <a href="../../../boost/integer/cover_operators.hpp">integer_cover_operators</a>< endian<E, T, n_bits, A>, T >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
endian(){}
|
<a href="#endian">endian</a>() = default; // = default replaced by {} on C++03
|
||||||
explicit endian(T v);
|
explicit <a href="#explicit-endian">endian</a>(T v);
|
||||||
endian & operator=(T v);
|
endian & <a href="#operator-eq">operator=</a>(T v);
|
||||||
operator T() const;
|
<a href="#operator-T">operator T</a>() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// unaligned big endian signed integer types
|
// unaligned big endian signed integer types
|
||||||
@@ -385,29 +385,29 @@ usual operations on integers are supplied.</p>
|
|||||||
} // namespace integer
|
} // namespace integer
|
||||||
} // namespace boost</pre>
|
} // namespace boost</pre>
|
||||||
<h3><a name="Members">Members</a></h3>
|
<h3><a name="Members">Members</a></h3>
|
||||||
<p><code>endian(){}</code></p>
|
<p><code><a name="endian">endian</a>() = default; // C++03: endian(){}</code></p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><i>Effects:</i> Constructs an object of type <code>endian<E, T, n_bits, A></code>.</p>
|
<p><i>Effects:</i> Constructs an object of type <code>endian<E, T, n_bits, A></code>.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p><code>explicit endian(T v);</code></p>
|
<p><code><a name="explicit-endian">explicit endian</a>(T v);</code></p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><i>Effects:</i> Constructs an object of type <code>endian<E, T, n_bits, A></code>.</p>
|
<p><i>Effects:</i> Constructs an object of type <code>endian<E, T, n_bits, A></code>.</p>
|
||||||
<p><i>Postcondition:</i> <code>x == v,</code> where <code>x</code> is the
|
<p><i>Postcondition:</i> <code>x == v,</code> where <code>x</code> is the
|
||||||
constructed object.</p>
|
constructed object.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p><code>endian & operator=(T v);</code></p>
|
<p><code>endian & <a name="operator-eq">operator=</a>(T v);</code></p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><i>Postcondition:</i> <code>x == v,</code> where <code>x</code> is the
|
<p><i>Postcondition:</i> <code>x == v,</code> where <code>x</code> is the
|
||||||
constructed object.</p>
|
constructed object.</p>
|
||||||
<p><i>Returns:</i> <code>*this</code>.</p>
|
<p><i>Returns:</i> <code>*this</code>.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p><code>operator T() const;</code></p>
|
<p><code><a name="operator-T">operator T</a>() const;</code></p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><i>Returns:</i> The current value stored in <code>*this</code>, converted to
|
<p><i>Returns:</i> The current value stored in <code>*this</code>, converted to
|
||||||
<code>value_type</code>.</p>
|
<code>value_type</code>.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<h3>Other operators</h3>
|
<h3>Other operators</h3>
|
||||||
<p>All other operators on endian objects are forwarded to the equivalent
|
<p>Other operators on endian objects are forwarded to the equivalent
|
||||||
operator on <code>value_type</code>.</p>
|
operator on <code>value_type</code>.</p>
|
||||||
<h2><a name="FAQ">FAQ</a></h2>
|
<h2><a name="FAQ">FAQ</a></h2>
|
||||||
<p><b>Why bother with endian types?</b> External data portability and both speed
|
<p><b>Why bother with endian types?</b> External data portability and both speed
|
||||||
|
@@ -2,15 +2,19 @@
|
|||||||
|
|
||||||
# Copyright Beman Dawes 2006
|
# Copyright Beman Dawes 2006
|
||||||
|
|
||||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
# See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
# See library home page at http://www.boost.org/libs/endian
|
# See library home page at http://www.boost.org/libs/integer/doc/endian.html
|
||||||
|
|
||||||
import testing ;
|
import testing ;
|
||||||
|
|
||||||
test-suite "endian"
|
test-suite "endian"
|
||||||
: [ run endian_test.cpp ]
|
:
|
||||||
# [ run endian_operations_test.cpp ]
|
[ run binary_stream_test.cpp ]
|
||||||
# [ run endian_in_union_test.cpp ]
|
[ run endian_binary_stream_test.cpp ]
|
||||||
|
[ run endian_test.cpp ]
|
||||||
|
[ run endian_operations_test.cpp ]
|
||||||
|
[ run endian_in_union_test.cpp ]
|
||||||
|
[ run scoped_enum_emulation_test.cpp ]
|
||||||
;
|
;
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
set ENDIAN_LOCATE_ROOT=%temp%\endian-regr
|
set ENDIAN_LOCATE_ROOT=%TEMP%\endian-regr
|
||||||
md %ENDIAN_LOCATE_ROOT% 2>nul
|
md %ENDIAN_LOCATE_ROOT% 2>nul
|
||||||
|
|
||||||
echo Begin test processing...
|
echo Begin test processing...
|
||||||
bjam --dump-tests "-sALL_LOCATE_TARGET=%ENDIAN_LOCATE_ROOT%" %* >bjam.log 2>&1
|
bjam --dump-tests includes=/boost/trunk "-sALL_LOCATE_TARGET=%ENDIAN_LOCATE_ROOT%" %* >bjam.log 2>&1
|
||||||
echo Begin log processing...
|
echo Begin log processing...
|
||||||
process_jam_log %ENDIAN_LOCATE_ROOT% <bjam.log
|
process_jam_log %ENDIAN_LOCATE_ROOT% <bjam.log
|
||||||
start bjam.log
|
start bjam.log
|
||||||
|
@@ -2,26 +2,37 @@ echo create zip file...
|
|||||||
|
|
||||||
if $%1 == $ goto error
|
if $%1 == $ goto error
|
||||||
|
|
||||||
rmdir /s \tmp\%1 2>nul
|
rmdir /s \temp\%1 2>nul
|
||||||
pushd .
|
pushd .
|
||||||
mkdir \tmp\%1
|
mkdir \temp\%1
|
||||||
cd \tmp\%1
|
cd \temp\%1
|
||||||
|
md doc\html
|
||||||
md boost\integer
|
md boost\integer
|
||||||
md libs\integer\doc
|
md libs\integer\doc
|
||||||
md libs\integer\example
|
md libs\integer\example
|
||||||
md libs\integer\test
|
md libs\integer\test
|
||||||
popd
|
popd
|
||||||
copy ..\..\boost\integer\endian.hpp \tmp\%1\boost\integer
|
copy ..\..\boost.png \temp\%1
|
||||||
copy ..\..\boost\integer\cover_operators.hpp \tmp\%1\boost\integer
|
copy ..\..\boost\doc\html\minimal.css \temp\%1\doc\html
|
||||||
copy ..\..\libs\integer\doc\endian.html \tmp\%1\libs\integer\doc
|
copy ..\..\boost\binary_stream.hpp \temp\%1\boost
|
||||||
copy ..\..\libs\integer\example\endian_example.cpp \tmp\%1\libs\integer\example
|
copy ..\..\boost\integer\endian.hpp \temp\%1\boost\integer
|
||||||
copy ..\..\libs\integer\test\endian_test.cpp \tmp\%1\libs\integer\test
|
copy ..\..\boost\integer\endian_binary_stream.hpp \temp\%1\boost\integer
|
||||||
copy ..\..\libs\integer\test\Jamfile.* \tmp\%1\libs\integer\test
|
copy ..\..\boost\integer\cover_operators.hpp \temp\%1\boost\integer
|
||||||
|
copy ..\..\libs\integer\doc\endian.html \temp\%1\libs\integer\doc
|
||||||
|
copy ..\..\libs\integer\example\endian_example.cpp \temp\%1\libs\integer\example
|
||||||
|
copy ..\..\libs\integer\example\endian_hello_world.cpp \temp\%1\libs\integer\example
|
||||||
|
copy ..\..\libs\integer\test\endian_test.cpp \temp\%1\libs\integer\test
|
||||||
|
copy ..\..\libs\integer\test\binary_stream_test.cpp \temp\%1\libs\integer\test
|
||||||
|
copy ..\..\libs\integer\test\endian_binary_stream_test.cpp \temp\%1\libs\integer\test
|
||||||
|
copy ..\..\libs\integer\test\endian_in_union_test.cpp \temp\%1\libs\integer\test
|
||||||
|
copy ..\..\libs\integer\test\endian_operations_test.cpp \temp\%1\libs\integer\test
|
||||||
|
copy ..\..\libs\integer\test\scoped_enum_emulation_test.cpp \temp\%1\libs\integer\test
|
||||||
|
copy ..\..\libs\integer\test\Jamfile.* \temp\%1\libs\integer\test
|
||||||
|
|
||||||
pushd \tmp
|
pushd \temp
|
||||||
zip -r %1.zip %1
|
zip -r %1.zip %1
|
||||||
popd
|
popd
|
||||||
move \tmp\%1.zip .
|
move \temp\%1.zip .
|
||||||
|
|
||||||
goto done
|
goto done
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user