basic_binary_oarchive.ipp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  2. // basic_binary_oarchive.ipp:
  3. // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
  4. // Use, modification and distribution is subject to the Boost Software
  5. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. // See http://www.boost.org for updates, documentation, and revision history.
  8. #include <string>
  9. #include <boost/assert.hpp>
  10. #include <algorithm>
  11. #include <cstring>
  12. #include <boost/config.hpp>
  13. #if defined(BOOST_NO_STDC_NAMESPACE)
  14. namespace std{
  15. using ::memcpy;
  16. }
  17. #endif
  18. #include <boost/archive/basic_binary_oarchive.hpp>
  19. namespace boost {
  20. namespace archive {
  21. /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
  22. // implementation of binary_binary_oarchive
  23. template<class Archive>
  24. BOOST_ARCHIVE_OR_WARCHIVE_DECL void
  25. basic_binary_oarchive<Archive>::init(){
  26. // write signature in an archive version independent manner
  27. const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
  28. * this->This() << file_signature;
  29. // write library version
  30. const library_version_type v(BOOST_ARCHIVE_VERSION());
  31. * this->This() << v;
  32. }
  33. } // namespace archive
  34. } // namespace boost