alterations to support DLL

[SVN r26867]
This commit is contained in:
Robert Ramey
2005-01-27 17:40:31 +00:00
parent b8cef6d337
commit 63eabb08a1
28 changed files with 482 additions and 268 deletions

View File

@@ -19,6 +19,9 @@
#include <boost/strong_typedef.hpp>
#include <boost/noncopyable.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -84,14 +87,16 @@ enum archive_flags {
no_xml_tag_checking = 4 // suppress checking of xml tags
};
extern const class_id_type null_pointer_tag;
#define NULL_POINTER_TAG class_id_type(-1)
extern const char * ARCHIVE_SIGNATURE;
extern const version_type ARCHIVE_VERSION;
BOOST_DECL_ARCHIVE const char * ARCHIVE_SIGNATURE();
BOOST_DECL_ARCHIVE unsigned int ARCHIVE_VERSION();
}// namespace archive
}// namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#include <boost/serialization/level.hpp>
// set implementation level to primitive for all types
@@ -116,4 +121,5 @@ BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type, primitive_type)
#error "export.hpp must not be included before any archive header"
#endif
#endif //BOOST_ARCHIVE_BASIC_ARCHIVE_HPP

View File

@@ -38,13 +38,16 @@
#include <boost/serialization/string.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////
// class basic_binary_iarchive - read serialized objects from a input binary stream
template<class Archive>
class basic_binary_iarchive : public detail::common_iarchive<Archive>
class basic_binary_iarchive :
public detail::common_iarchive<Archive>
{
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
@@ -106,23 +109,19 @@ protected:
t = (0 != x);
}
void load_override(class_name_type & t, int){
std::string cn;
cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
load_override(cn, 0);
if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
boost::throw_exception(
archive_exception(archive_exception::invalid_class_name)
);
std::memcpy(t, cn.data(), cn.size());
// .t is a borland tweak
t.t[cn.size()] = '\0';
}
basic_binary_iarchive() {}
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load_override(class_name_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
init();
basic_binary_iarchive(){}
};
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP

View File

@@ -25,15 +25,15 @@
#include <iosfwd>
#include <cassert>
#include <cstring> // std::memcpy
#include <cstddef> // std::size_t
#include <cstring>
#include <string>
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::memcpy;
using ::strcpy;
using ::size_t;
} // namespace std
#endif
@@ -45,7 +45,8 @@ namespace std{
#include <boost/scoped_ptr.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/codecvt_null.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -68,9 +69,6 @@ public:
// native streams are always handled as bytes
IStream &is;
boost::scoped_ptr<std::locale> archive_locale;
// boost::scoped_ptr<
// codecvt_null<BOOST_DEDUCED_TYPENAME IStream::char_type>
// > archive_codecvt;
io::basic_ios_locale_saver<
BOOST_DEDUCED_TYPENAME IStream::char_type, BOOST_DEDUCED_TYPENAME IStream::traits_type
> locale_saver;
@@ -81,27 +79,41 @@ public:
load_binary(& t, sizeof(T));
}
void load(char * t);
void load(wchar_t * t);
void load(std::string &s);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load(std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void load(std::wstring &ws);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load(std::wstring &ws);
#endif
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load(char * t);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load(wchar_t * t);
void init();
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
init();
BOOST_DECL_ARCHIVE_OR_WARCHIVE
basic_binary_iprimitive(IStream &is_, bool no_codecvt);
BOOST_DECL_ARCHIVE_OR_WARCHIVE
~basic_binary_iprimitive();
public:
void load_binary(void *address, std::size_t count);
void
load_binary(void *address, std::size_t count);
};
template<class Archive, class IStream>
inline void basic_binary_iprimitive<Archive, IStream>::load_binary(
inline void
basic_binary_iprimitive<Archive, IStream>::load_binary(
void *address,
std::size_t count
){
assert(
static_cast<std::size_t>(std::numeric_limits<std::streamsize>::max()) >= count
static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)()) >= count
);
if(is.fail())
boost::throw_exception(archive_exception(archive_exception::stream_error));
@@ -125,4 +137,6 @@ inline void basic_binary_iprimitive<Archive, IStream>::load_binary(
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pop pragams
#endif // BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP

View File

@@ -47,7 +47,8 @@ namespace archive {
/////////////////////////////////////////////////////////////////////////
// class basic_text_iarchive - read serialized objects from a input text stream
template<class Archive>
class basic_binary_oarchive : public detail::common_oarchive<Archive>
class basic_binary_oarchive :
public detail::common_oarchive<Archive>
{
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
@@ -106,7 +107,11 @@ protected:
* this->This() << std::string(static_cast<const char *>(t));
}
basic_binary_oarchive(unsigned int flags = 0){}
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
init();
basic_binary_oarchive(){}
};
} // namespace archive

View File

@@ -77,27 +77,40 @@ public:
save_binary(& t, sizeof(T));
}
void save(const char * t);
void save(const wchar_t * t);
void save(const std::string &s);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save(const std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void save(const std::wstring &ws);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save(const std::wstring &ws);
#endif
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save(const char * t);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save(const wchar_t * t);
void init();
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
init();
BOOST_DECL_ARCHIVE_OR_WARCHIVE
basic_binary_oprimitive(OStream & os, bool no_codecvt);
BOOST_DECL_ARCHIVE_OR_WARCHIVE
~basic_binary_oprimitive();
public:
void save_binary(const void *address, std::size_t count);
};
template<class Archive, class OStream>
inline void basic_binary_oprimitive<Archive, OStream>::save_binary(
inline void
basic_binary_oprimitive<Archive, OStream>::save_binary(
const void *address,
std::size_t count
){
assert(
static_cast<std::size_t>(std::numeric_limits<std::streamsize>::max()) >= count
static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)()) >= count
);
// note: if the following assertions fail
// a likely cause is that the output stream is set to "text"

View File

@@ -33,13 +33,16 @@
#include <boost/serialization/string.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////
// class basic_text_iarchive - read serialized objects from a input text stream
template<class Archive>
class basic_text_iarchive : public detail::common_iarchive<Archive>
class basic_text_iarchive :
public detail::common_iarchive<Archive>
{
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
@@ -61,13 +64,25 @@ protected:
}
// text file don't include the optional information
void load_override(class_id_optional_type & /*t*/, int){}
void load_override(class_name_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load_override(class_name_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
init(void);
basic_text_iarchive() :
detail::common_iarchive<Archive>()
{}
~basic_text_iarchive(){}
};
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP

View File

@@ -49,7 +49,8 @@ namespace std{
#include <boost/scoped_ptr.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/codecvt_null.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -65,13 +66,12 @@ protected:
public:
#endif
IStream &is;
io::ios_flags_saver flags_saver;
io::ios_flags_saver flags_saver;
io::ios_precision_saver precision_saver;
boost::scoped_ptr<std::locale> archive_locale;
io::basic_ios_locale_saver<
BOOST_DEDUCED_TYPENAME IStream::char_type, BOOST_DEDUCED_TYPENAME IStream::traits_type
> locale_saver;
template<class T>
void load(T & t)
{
@@ -113,15 +113,19 @@ public:
t = static_cast<wchar_t>(i);
}
#endif
basic_text_iprimitive(IStream &is, bool no_codecvt);
BOOST_DECL_ARCHIVE_OR_WARCHIVE
basic_text_iprimitive(IStream &is, bool no_codecvt);
BOOST_DECL_ARCHIVE_OR_WARCHIVE
~basic_text_iprimitive();
public:
void load_binary(void *address, std::size_t count);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load_binary(void *address, std::size_t count);
};
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pop pragams
#endif // BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP

View File

@@ -27,18 +27,23 @@
#include <cassert>
#include <boost/config.hpp>
#include <boost/pfto.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/archive/detail/interface_oarchive.hpp>
#include <boost/archive/detail/common_oarchive.hpp>
#include <boost/serialization/string.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
/////////////////////////////////////////////////////////////////////////
// class basic_text_iarchive - read serialized objects from a input text stream
template<class Archive>
class basic_text_oarchive : public detail::common_oarchive<Archive>
class basic_text_oarchive :
public detail::common_oarchive<Archive>
{
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|| BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x564))
@@ -62,7 +67,9 @@ protected:
delimiter = eol;
}
void newtoken();
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
newtoken();
// default processing - invoke serialization library
template<class T>
@@ -90,36 +97,22 @@ protected:
void save_override(const class_name_type & t, int){
this->This()->save(std::string(static_cast<const char *>(t)));
}
protected:
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
init();
basic_text_oarchive() :
detail::common_oarchive<Archive>(),
delimiter(none)
{}
~basic_text_oarchive()
{}
};
template<class Archive>
void basic_text_oarchive<Archive>::newtoken()
{
switch(delimiter){
default:
assert(false);
break;
case eol:
this->This()->put('\n');
delimiter = space;
break;
case space:
this->This()->put(' ');
break;
case none:
delimiter = space;
break;
}
}
~basic_text_oarchive(){}
};
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP

View File

@@ -34,7 +34,6 @@
#include <locale>
#include <cstddef> // size_t
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
@@ -49,8 +48,10 @@ namespace std{
#include <boost/scoped_ptr.hpp>
#include <boost/throw_exception.hpp>
#include <boost/archive/detail/decl.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/codecvt_null.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -62,13 +63,15 @@ class save_access;
template<class OStream>
class basic_text_oprimitive
{
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
protected:
#else
public:
#endif
OStream &os;
io::ios_flags_saver flags_saver;
io::ios_precision_saver precision_saver;
boost::scoped_ptr<std::locale> archive_locale;
// boost::scoped_ptr<codecvt_null<BOOST_DEDUCED_TYPENAME OStream::char_type> >
// archive_codecvt;
io::basic_ios_locale_saver<
BOOST_DEDUCED_TYPENAME OStream::char_type, BOOST_DEDUCED_TYPENAME OStream::traits_type
> locale_saver;
@@ -139,13 +142,19 @@ public:
os.put(*s++);
}
BOOST_DECL_ARCHIVE_OR_WARCHIVE
basic_text_oprimitive(OStream & os, bool no_codecvt);
BOOST_DECL_ARCHIVE_OR_WARCHIVE
~basic_text_oprimitive();
public:
void save_binary(const void *address, std::size_t count);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_binary(const void *address, std::size_t count);
};
} //namespace boost
} //namespace archive
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP

View File

@@ -16,15 +16,19 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
//////////////////////////////////////////////////////////////////////
// exceptions thrown by xml archives
//
class xml_archive_exception : public virtual archive_exception
class xml_archive_exception :
public virtual archive_exception
{
public:
typedef enum {
@@ -52,17 +56,19 @@ public:
};
// constant strings used in xml i/o
extern const char * OBJECT_ID;
extern const char * OBJECT_REFERENCE;
extern const char * CLASS_ID;
extern const char * CLASS_ID_REFERENCE;
extern const char * CLASS_NAME;
extern const char * TRACKING;
extern const char * VERSION;
extern const char * SIGNATURE;
extern BOOST_DECL_ARCHIVE const char * OBJECT_ID();
extern BOOST_DECL_ARCHIVE const char * OBJECT_REFERENCE();
extern BOOST_DECL_ARCHIVE const char * CLASS_ID();
extern BOOST_DECL_ARCHIVE const char * CLASS_ID_REFERENCE();
extern BOOST_DECL_ARCHIVE const char * CLASS_NAME();
extern BOOST_DECL_ARCHIVE const char * TRACKING();
extern BOOST_DECL_ARCHIVE const char * VERSION();
extern BOOST_DECL_ARCHIVE const char * SIGNATURE();
}// namespace archive
}// namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP

View File

@@ -16,17 +16,17 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <string>
#include <boost/config.hpp>
#include <boost/pfto.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/archive/detail/interface_iarchive.hpp>
//#include <boost/archive/detail/interface_iarchive.hpp>
#include <boost/archive/detail/common_iarchive.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/string.hpp> // makes strings prmitive
#include <boost/serialization/string.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -34,7 +34,8 @@ namespace archive {
/////////////////////////////////////////////////////////////////////////
// class xml_iarchive - read serialized objects from a input text stream
template<class Archive>
class basic_xml_iarchive : public detail::common_iarchive<Archive>
class basic_xml_iarchive :
public detail::common_iarchive<Archive>
{
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
@@ -50,8 +51,12 @@ protected:
bool header;
bool no_checking;
unsigned int depth;
void load_start(const char *name);
void load_end(const char *name);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load_start(const char *name);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load_end(const char *name);
// Anything not an attribute and not a name-value pair is an
// should be trapped here.
@@ -83,23 +88,33 @@ protected:
// it otherwise it will be loaded as a normal primitive w/o tag and
// leaving the archive in an undetermined state
void load_override(class_id_optional_type & /* t */, int){}
void load_override(object_id_type & t, int);
void load_override(version_type & t, int);
void load_override(class_id_type & t, int);
void load_override(tracking_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load_override(object_id_type & t, int);
BOOST_DECL_ARCHIVE_OR_WARCHIVE
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load_override(version_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load_override(class_id_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
load_override(tracking_type & t, int);
// class_name_type can't be handled here as it depends upon the
// char type used by the stream. So require the derived implementation
// handle this.
// void load_override(class_name_type & t, int);
basic_xml_iarchive(unsigned int flags = 0) :
header(false),
no_checking(false),
depth(0)
{}
BOOST_DECL_ARCHIVE_OR_WARCHIVE
basic_xml_iarchive(unsigned int flags = 0);
BOOST_DECL_ARCHIVE_OR_WARCHIVE
~basic_xml_iarchive();
};
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP

View File

@@ -25,13 +25,16 @@
#include <boost/serialization/tracking.hpp>
#include <boost/serialization/string.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
//////////////////////////////////////////////////////////////////////
// class xml_oarchive - write serialized objects to a xml output stream
template<class Archive>
class basic_xml_oarchive : public detail::common_oarchive<Archive>
class basic_xml_oarchive :
public detail::common_oarchive<Archive>
{
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public:
@@ -49,21 +52,35 @@ protected:
bool indent_next;
bool pending_preamble;
bool header;
void indent();
void init();
void write_attribute(
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
indent();
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
init();
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
write_attribute(
const char *attribute_name,
int t,
const char *conjunction = "=\""
);
void write_attribute(
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
write_attribute(
const char *attribute_name,
const char *key
);
// helpers used below
void save_start(const char *name);
void save_end(const char *name);
void end_preamble();
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_start(const char *name);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_end(const char *name);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
end_preamble();
// Anything not an attribute and not a name-value pair is an
// error and should be trapped here.
@@ -87,20 +104,40 @@ protected:
// specific overrides for attributes - not name value pairs so we
// want to trap them before the above "fall through"
void save_override(const object_id_type & t, int);
void save_override(const object_reference_type & t, int);
void save_override(const version_type & t, int);
void save_override(const class_id_type & t, int);
void save_override(const class_id_optional_type & t, int);
void save_override(const class_id_reference_type & t, int);
void save_override(const class_name_type & t, int);
void save_override(const tracking_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_override(const object_id_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_override(const object_reference_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_override(const version_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_override(const class_id_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_override(const class_id_optional_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_override(const class_id_reference_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_override(const class_name_type & t, int);
void
BOOST_DECL_ARCHIVE_OR_WARCHIVE
save_override(const tracking_type & t, int);
BOOST_DECL_ARCHIVE_OR_WARCHIVE
basic_xml_oarchive(unsigned int flags = 0);
BOOST_DECL_ARCHIVE_OR_WARCHIVE
~basic_xml_oarchive();
};
} // namespace archive
} // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP

View File

@@ -17,10 +17,12 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <istream>
#include <boost/config.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/basic_binary_iarchive.hpp>
#include <boost/archive/basic_binary_iprimitive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -45,8 +47,13 @@ protected:
basic_binary_iarchive<Archive>::load_override(t, 0);
}
void init(){
basic_binary_iarchive<Archive>::init();
basic_binary_iprimitive<Archive, std::istream>::init();
#if ! defined(__MWERKS__)
this->basic_binary_iarchive<Archive>::init();
this->basic_binary_iprimitive<Archive, std::istream>::init();
#else
basic_binary_iarchive<Archive>::init();
basic_binary_iprimitive<Archive, std::istream>::init();
#endif
}
binary_iarchive_impl(std::istream & is, unsigned int flags = 0) :
basic_binary_iprimitive<Archive, std::istream>(
@@ -55,13 +62,7 @@ protected:
)
{
if(0 == (flags & no_header)){
#if ! defined(__MWERKS__)
this->basic_binary_iarchive<Archive>::init();
this->basic_binary_iprimitive<Archive, std::istream>::init();
#else
basic_binary_iarchive<Archive>::init();
basic_binary_iprimitive<Archive, std::istream>::init();
#endif
init();
}
}
};
@@ -75,8 +76,7 @@ class binary_iarchive :
public:
binary_iarchive(std::istream & is, unsigned int flags = 0) :
binary_iarchive_impl<binary_iarchive>(is, flags)
{
}
{}
};
} // namespace archive
@@ -86,4 +86,6 @@ public:
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::binary_iarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP

View File

@@ -17,10 +17,12 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <ostream>
#include <boost/config.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/basic_binary_oprimitive.hpp>
#include <boost/archive/basic_binary_oarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -37,9 +39,21 @@ public:
friend class save_access;
protected:
#endif
void init(){
basic_binary_oarchive<Archive>::init();
basic_binary_oprimitive<Archive, std::ostream>::init();
// note: the following should not needed - but one compiler (vc 7.1)
// fails to compile one test (test_shared_ptr) without it !!!
// make this protected so it can be called from a derived archive
template<class T>
void save_override(const T & t, BOOST_PFTO int){
basic_binary_oarchive<Archive>::save_override(t, 0);
}
void init() {
#if ! defined(__MWERKS__)
this->basic_binary_oarchive<Archive>::init();
this->basic_binary_oprimitive<Archive, std::ostream>::init();
#else
basic_binary_oarchive<Archive>::init();
basic_binary_oprimitive<Archive, std::ostream>::init();
#endif
}
binary_oarchive_impl(std::ostream & os, unsigned int flags = 0) :
basic_binary_oprimitive<Archive, std::ostream>(
@@ -47,13 +61,7 @@ protected:
0 != (flags & no_codecvt))
{
if(0 == (flags & no_header)){
#if ! defined(__MWERKS__)
this->basic_binary_oarchive<Archive>::init();
this->basic_binary_oprimitive<Archive, std::ostream>::init();
#else
basic_binary_oarchive<Archive>::init();
basic_binary_oprimitive<Archive, std::ostream>::init();
#endif
init();
}
}
};
@@ -67,8 +75,7 @@ class binary_oarchive :
public:
binary_oarchive(std::ostream & os, unsigned int flags = 0) :
binary_oarchive_impl<binary_oarchive>(os, flags)
{
}
{}
};
} // namespace archive
@@ -78,4 +85,6 @@ public:
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::binary_oarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BINARY_OARCHIVE_HPP

View File

@@ -22,9 +22,12 @@
#else
#include <istream>
#include <boost/archive/detail/auto_link_warchive.hpp>
#include <boost/archive/basic_binary_iprimitive.hpp>
#include <boost/archive/basic_binary_iarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -57,7 +60,10 @@ protected:
0 != (flags & no_codecvt)
),
basic_binary_iarchive<Archive>()
{}
{
if(0 == (flags & no_header))
init();
}
};
// do not derive from this class. If you want to extend this functionality
@@ -68,15 +74,18 @@ class binary_wiarchive :
{
public:
binary_wiarchive(std::wistream & is, unsigned int flags = 0) :
binary_wiarchive_impl<binary_wiarchive>(is, flags | no_header)
{
if(0 == (flags & no_header))
init();
}
binary_wiarchive_impl<binary_wiarchive>(is, flags)
{}
};
} // namespace archive
} // namespace boost
// required by smart_cast for compilers not implementing
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::binary_wiarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_NO_STD_WSTREAMBUF
#endif // BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP

View File

@@ -22,9 +22,12 @@
#else
#include <ostream>
#include <boost/archive/detail/auto_link_warchive.hpp>
#include <boost/archive/basic_binary_oprimitive.hpp>
#include <boost/archive/basic_binary_oarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -49,9 +52,11 @@ protected:
basic_binary_oprimitive<Archive, std::wostream>(
os,
0 != (flags & no_codecvt)
),
basic_binary_oarchive<Archive>(flags)
{}
)
{
if(0 == (flags & no_header))
init();
}
};
// do not derive from this class. If you want to extend this functionality
@@ -62,15 +67,19 @@ class binary_woarchive :
{
public:
binary_woarchive(std::wostream & os, unsigned int flags = 0) :
binary_woarchive_impl<binary_woarchive>(os, flags | no_header)
{
if(0 == (flags & no_header))
init();
}
binary_woarchive_impl<binary_woarchive>(os, flags)
{}
~binary_woarchive(){}
};
} // namespace archive
} // namespace boost
// required by smart_cast for compilers not implementing
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::binary_woarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_NO_STD_WSTREAMBUF
#endif // BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// codecvt_null.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2004 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

View File

@@ -93,10 +93,6 @@ public:
virtual void load_end(const char * name) = 0;
virtual void register_basic_serializer(const detail::basic_iserializer & bis) = 0;
// utility function implemented by all legal archives
virtual unsigned int library_version() const = 0;
virtual void load_binary(void * t, std::size_t size) = 0;
virtual void delete_created_pointers() = 0;
// msvc and borland won't automatically pass these to the base class so
@@ -106,7 +102,6 @@ public:
{
archive::load(* this, t);
}
// special treatment for name-value pairs.
template<class T>
void load_override(boost::serialization::nvp<T> & t, int)
@@ -116,6 +111,10 @@ public:
load_end(t.name());
}
public:
// utility function implemented by all legal archives
virtual unsigned int library_version() const = 0;
virtual void load_binary(void * t, std::size_t size) = 0;
// these are used by the serialization library implementation.
virtual void load_object(
void *t,

View File

@@ -95,8 +95,6 @@ public:
virtual unsigned int library_version() const = 0;
virtual void end_preamble() = 0;
// utility function implemented by all legal archives
virtual void save_binary(const void * t, std::size_t size) = 0;
// msvc and borland won't automatically pass these to the base class so
// make it explicit here
@@ -114,6 +112,9 @@ public:
save_end(t.name());
}
public:
// utility function implemented by all legal archives
virtual void save_binary(const void * t, std::size_t size) = 0;
virtual void save_object(
const void *x,
const detail::basic_oserializer & bos

View File

@@ -18,9 +18,11 @@
#include <istream>
#include <boost/config.hpp>
#include <boost/archive/basic_text_iarchive.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/basic_text_iprimitive.hpp>
#include <boost/archive/basic_text_iarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -30,7 +32,6 @@ class text_iarchive_impl :
public basic_text_iprimitive<std::istream>,
public basic_text_iarchive<Archive>
{
protected:
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
public:
#else
@@ -43,13 +44,21 @@ protected:
void load(T & t){
basic_text_iprimitive<std::istream>::load(t);
}
void load(char * t);
void
BOOST_DECL_ARCHIVE
load(char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void load(wchar_t * t);
void
BOOST_DECL_ARCHIVE
load(wchar_t * t);
#endif
void load(std::string &s);
void
BOOST_DECL_ARCHIVE
load(std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void load(std::wstring &ws);
void
BOOST_DECL_ARCHIVE
load(std::wstring &ws);
#endif
// note: the following should not needed - but one compiler (vc 7.1)
// fails to compile one test (test_shared_ptr) without it !!!
@@ -58,16 +67,10 @@ protected:
void load_override(T & t, BOOST_PFTO int){
basic_text_iarchive<Archive>::load_override(t, 0);
}
text_iarchive_impl(std::istream & is, unsigned int flags = 0) :
basic_text_iprimitive<std::istream>(
is,
0 != (flags & no_codecvt)
),
basic_text_iarchive<Archive>()
{
if(0 == (flags & no_header))
basic_text_iarchive<Archive>::init();
}
BOOST_DECL_ARCHIVE
text_iarchive_impl(std::istream & is, unsigned int flags = 0);
BOOST_DECL_ARCHIVE
~text_iarchive_impl(){};
};
// do not derive from this class. If you want to extend this functionality
@@ -77,10 +80,11 @@ class text_iarchive :
public text_iarchive_impl<text_iarchive>
{
public:
text_iarchive(std::istream & is, unsigned int flags = 0) :
text_iarchive_impl<text_iarchive>(is, flags)
{
}
{}
~text_iarchive(){}
};
} // namespace archive
@@ -90,4 +94,6 @@ public:
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::text_iarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_TEXT_IARCHIVE_HPP

View File

@@ -17,8 +17,8 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <ostream>
#include <cstddef> // std::size_t
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
@@ -26,9 +26,12 @@ namespace std{
} // namespace std
#endif
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/basic_text_oprimitive.hpp>
#include <boost/archive/basic_text_oarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -50,39 +53,31 @@ protected:
this->newtoken();
basic_text_oprimitive<std::ostream>::save(t);
}
void save(const char * t);
void
BOOST_DECL_ARCHIVE
save(const char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void save(const wchar_t * t);
void
BOOST_DECL_ARCHIVE
save(const wchar_t * t);
#endif
void save(const std::string &s);
void
BOOST_DECL_ARCHIVE
save(const std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void save(const std::wstring &ws);
void
BOOST_DECL_ARCHIVE
save(const std::wstring &ws);
#endif
protected:
text_oarchive_impl(std::ostream & os, unsigned int flags = 0) :
basic_text_oprimitive<std::ostream>(
os,
0 != (flags & no_codecvt)
),
basic_text_oarchive<Archive>()
{
if(0 == (flags & no_header))
basic_text_oarchive<Archive>::init();
}
BOOST_DECL_ARCHIVE
text_oarchive_impl(std::ostream & os, unsigned int flags = 0);
BOOST_DECL_ARCHIVE
~text_oarchive_impl(){};
public:
void save_binary(const void *address, std::size_t count){
put('\n');
this->end_preamble();
#if ! defined(__MWERKS__)
this->basic_text_oprimitive<std::ostream>::save_binary(
#else
this->basic_text_oprimitive::save_binary(
#endif
address,
count
);
this->delimiter = this->eol;
}
void
BOOST_DECL_ARCHIVE
save_binary(const void *address, std::size_t count);
};
// do not derive from this class. If you want to extend this functionality
@@ -92,10 +87,11 @@ class text_oarchive :
public text_oarchive_impl<text_oarchive>
{
public:
text_oarchive(std::ostream & os, unsigned int flags = 0) :
text_oarchive_impl<text_oarchive>(os, flags)
{
}
{}
~text_oarchive(){}
};
} // namespace archive
@@ -105,4 +101,6 @@ public:
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::text_oarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_TEXT_OARCHIVE_HPP

View File

@@ -17,16 +17,18 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#ifdef BOOST_NO_STD_WSTREAMBUF
#error "wide char i/o not supported on this platform"
#else
#include <istream>
#include <boost/archive/detail/auto_link_warchive.hpp>
#include <boost/archive/basic_text_iprimitive.hpp>
#include <boost/archive/basic_text_iarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -47,13 +49,13 @@ protected:
void load(T & t){
basic_text_iprimitive<std::wistream>::load(t);
}
void load(char * t);
void BOOST_DECL_WARCHIVE load(char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void load(wchar_t * t);
void BOOST_DECL_WARCHIVE load(wchar_t * t);
#endif
void load(std::string &s);
void BOOST_DECL_WARCHIVE load(std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void load(std::wstring &ws);
void BOOST_DECL_WARCHIVE load(std::wstring &ws);
#endif
// note: the following should not needed - but one compiler (vc 7.1)
// fails to compile one test (test_shared_ptr) without it !!!
@@ -66,25 +68,33 @@ protected:
is,
0 != (flags & no_codecvt)
)
{}
{
if(0 == (flags & no_header))
basic_text_iarchive<Archive>::init();
}
};
// do not derive from this class. If you want to extend this functionality
// via inhertance, derived from text_wiarchive_impl instead. This will
// preserve correct static polymorphism.
class text_wiarchive : public text_wiarchive_impl<text_wiarchive>
class text_wiarchive :
public text_wiarchive_impl<text_wiarchive>
{
public:
text_wiarchive(std::wistream & is, unsigned int flags = 0) :
text_wiarchive_impl<text_wiarchive>(is, flags | no_header)
{
if(0 == (flags & no_header))
basic_text_iarchive<text_wiarchive>::init();
}
text_wiarchive_impl<text_wiarchive>(is, flags)
{}
~text_wiarchive(){}
};
} // namespace archive
} // namespace boost
// required by smart_cast for compilers not implementing
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::text_wiarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_NO_STD_WSTREAMBUF
#endif // BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP

View File

@@ -17,12 +17,13 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp>
#ifdef BOOST_NO_STD_WSTREAMBUF
#error "wide char i/o not supported on this platform"
#else
#include <cstddef> // size_t
#include <ostream>
#include <cstddef> // size_t
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
@@ -30,9 +31,12 @@ namespace std{
} // namespace std
#endif
#include <boost/archive/detail/auto_link_warchive.hpp>
#include <boost/archive/basic_text_oprimitive.hpp>
#include <boost/archive/basic_text_oarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -54,20 +58,23 @@ protected:
this->newtoken();
basic_text_oprimitive<std::wostream>::save(t);
}
void save(const char * t);
void BOOST_DECL_WARCHIVE save(const char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void save(const wchar_t * t);
void BOOST_DECL_WARCHIVE save(const wchar_t * t);
#endif
void save(const std::string &s);
void BOOST_DECL_WARCHIVE save(const std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void save(const std::wstring &ws);
void BOOST_DECL_WARCHIVE save(const std::wstring &ws);
#endif
text_woarchive_impl(std::wostream & os, unsigned int flags = 0) :
basic_text_oprimitive<std::wostream>(
os,
0 != (flags & no_codecvt)
)
{}
{
if(0 == (flags & no_header))
basic_text_oarchive<Archive>::init();
}
public:
void save_binary(const void *address, std::size_t count){
put(L'\n');
@@ -97,15 +104,19 @@ class text_woarchive :
{
public:
text_woarchive(std::wostream & os, unsigned int flags = 0) :
text_woarchive_impl<text_woarchive>(os, flags | no_header)
{
if(0 == (flags & no_header))
basic_text_oarchive<text_woarchive>::init();
}
text_woarchive_impl<text_woarchive>(os, flags)
{}
~text_woarchive(){}
};
} // namespace archive
} // namespace boost
// required by smart_cast for compilers not implementing
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::text_woarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_NO_STD_WSTREAMBUF
#endif // BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP

View File

@@ -19,6 +19,7 @@
#include <cstdlib> // getenv
#include <cassert>
#include <boost/config.hpp>
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std {
using ::getenv;

View File

@@ -19,9 +19,11 @@
#include <istream>
//#include <boost/scoped_ptr.hpp>
#include <boost/config.hpp>
#include <boost/archive/basic_xml_iarchive.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/basic_text_iprimitive.hpp>
#include <boost/archive/basic_xml_iarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -57,21 +59,27 @@ protected:
void load(T & t){
basic_text_iprimitive<std::istream>::load(t);
}
void load(char * t);
void BOOST_DECL_ARCHIVE load(char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void load(wchar_t * t);
void BOOST_DECL_ARCHIVE load(wchar_t * t);
#endif
void load(std::string &s);
void BOOST_DECL_ARCHIVE load(std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void load(std::wstring &ws);
void BOOST_DECL_ARCHIVE load(std::wstring &ws);
#endif
template<class T>
void load_override(T & t, BOOST_PFTO int){
basic_xml_iarchive<Archive>::load_override(t, 0);
}
void load_override(class_name_type & t, int);
void init();
xml_iarchive_impl(std::istream & is, unsigned int flags = 0) ;
void
BOOST_DECL_ARCHIVE
load_override(class_name_type & t, int);
void
BOOST_DECL_ARCHIVE
init();
BOOST_DECL_ARCHIVE
xml_iarchive_impl(std::istream & is, unsigned int flags = 0);
BOOST_DECL_ARCHIVE
~xml_iarchive_impl();
};
@@ -88,6 +96,7 @@ public:
xml_iarchive(std::istream & is, unsigned int flags = 0) :
xml_iarchive_impl<xml_iarchive>(is, flags)
{}
~xml_iarchive(){};
};
} // namespace archive
@@ -97,4 +106,6 @@ public:
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::xml_iarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_XML_IARCHIVE_HPP

View File

@@ -26,9 +26,12 @@ namespace std{
} // namespace std
#endif
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/basic_text_oprimitive.hpp>
#include <boost/archive/basic_xml_oarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -52,15 +55,17 @@ protected:
void save(const T & t){
basic_text_oprimitive<std::ostream>::save(t);
}
void save(const char * t);
void BOOST_DECL_ARCHIVE save(const char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void save(const wchar_t * t);
void BOOST_DECL_ARCHIVE save(const wchar_t * t);
#endif
void save(const std::string &s);
void BOOST_DECL_ARCHIVE save(const std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void save(const std::wstring &ws);
void BOOST_DECL_ARCHIVE save(const std::wstring &ws);
#endif
BOOST_DECL_ARCHIVE
xml_oarchive_impl(std::ostream & os, unsigned int flags = 0);
~xml_oarchive_impl(){}
public:
void save_binary(const void *address, std::size_t count){
this->end_preamble();
@@ -89,6 +94,7 @@ public:
xml_oarchive(std::ostream & os, unsigned int flags = 0) :
xml_oarchive_impl<xml_oarchive>(os, flags)
{}
~xml_oarchive(){}
};
} // namespace archive
@@ -98,4 +104,6 @@ public:
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::xml_oarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP

View File

@@ -24,10 +24,12 @@
#include <istream>
//#include <boost/scoped_ptr.hpp>
#include <boost/pfto.hpp>
#include <boost/archive/detail/auto_link_warchive.hpp>
#include <boost/archive/basic_text_iprimitive.hpp>
#include <boost/archive/basic_xml_iarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -59,22 +61,22 @@ protected:
void load(T & t){
basic_text_iprimitive<std::wistream>::load(t);
}
void load(char * t);
void BOOST_DECL_WARCHIVE load(char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void load(wchar_t * t);
void BOOST_DECL_WARCHIVE load(wchar_t * t);
#endif
void load(std::string &s);
void BOOST_DECL_WARCHIVE load(std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void load(std::wstring &ws);
void BOOST_DECL_WARCHIVE load(std::wstring &ws);
#endif
template<class T>
void load_override(T & t, BOOST_PFTO int){
basic_xml_iarchive<Archive>::load_override(t, 0);
}
void load_override(class_name_type & t, int);
void init();
xml_wiarchive_impl(std::wistream & is, unsigned int flags = 0) ;
~xml_wiarchive_impl();
void BOOST_DECL_WARCHIVE load_override(class_name_type & t, int);
void BOOST_DECL_WARCHIVE init();
BOOST_DECL_WARCHIVE xml_wiarchive_impl(std::wistream & is, unsigned int flags = 0) ;
BOOST_DECL_WARCHIVE ~xml_wiarchive_impl();
};
// we use the following because we can't use
@@ -90,10 +92,17 @@ public:
xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
xml_wiarchive_impl<xml_wiarchive>(is, flags)
{}
~xml_wiarchive(){}
};
} // namespace archive
} // namespace boost
// required by smart_cast for compilers not implementing
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::xml_wiarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_NO_STD_WSTREAMBUF
#endif // BOOST_ARCHIVE_XML_WIARCHIVE_HPP

View File

@@ -21,11 +21,21 @@
#error "wide char i/o not supported on this platform"
#else
#include <cstddef> // size_t
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
} // namespace std
#endif
#include <ostream>
#include <boost/archive/detail/auto_link_warchive.hpp>
#include <boost/archive/basic_text_oprimitive.hpp>
#include <boost/archive/basic_xml_oarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
namespace archive {
@@ -49,15 +59,17 @@ protected:
void save(const T & t){
basic_text_oprimitive<std::wostream>::save(t);
}
void save(const char * t);
void BOOST_DECL_WARCHIVE save(const char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
void save(const wchar_t * t);
void BOOST_DECL_WARCHIVE save(const wchar_t * t);
#endif
void save(const std::string &s);
void BOOST_DECL_WARCHIVE save(const std::string &s);
#ifndef BOOST_NO_STD_WSTRING
void save(const std::wstring &ws);
void BOOST_DECL_WARCHIVE save(const std::wstring &ws);
#endif
BOOST_DECL_WARCHIVE
xml_woarchive_impl(std::wostream & os, unsigned int flags = 0);
~xml_woarchive_impl(){}
public:
void save_binary(const void *address, std::size_t count){
this->end_preamble();
@@ -86,6 +98,7 @@ public:
xml_woarchive(std::wostream & os, unsigned int flags = 0) :
xml_woarchive_impl<xml_woarchive>(os, flags)
{}
~xml_woarchive(){}
};
} // namespace archive
@@ -95,5 +108,7 @@ public:
// partial template specialization
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(boost::archive::xml_woarchive)
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_NO_STD_WSTREAMBUF
#endif // BOOST_ARCHIVE_XML_OWARCHIVE_HPP
#endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP