File indexing completed on 2025-01-18 09:28:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include <string>
0011 #include <algorithm>
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/detail/workaround.hpp>
0022 #include <boost/serialization/string.hpp>
0023 #include <boost/archive/basic_text_iarchive.hpp>
0024
0025 namespace boost {
0026 namespace archive {
0027
0028
0029
0030
0031 template<class Archive>
0032 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0033 basic_text_iarchive<Archive>::load_override(class_name_type & t){
0034 std::string cn;
0035 cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
0036 load_override(cn);
0037 if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
0038 boost::serialization::throw_exception(
0039 archive_exception(archive_exception::invalid_class_name)
0040 );
0041 std::memcpy(t, cn.data(), cn.size());
0042
0043 t.t[cn.size()] = '\0';
0044 }
0045
0046 template<class Archive>
0047 BOOST_ARCHIVE_OR_WARCHIVE_DECL void
0048 basic_text_iarchive<Archive>::init() {
0049
0050 std::string file_signature;
0051 * this->This() >> file_signature;
0052 if(file_signature != BOOST_ARCHIVE_SIGNATURE())
0053 boost::serialization::throw_exception(
0054 archive_exception(archive_exception::invalid_signature)
0055 );
0056
0057
0058
0059 boost::serialization::library_version_type input_library_version;
0060 * this->This() >> input_library_version;
0061
0062 #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
0063 this->set_library_version(input_library_version);
0064 #else
0065 detail::basic_iarchive::set_library_version(input_library_version);
0066 #endif
0067
0068
0069 if(BOOST_ARCHIVE_VERSION() < input_library_version)
0070 boost::serialization::throw_exception(
0071 archive_exception(archive_exception::unsupported_version)
0072 );
0073 }
0074
0075 }
0076 }