Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:28

0001 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0002 // basic_text_oarchive.ipp:
0003 
0004 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . 
0005 // Use, modification and distribution is subject to the Boost Software
0006 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 //  See http://www.boost.org for updates, documentation, and revision history.
0010 #include <string>
0011 #include <boost/assert.hpp>
0012 #include <cstring>
0013 
0014 #include <boost/config.hpp>
0015 #if defined(BOOST_NO_STDC_NAMESPACE)
0016 namespace std{ 
0017     using ::memcpy; 
0018 }
0019 #endif
0020 
0021 #include <boost/archive/basic_text_oarchive.hpp>
0022 
0023 namespace boost {
0024 namespace archive {
0025 
0026 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0027 // implementation of basic_text_oarchive
0028 
0029 template<class Archive>
0030 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0031 basic_text_oarchive<Archive>::newtoken()
0032 {
0033     switch(delimiter){
0034     default:
0035         BOOST_ASSERT(false);
0036         break;
0037     case eol:
0038         this->This()->put('\n');
0039         delimiter = space;
0040         break;
0041     case space:
0042         this->This()->put(' ');
0043         break;
0044     case none:
0045         delimiter = space;
0046         break;
0047     }
0048 }
0049 
0050 template<class Archive>
0051 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0052 basic_text_oarchive<Archive>::init(){
0053     // write signature in an archive version independent manner
0054     const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
0055     * this->This() << file_signature;
0056     // write library version
0057     const boost::serialization::library_version_type v(BOOST_ARCHIVE_VERSION());
0058     * this->This() << v;
0059 }
0060 
0061 } // namespace archive
0062 } // namespace boost