binary_woarchive.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP
  2. #define BOOST_ARCHIVE_BINARY_WOARCHIVE_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_woarchive.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 <boost/config.hpp>
  15. #ifdef BOOST_NO_STD_WSTREAMBUF
  16. #error "wide char i/o not supported on this platform"
  17. #else
  18. #include <ostream>
  19. #include <boost/archive/binary_oarchive_impl.hpp>
  20. #include <boost/archive/detail/register_archive.hpp>
  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_oarchive_impl instead. This will
  25. // preserve correct static polymorphism.
  26. class binary_woarchive :
  27. public binary_oarchive_impl<
  28. binary_woarchive, std::wostream::char_type, std::wostream::traits_type
  29. >
  30. {
  31. public:
  32. binary_woarchive(std::wostream & os, unsigned int flags = 0) :
  33. binary_oarchive_impl<
  34. binary_woarchive, std::wostream::char_type, std::wostream::traits_type
  35. >(os, flags)
  36. {}
  37. binary_woarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
  38. binary_oarchive_impl<
  39. binary_woarchive, std::wostream::char_type, std::wostream::traits_type
  40. >(bsb, flags)
  41. {}
  42. };
  43. } // namespace archive
  44. } // namespace boost
  45. // required by export
  46. BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_woarchive)
  47. #endif // BOOST_NO_STD_WSTREAMBUF
  48. #endif // BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP