binary_iarchive.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
  2. #define BOOST_ARCHIVE_BINARY_IARCHIVE_HPP
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER)
  5. # pragma once
  6. #endif
  7. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  8. // binary_iarchive.hpp
  9. // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
  10. // Use, modification and distribution is subject to the Boost Software
  11. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. // See http://www.boost.org for updates, documentation, and revision history.
  14. #include <istream>
  15. #include <boost/archive/binary_iarchive_impl.hpp>
  16. #include <boost/archive/detail/register_archive.hpp>
  17. #ifdef BOOST_MSVC
  18. # pragma warning(push)
  19. # pragma warning(disable : 4511 4512)
  20. #endif
  21. namespace boost {
  22. namespace archive {
  23. // do not derive from this class. If you want to extend this functionality
  24. // via inhertance, derived from binary_iarchive_impl instead. This will
  25. // preserve correct static polymorphism.
  26. class BOOST_SYMBOL_VISIBLE binary_iarchive :
  27. public binary_iarchive_impl<
  28. boost::archive::binary_iarchive,
  29. std::istream::char_type,
  30. std::istream::traits_type
  31. >{
  32. public:
  33. binary_iarchive(std::istream & is, unsigned int flags = 0) :
  34. binary_iarchive_impl<
  35. binary_iarchive, std::istream::char_type, std::istream::traits_type
  36. >(is, flags)
  37. {
  38. init(flags);
  39. }
  40. binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
  41. binary_iarchive_impl<
  42. binary_iarchive, std::istream::char_type, std::istream::traits_type
  43. >(bsb, flags)
  44. {
  45. init(flags);
  46. }
  47. };
  48. } // namespace archive
  49. } // namespace boost
  50. // required by export
  51. BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_iarchive)
  52. BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_iarchive)
  53. #ifdef BOOST_MSVC
  54. #pragma warning(pop)
  55. #endif
  56. #endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP