File indexing completed on 2025-01-18 09:28:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <cstddef> // size_t, NULL
0016 #include <boost/config.hpp>
0017 #if defined(BOOST_NO_STDC_NAMESPACE)
0018 namespace std{
0019 using ::size_t;
0020 }
0021 #endif
0022
0023 #include <boost/detail/workaround.hpp> // RogueWave
0024
0025 #include <boost/archive/text_iarchive.hpp>
0026
0027 namespace boost {
0028 namespace archive {
0029
0030 template<class Archive>
0031 BOOST_ARCHIVE_DECL void
0032 text_iarchive_impl<Archive>::load(char *s)
0033 {
0034 std::size_t size;
0035 * this->This() >> size;
0036
0037 is.get();
0038
0039 is.read(s, size);
0040 s[size] = '\0';
0041 }
0042
0043 template<class Archive>
0044 BOOST_ARCHIVE_DECL void
0045 text_iarchive_impl<Archive>::load(std::string &s)
0046 {
0047 std::size_t size;
0048 * this->This() >> size;
0049
0050 is.get();
0051
0052 #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
0053 if(NULL != s.data())
0054 #endif
0055 s.resize(size);
0056 if(0 < size)
0057 is.read(&(*s.begin()), size);
0058 }
0059
0060 #ifndef BOOST_NO_CWCHAR
0061 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
0062 template<class Archive>
0063 BOOST_ARCHIVE_DECL void
0064 text_iarchive_impl<Archive>::load(wchar_t *ws)
0065 {
0066 std::size_t size;
0067 * this->This() >> size;
0068
0069 is.get();
0070 is.read((char *)ws, size * sizeof(wchar_t)/sizeof(char));
0071 ws[size] = L'\0';
0072 }
0073 #endif
0074
0075 #ifndef BOOST_NO_STD_WSTRING
0076 template<class Archive>
0077 BOOST_ARCHIVE_DECL void
0078 text_iarchive_impl<Archive>::load(std::wstring &ws)
0079 {
0080 std::size_t size;
0081 * this->This() >> size;
0082
0083 #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101))
0084 if(NULL != ws.data())
0085 #endif
0086 ws.resize(size);
0087
0088 is.get();
0089 is.read((char *)ws.data(), size * sizeof(wchar_t)/sizeof(char));
0090 }
0091
0092 #endif
0093 #endif
0094
0095 template<class Archive>
0096 BOOST_ARCHIVE_DECL void
0097 text_iarchive_impl<Archive>::load_override(class_name_type & t){
0098 basic_text_iarchive<Archive>::load_override(t);
0099 }
0100
0101 template<class Archive>
0102 BOOST_ARCHIVE_DECL void
0103 text_iarchive_impl<Archive>::init(){
0104 basic_text_iarchive<Archive>::init();
0105 }
0106
0107 template<class Archive>
0108 BOOST_ARCHIVE_DECL
0109 text_iarchive_impl<Archive>::text_iarchive_impl(
0110 std::istream & is,
0111 unsigned int flags
0112 ) :
0113 basic_text_iprimitive<std::istream>(
0114 is,
0115 0 != (flags & no_codecvt)
0116 ),
0117 basic_text_iarchive<Archive>(flags)
0118 {}
0119
0120 }
0121 }