mirror of
https://github.com/boostorg/serialization.git
synced 2026-02-23 03:52:24 +00:00
Merge develop to master
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
#include <string>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
|
||||
// note: the only reason this is in here is that windows header
|
||||
@@ -40,11 +39,16 @@ namespace archive {
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// exceptions thrown by archives
|
||||
//
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception :
|
||||
class BOOST_SYMBOL_VISIBLE archive_exception :
|
||||
public virtual std::exception
|
||||
{
|
||||
protected:
|
||||
private:
|
||||
char m_buffer[128];
|
||||
protected:
|
||||
BOOST_ARCHIVE_DECL unsigned int
|
||||
append(unsigned int l, const char * a);
|
||||
BOOST_ARCHIVE_DECL
|
||||
archive_exception() BOOST_NOEXCEPT;
|
||||
public:
|
||||
typedef enum {
|
||||
no_exception, // initialized without code
|
||||
@@ -76,19 +80,15 @@ public:
|
||||
// type has been instantiated in more than one module.
|
||||
output_stream_error // error on input stream
|
||||
} exception_code;
|
||||
public:
|
||||
exception_code code;
|
||||
archive_exception(
|
||||
|
||||
BOOST_ARCHIVE_DECL archive_exception(
|
||||
exception_code c,
|
||||
const char * e1 = NULL,
|
||||
const char * e2 = NULL
|
||||
);
|
||||
virtual ~archive_exception() throw();
|
||||
virtual const char *what() const throw();
|
||||
protected:
|
||||
unsigned int
|
||||
append(unsigned int l, const char * a);
|
||||
archive_exception();
|
||||
) BOOST_NOEXCEPT;
|
||||
virtual BOOST_ARCHIVE_DECL ~archive_exception() BOOST_NOEXCEPT_OR_NOTHROW ;
|
||||
virtual BOOST_ARCHIVE_DECL const char * what() const BOOST_NOEXCEPT_OR_NOTHROW ;
|
||||
};
|
||||
|
||||
}// namespace archive
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
BOOST_ARCHIVE_DECL(library_version_type)
|
||||
BOOST_ARCHIVE_DECL library_version_type
|
||||
BOOST_ARCHIVE_VERSION();
|
||||
|
||||
class version_type {
|
||||
@@ -242,7 +242,7 @@ enum archive_flags {
|
||||
flags_last = 8
|
||||
};
|
||||
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_SIGNATURE();
|
||||
|
||||
/* NOTE : Warning : Warning : Warning : Warning : Warning
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/archive/basic_archive.hpp>
|
||||
#include <boost/archive/detail/common_iarchive.hpp>
|
||||
@@ -51,7 +50,7 @@ namespace detail {
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_binary_iarchive - read serialized objects from a input binary stream
|
||||
template<class Archive>
|
||||
class basic_binary_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_binary_iarchive :
|
||||
public detail::common_iarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -72,8 +71,8 @@ protected:
|
||||
// note extra nonsense to sneak it pass the borland compiers
|
||||
typedef detail::common_iarchive<Archive> detail_common_iarchive;
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int version){
|
||||
this->detail_common_iarchive::load_override(t, static_cast<int>(version));
|
||||
void load_override(T & t){
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
|
||||
// include these to trap a change in binary format which
|
||||
@@ -86,7 +85,7 @@ protected:
|
||||
BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
|
||||
|
||||
// binary files don't include the optional information
|
||||
void load_override(class_id_optional_type & /* t */, int){}
|
||||
void load_override(class_id_optional_type & /* t */){}
|
||||
|
||||
void load_override(tracking_type & t, int /*version*/){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
@@ -101,10 +100,10 @@ protected:
|
||||
t = boost::archive::tracking_type(x);
|
||||
}
|
||||
}
|
||||
void load_override(class_id_type & t, int version){
|
||||
void load_override(class_id_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
this->detail_common_iarchive::load_override(t, version);
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
@@ -118,37 +117,14 @@ protected:
|
||||
t = boost::archive::class_id_type(x);
|
||||
}
|
||||
}
|
||||
void load_override(class_id_reference_type & t, int version){
|
||||
load_override(static_cast<class_id_type &>(t), version);
|
||||
void load_override(class_id_reference_type & t){
|
||||
load_override(static_cast<class_id_type &>(t));
|
||||
}
|
||||
#if 0
|
||||
void load_override(class_id_reference_type & t, int version){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
this->detail_common_iarchive::load_override(t, version);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
int_least16_t x=0;
|
||||
* this->This() >> x;
|
||||
t = boost::archive::class_id_reference_type(
|
||||
boost::archive::class_id_type(x)
|
||||
);
|
||||
}
|
||||
else{
|
||||
int x=0;
|
||||
* this->This() >> x;
|
||||
t = boost::archive::class_id_reference_type(
|
||||
boost::archive::class_id_type(x)
|
||||
);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void load_override(version_type & t, int version){
|
||||
void load_override(version_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
this->detail_common_iarchive::load_override(t, version);
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
@@ -176,11 +152,11 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void load_override(boost::serialization::item_version_type & t, int version){
|
||||
void load_override(boost::serialization::item_version_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
// if(boost::archive::library_version_type(7) < lvt){
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
this->detail_common_iarchive::load_override(t, version);
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
@@ -195,9 +171,9 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void load_override(serialization::collection_size_type & t, int version){
|
||||
void load_override(serialization::collection_size_type & t){
|
||||
if(boost::archive::library_version_type(5) < this->get_library_version()){
|
||||
this->detail_common_iarchive::load_override(t, version);
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
else{
|
||||
unsigned int x=0;
|
||||
@@ -206,9 +182,9 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
load_override(class_name_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_override(class_name_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init();
|
||||
|
||||
basic_binary_iarchive(unsigned int flags) :
|
||||
|
||||
@@ -67,8 +67,7 @@ class codecvt_null;
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// class binary_iarchive - read serialized objects from a input binary stream
|
||||
template<class Archive, class Elem, class Tr>
|
||||
class basic_binary_iprimitive
|
||||
{
|
||||
class BOOST_SYMBOL_VISIBLE basic_binary_iprimitive {
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
friend class load_access;
|
||||
protected:
|
||||
@@ -103,25 +102,25 @@ public:
|
||||
BOOST_ASSERT(0 == i || 1 == i);
|
||||
(void)i; // warning suppression for release builds.
|
||||
}
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load(std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load(std::wstring &ws);
|
||||
#endif
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load(char * t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load(wchar_t * t);
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init();
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_binary_iprimitive(
|
||||
std::basic_streambuf<Elem, Tr> & sb,
|
||||
bool no_codecvt
|
||||
);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_binary_iprimitive();
|
||||
public:
|
||||
// we provide an optimized load for all fundamental types
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/integer.hpp>
|
||||
#include <boost/integer_traits.hpp>
|
||||
@@ -59,8 +58,8 @@ namespace detail {
|
||||
// does have the virtue of buiding the smalles archive in the minimum amount
|
||||
// of time. So under some circumstances it may be he right choice.
|
||||
template<class Archive>
|
||||
class basic_binary_oarchive :
|
||||
public archive::detail::common_oarchive<Archive>
|
||||
class BOOST_SYMBOL_VISIBLE basic_binary_oarchive :
|
||||
public detail::common_oarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
@@ -77,8 +76,8 @@ protected:
|
||||
// any datatype not specifed below will be handled by base class
|
||||
typedef detail::common_oarchive<Archive> detail_common_oarchive;
|
||||
template<class T>
|
||||
void save_override(const T & t, BOOST_PFTO int version){
|
||||
this->detail_common_oarchive::save_override(t, static_cast<int>(version));
|
||||
void save_override(const T & t){
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
|
||||
// include these to trap a change in binary format which
|
||||
@@ -92,14 +91,14 @@ protected:
|
||||
BOOST_STATIC_ASSERT(sizeof(object_reference_type) == sizeof(uint_least32_t));
|
||||
|
||||
// binary files don't include the optional information
|
||||
void save_override(const class_id_optional_type & /* t */, int){}
|
||||
void save_override(const class_id_optional_type & /* t */){}
|
||||
|
||||
// enable this if we decide to support generation of previous versions
|
||||
#if 0
|
||||
void save_override(const boost::archive::version_type & t, int version){
|
||||
void save_override(const boost::archive::version_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
this->detail_common_oarchive::save_override(t, version);
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
@@ -111,10 +110,10 @@ protected:
|
||||
* this->This() << x;
|
||||
}
|
||||
}
|
||||
void save_override(const boost::serialization::item_version_type & t, int version){
|
||||
void save_override(const boost::serialization::item_version_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
this->detail_common_oarchive::save_override(t, version);
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
@@ -127,10 +126,10 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void save_override(class_id_type & t, int version){
|
||||
void save_override(class_id_type & t){
|
||||
library_version_type lvt = this->get_library_version();
|
||||
if(boost::archive::library_version_type(7) < lvt){
|
||||
this->detail_common_oarchive::save_override(t, version);
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
else
|
||||
if(boost::archive::library_version_type(6) < lvt){
|
||||
@@ -142,20 +141,20 @@ protected:
|
||||
* this->This() << x;
|
||||
}
|
||||
}
|
||||
void save_override(class_id_reference_type & t, int version){
|
||||
save_override(static_cast<class_id_type &>(t), version);
|
||||
void save_override(class_id_reference_type & t){
|
||||
save_override(static_cast<class_id_type &>(t));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// explicitly convert to char * to avoid compile ambiguities
|
||||
void save_override(const class_name_type & t, int){
|
||||
void save_override(const class_name_type & t){
|
||||
const std::string s(t);
|
||||
* this->This() << s;
|
||||
}
|
||||
|
||||
#if 0
|
||||
void save_override(const serialization::collection_size_type & t, int){
|
||||
void save_override(const serialization::collection_size_type & t){
|
||||
if (get_library_version() < boost::archive::library_version_type(6)){
|
||||
unsigned int x=0;
|
||||
* this->This() >> x;
|
||||
@@ -166,7 +165,7 @@ protected:
|
||||
}
|
||||
}
|
||||
#endif
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init();
|
||||
|
||||
basic_binary_oarchive(unsigned int flags) :
|
||||
|
||||
@@ -61,7 +61,7 @@ class codecvt_null;
|
||||
// class basic_binary_oprimitive - binary output of prmitives
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
class basic_binary_oprimitive {
|
||||
class BOOST_SYMBOL_VISIBLE basic_binary_oprimitive {
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
friend class save_access;
|
||||
protected:
|
||||
@@ -94,26 +94,26 @@ public:
|
||||
BOOST_ASSERT(0 == static_cast<int>(t) || 1 == static_cast<int>(t));
|
||||
save_binary(& t, sizeof(t));
|
||||
}
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save(const std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save(const std::wstring &ws);
|
||||
#endif
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save(const char * t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save(const wchar_t * t);
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init();
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_binary_oprimitive(
|
||||
std::basic_streambuf<Elem, Tr> & sb,
|
||||
bool no_codecvt
|
||||
);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_binary_oprimitive();
|
||||
public:
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
// use two template parameters
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/archive/detail/common_iarchive.hpp>
|
||||
@@ -47,7 +46,7 @@ namespace detail {
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_text_iarchive - read serialized objects from a input text stream
|
||||
template<class Archive>
|
||||
class basic_text_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_text_iarchive :
|
||||
public detail::common_iarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -67,16 +66,16 @@ protected:
|
||||
// template ordering
|
||||
typedef detail::common_iarchive<Archive> detail_common_iarchive;
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
this->detail_common_iarchive::load_override(t, 0);
|
||||
void load_override(T & t){
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
// text file don't include the optional information
|
||||
void load_override(class_id_optional_type & /*t*/, int){}
|
||||
void load_override(class_id_optional_type & /*t*/){}
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
load_override(class_name_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_override(class_name_type & t);
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init(void);
|
||||
|
||||
basic_text_iarchive(unsigned int flags) :
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace archive {
|
||||
#endif
|
||||
|
||||
template<class IStream>
|
||||
class basic_text_iprimitive {
|
||||
class BOOST_SYMBOL_VISIBLE basic_text_iprimitive {
|
||||
protected:
|
||||
IStream &is;
|
||||
io::ios_flags_saver flags_saver;
|
||||
@@ -116,12 +116,12 @@ protected:
|
||||
t = i;
|
||||
}
|
||||
#endif
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_text_iprimitive(IStream &is, bool no_codecvt);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_text_iprimitive();
|
||||
public:
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_binary(void *address, std::size_t count);
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
// use two template parameters
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/archive/detail/common_oarchive.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
@@ -47,7 +46,7 @@ namespace detail {
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_text_oarchive
|
||||
template<class Archive>
|
||||
class basic_text_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_text_oarchive :
|
||||
public detail::common_oarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -69,7 +68,7 @@ protected:
|
||||
space
|
||||
} delimiter;
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
newtoken();
|
||||
|
||||
void newline(){
|
||||
@@ -80,25 +79,25 @@ protected:
|
||||
// extra stuff to get it passed borland compilers
|
||||
typedef detail::common_oarchive<Archive> detail_common_oarchive;
|
||||
template<class T>
|
||||
void save_override(T & t, BOOST_PFTO int){
|
||||
this->detail_common_oarchive::save_override(t, 0);
|
||||
void save_override(T & t){
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
|
||||
// start new objects on a new line
|
||||
void save_override(const object_id_type & t, int){
|
||||
void save_override(const object_id_type & t){
|
||||
this->This()->newline();
|
||||
this->detail_common_oarchive::save_override(t, 0);
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
|
||||
// text file don't include the optional information
|
||||
void save_override(const class_id_optional_type & /* t */, int){}
|
||||
void save_override(const class_id_optional_type & /* t */){}
|
||||
|
||||
void save_override(const class_name_type & t, int){
|
||||
void save_override(const class_name_type & t){
|
||||
const std::string s(t);
|
||||
* this->This() << s;
|
||||
}
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init();
|
||||
|
||||
basic_text_oarchive(unsigned int flags) :
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace archive {
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class basic_text_oprimitive - output of prmitives to stream
|
||||
template<class OStream>
|
||||
class basic_text_oprimitive
|
||||
class BOOST_SYMBOL_VISIBLE basic_text_oprimitive
|
||||
{
|
||||
protected:
|
||||
OStream &os;
|
||||
@@ -174,9 +174,9 @@ protected:
|
||||
save_impl(t, tf);
|
||||
}
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_text_oprimitive(OStream & os, bool no_codecvt);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_text_oprimitive();
|
||||
public:
|
||||
// unformatted append of one character
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
while('\0' != *s)
|
||||
os.put(*s++);
|
||||
}
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_binary(const void *address, std::size_t count);
|
||||
};
|
||||
|
||||
|
||||
@@ -27,35 +27,35 @@ namespace archive {
|
||||
// constant strings used in xml i/o
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_OBJECT_ID();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_OBJECT_REFERENCE();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_CLASS_ID();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_CLASS_NAME();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_TRACKING();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_VERSION();
|
||||
|
||||
extern
|
||||
BOOST_ARCHIVE_DECL(const char *)
|
||||
BOOST_ARCHIVE_DECL const char *
|
||||
BOOST_ARCHIVE_XML_SIGNATURE();
|
||||
|
||||
}// namespace archive
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/archive/detail/common_iarchive.hpp>
|
||||
@@ -44,7 +43,7 @@ namespace detail {
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// class xml_iarchive - read serialized objects from a input text stream
|
||||
template<class Archive>
|
||||
class basic_xml_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_xml_iarchive :
|
||||
public detail::common_iarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -60,21 +59,21 @@ protected:
|
||||
#endif
|
||||
#endif
|
||||
unsigned int depth;
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_start(const char *name);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_end(const char *name);
|
||||
|
||||
// Anything not an attribute and not a name-value pair is an
|
||||
// should be trapped here.
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int)
|
||||
void load_override(T & t)
|
||||
{
|
||||
// If your program fails to compile here, its most likely due to
|
||||
// not specifying an nvp wrapper around the variable to
|
||||
// be serialized.
|
||||
BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
|
||||
this->detail_common_iarchive::load_override(t, 0);
|
||||
this->detail_common_iarchive::load_override(t);
|
||||
}
|
||||
|
||||
// Anything not an attribute - see below - should be a name value
|
||||
@@ -82,14 +81,10 @@ protected:
|
||||
typedef detail::common_iarchive<Archive> detail_common_iarchive;
|
||||
template<class T>
|
||||
void load_override(
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
const
|
||||
#endif
|
||||
boost::serialization::nvp< T > & t,
|
||||
int
|
||||
const boost::serialization::nvp< T > & t
|
||||
){
|
||||
this->This()->load_start(t.name());
|
||||
this->detail_common_iarchive::load_override(t.value(), 0);
|
||||
this->detail_common_iarchive::load_override(t.value());
|
||||
this->This()->load_end(t.name());
|
||||
}
|
||||
|
||||
@@ -101,23 +96,23 @@ protected:
|
||||
// an xml archive. So we can skip it here. Note: we MUST override
|
||||
// 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){}
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
load_override(object_id_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
load_override(version_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
load_override(class_id_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
load_override(tracking_type & t, int);
|
||||
void load_override(class_id_optional_type & /* t */){}
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_override(object_id_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_override(version_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_override(class_id_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
load_override(tracking_type & t);
|
||||
// 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);
|
||||
// void load_override(class_name_type & t);
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_xml_iarchive(unsigned int flags);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_xml_iarchive();
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/archive/detail/common_oarchive.hpp>
|
||||
@@ -45,7 +44,7 @@ namespace detail {
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// class basic_xml_oarchive - write serialized objects to a xml output stream
|
||||
template<class Archive>
|
||||
class basic_xml_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_xml_oarchive :
|
||||
public detail::common_oarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -65,78 +64,74 @@ protected:
|
||||
unsigned int depth;
|
||||
bool indent_next;
|
||||
bool pending_preamble;
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
indent();
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
init();
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
write_attribute(
|
||||
const char *attribute_name,
|
||||
int t,
|
||||
const char *conjunction = "=\""
|
||||
);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
write_attribute(
|
||||
const char *attribute_name,
|
||||
const char *key
|
||||
);
|
||||
// helpers used below
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_start(const char *name);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_end(const char *name);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
end_preamble();
|
||||
|
||||
// Anything not an attribute and not a name-value pair is an
|
||||
// error and should be trapped here.
|
||||
template<class T>
|
||||
void save_override(T & t, BOOST_PFTO int)
|
||||
void save_override(T & t)
|
||||
{
|
||||
// If your program fails to compile here, its most likely due to
|
||||
// not specifying an nvp wrapper around the variable to
|
||||
// be serialized.
|
||||
BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
|
||||
this->detail_common_oarchive::save_override(t, 0);
|
||||
this->detail_common_oarchive::save_override(t);
|
||||
}
|
||||
|
||||
// special treatment for name-value pairs.
|
||||
typedef detail::common_oarchive<Archive> detail_common_oarchive;
|
||||
template<class T>
|
||||
void save_override(
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
const
|
||||
#endif
|
||||
::boost::serialization::nvp< T > & t,
|
||||
int
|
||||
const ::boost::serialization::nvp< T > & t
|
||||
){
|
||||
this->This()->save_start(t.name());
|
||||
this->detail_common_oarchive::save_override(t.const_value(), 0);
|
||||
this->detail_common_oarchive::save_override(t.const_value());
|
||||
this->This()->save_end(t.name());
|
||||
}
|
||||
|
||||
// specific overrides for attributes - not name value pairs so we
|
||||
// want to trap them before the above "fall through"
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
save_override(const object_id_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
save_override(const object_reference_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
save_override(const version_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
save_override(const class_id_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
save_override(const class_id_optional_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
save_override(const class_id_reference_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
save_override(const class_name_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
save_override(const tracking_type & t, int);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_override(const object_id_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_override(const object_reference_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_override(const version_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_override(const class_id_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_override(const class_id_optional_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_override(const class_id_reference_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_override(const class_name_type & t);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
save_override(const tracking_type & t);
|
||||
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_xml_oarchive(unsigned int flags);
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
~basic_xml_oarchive();
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace archive {
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from binary_iarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class binary_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE binary_iarchive :
|
||||
public binary_iarchive_impl<
|
||||
boost::archive::binary_iarchive,
|
||||
std::istream::char_type,
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <istream>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/archive/basic_binary_iprimitive.hpp>
|
||||
#include <boost/archive/basic_binary_iarchive.hpp>
|
||||
|
||||
@@ -54,12 +53,9 @@ protected:
|
||||
friend class load_access;
|
||||
#endif
|
||||
#endif
|
||||
// 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 load_override(T & t, BOOST_PFTO int){
|
||||
this->basic_binary_iarchive<Archive>::load_override(t, 0L);
|
||||
void load_override(T & t){
|
||||
this->basic_binary_iarchive<Archive>::load_override(t);
|
||||
}
|
||||
void init(unsigned int flags){
|
||||
if(0 != (flags & no_header))
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace archive {
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from binary_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class binary_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE binary_oarchive :
|
||||
public binary_oarchive_impl<
|
||||
binary_oarchive, std::ostream::char_type, std::ostream::traits_type
|
||||
>
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <ostream>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/archive/basic_binary_oprimitive.hpp>
|
||||
#include <boost/archive/basic_binary_oarchive.hpp>
|
||||
|
||||
@@ -55,12 +54,9 @@ protected:
|
||||
friend class save_access;
|
||||
#endif
|
||||
#endif
|
||||
// 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(T & t, BOOST_PFTO int){
|
||||
this->basic_binary_oarchive<Archive>::save_override(t, 0L);
|
||||
void save_override(T & t){
|
||||
this->basic_binary_oarchive<Archive>::save_override(t);
|
||||
}
|
||||
void init(unsigned int flags) {
|
||||
if(0 != (flags & no_header))
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
template<>
|
||||
class codecvt_null<wchar_t> : public std::codecvt<wchar_t, char, std::mbstate_t>
|
||||
{
|
||||
virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result)
|
||||
virtual BOOST_WARCHIVE_DECL std::codecvt_base::result
|
||||
do_out(
|
||||
std::mbstate_t & state,
|
||||
const wchar_t * first1,
|
||||
@@ -71,7 +71,7 @@ class codecvt_null<wchar_t> : public std::codecvt<wchar_t, char, std::mbstate_t>
|
||||
char * last2,
|
||||
char * & next2
|
||||
) const;
|
||||
virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result)
|
||||
virtual BOOST_WARCHIVE_DECL std::codecvt_base::result
|
||||
do_in(
|
||||
std::mbstate_t & state,
|
||||
const char * first1,
|
||||
|
||||
@@ -14,7 +14,3 @@
|
||||
# pragma warning(disable : 4251 4231 4660 4275)
|
||||
#endif
|
||||
|
||||
#if defined( __BORLANDC__ )
|
||||
#pragma nopushoptwarn
|
||||
#endif
|
||||
|
||||
|
||||
@@ -13,7 +13,3 @@
|
||||
#endif
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
|
||||
#if defined( __BORLANDC__ )
|
||||
#pragma nopushoptwarn
|
||||
#endif
|
||||
|
||||
|
||||
@@ -36,12 +36,11 @@ namespace detail {
|
||||
class basic_serializer;
|
||||
|
||||
template<class Archive>
|
||||
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
archive_serializer_map {
|
||||
class BOOST_SYMBOL_VISIBLE archive_serializer_map {
|
||||
public:
|
||||
static bool insert(const basic_serializer * bs);
|
||||
static void erase(const basic_serializer * bs);
|
||||
static const basic_serializer * find(
|
||||
static BOOST_ARCHIVE_OR_WARCHIVE_DECL bool insert(const basic_serializer * bs);
|
||||
static BOOST_ARCHIVE_OR_WARCHIVE_DECL void erase(const basic_serializer * bs);
|
||||
static BOOST_ARCHIVE_OR_WARCHIVE_DECL const basic_serializer * find(
|
||||
const boost::serialization::extended_type_info & type_
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#ifndef BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
|
||||
#define BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// basic_archive_impl.hpp:
|
||||
|
||||
// (C) Copyright 2002 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)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <set>
|
||||
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
class extended_type_info;
|
||||
} // namespace serialization
|
||||
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_archive_impl
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace serialization
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
|
||||
#endif //BOOST_ARCHIVE_DETAIL_BASIC_ARCHIVE_IMPL_HPP
|
||||
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#ifndef BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP
|
||||
#define BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// basic_config.hpp ---------------------------------------------//
|
||||
|
||||
// (c) Copyright Robert Ramey 2004
|
||||
// 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)
|
||||
|
||||
// See library home page at http://www.boost.org/libs/serialization
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// This header implements separate compilation features as described in
|
||||
// http://www.boost.org/more/separate_compilation.html
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_DECLSPEC // defined in config system
|
||||
// we need to import/export our code only if the user has specifically
|
||||
// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
|
||||
// libraries to be dynamically linked, or BOOST_ARCHIVE_DYN_LINK
|
||||
// if they want just this one to be dynamically linked:
|
||||
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ARCHIVE_DYN_LINK)
|
||||
// export if this is our own source, otherwise import:
|
||||
#ifdef BOOST_ARCHIVE_SOURCE
|
||||
# define BOOST_ARCHIVE_DECL __declspec(dllexport)
|
||||
#else
|
||||
# define BOOST_ARCHIVE_DECL __declspec(dllimport)
|
||||
#endif // BOOST_ARCHIVE_SOURCE
|
||||
#endif // DYN_LINK
|
||||
#endif // BOOST_HAS_DECLSPEC
|
||||
//
|
||||
// if BOOST_ARCHIVE_DECL isn't defined yet define it now:
|
||||
#ifndef BOOST_ARCHIVE_DECL
|
||||
#define BOOST_ARCHIVE_DECL
|
||||
#endif
|
||||
|
||||
#endif // BOOST_ARCHIVE_DETAIL_BASIC_CONFIG_HPP
|
||||
@@ -37,11 +37,12 @@ namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class basic_iarchive_impl;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
|
||||
class basic_iserializer;
|
||||
class basic_pointer_iserializer;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// class basic_iarchive - read serialized objects from a input stream
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_iarchive :
|
||||
private boost::noncopyable,
|
||||
public boost::archive::detail::helper_collection
|
||||
{
|
||||
@@ -56,41 +57,46 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive :
|
||||
virtual void vload(class_name_type &t) = 0;
|
||||
virtual void vload(tracking_type &t) = 0;
|
||||
protected:
|
||||
basic_iarchive(unsigned int flags);
|
||||
BOOST_ARCHIVE_DECL basic_iarchive(unsigned int flags);
|
||||
boost::archive::detail::helper_collection &
|
||||
get_helper_collection(){
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
// some msvc versions require that the following function be public
|
||||
// otherwise it should really protected.
|
||||
// account for bogus gcc warning
|
||||
#if defined(__GNUC__)
|
||||
virtual
|
||||
#endif
|
||||
~basic_iarchive();
|
||||
BOOST_ARCHIVE_DECL ~basic_iarchive();
|
||||
// note: NOT part of the public API.
|
||||
void next_object_pointer(void *t);
|
||||
void register_basic_serializer(
|
||||
BOOST_ARCHIVE_DECL void next_object_pointer(void *t);
|
||||
BOOST_ARCHIVE_DECL void register_basic_serializer(
|
||||
const basic_iserializer & bis
|
||||
);
|
||||
void load_object(
|
||||
BOOST_ARCHIVE_DECL void load_object(
|
||||
void *t,
|
||||
const basic_iserializer & bis
|
||||
);
|
||||
const basic_pointer_iserializer *
|
||||
BOOST_ARCHIVE_DECL const basic_pointer_iserializer *
|
||||
load_pointer(
|
||||
void * & t,
|
||||
const basic_pointer_iserializer * bpis_ptr,
|
||||
const basic_pointer_iserializer * (*finder)(
|
||||
const boost::serialization::extended_type_info & eti
|
||||
)
|
||||
|
||||
);
|
||||
// real public API starts here
|
||||
void
|
||||
BOOST_ARCHIVE_DECL void
|
||||
set_library_version(library_version_type archive_library_version);
|
||||
library_version_type
|
||||
BOOST_ARCHIVE_DECL library_version_type
|
||||
get_library_version() const;
|
||||
unsigned int
|
||||
BOOST_ARCHIVE_DECL unsigned int
|
||||
get_flags() const;
|
||||
void
|
||||
BOOST_ARCHIVE_DECL void
|
||||
reset_object_address(const void * new_address, const void * old_address);
|
||||
void
|
||||
BOOST_ARCHIVE_DECL void
|
||||
delete_created_pointers();
|
||||
};
|
||||
|
||||
|
||||
@@ -39,23 +39,23 @@ namespace serialization {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
|
||||
class basic_iarchive;
|
||||
class basic_pointer_iserializer;
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer :
|
||||
class BOOST_SYMBOL_VISIBLE basic_iserializer :
|
||||
public basic_serializer
|
||||
{
|
||||
private:
|
||||
basic_pointer_iserializer *m_bpis;
|
||||
protected:
|
||||
explicit basic_iserializer(
|
||||
explicit BOOST_ARCHIVE_DECL basic_iserializer(
|
||||
const boost::serialization::extended_type_info & type
|
||||
);
|
||||
// account for bogus gcc warning
|
||||
#if defined(__GNUC__)
|
||||
virtual
|
||||
#endif
|
||||
~basic_iserializer();
|
||||
BOOST_ARCHIVE_DECL ~basic_iserializer();
|
||||
public:
|
||||
bool serialized_as_pointer() const {
|
||||
return m_bpis != NULL;
|
||||
|
||||
@@ -35,12 +35,12 @@ namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class basic_oarchive_impl;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
|
||||
class basic_oserializer;
|
||||
class basic_pointer_oserializer;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// class basic_oarchive - write serialized objects to an output stream
|
||||
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE basic_oarchive :
|
||||
private boost::noncopyable,
|
||||
public boost::archive::detail::helper_collection
|
||||
{
|
||||
@@ -59,22 +59,26 @@ class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive :
|
||||
virtual void vsave(const class_name_type & t) = 0;
|
||||
virtual void vsave(const tracking_type t) = 0;
|
||||
protected:
|
||||
basic_oarchive(unsigned int flags = 0);
|
||||
BOOST_ARCHIVE_DECL basic_oarchive(unsigned int flags = 0);
|
||||
BOOST_ARCHIVE_DECL boost::archive::detail::helper_collection &
|
||||
get_helper_collection(){
|
||||
return *this;
|
||||
}
|
||||
// account for bogus gcc warning
|
||||
#if defined(__GNUC__)
|
||||
virtual
|
||||
#endif
|
||||
~basic_oarchive();
|
||||
BOOST_ARCHIVE_DECL ~basic_oarchive();
|
||||
public:
|
||||
// note: NOT part of the public interface
|
||||
void register_basic_serializer(
|
||||
BOOST_ARCHIVE_DECL void register_basic_serializer(
|
||||
const basic_oserializer & bos
|
||||
);
|
||||
void save_object(
|
||||
BOOST_ARCHIVE_DECL void save_object(
|
||||
const void *x,
|
||||
const basic_oserializer & bos
|
||||
);
|
||||
void save_pointer(
|
||||
BOOST_ARCHIVE_DECL void save_pointer(
|
||||
const void * t,
|
||||
const basic_pointer_oserializer * bpos_ptr
|
||||
);
|
||||
@@ -82,9 +86,9 @@ public:
|
||||
vsave(NULL_POINTER_TAG);
|
||||
}
|
||||
// real public interface starts here
|
||||
void end_preamble(); // default implementation does nothing
|
||||
library_version_type get_library_version() const;
|
||||
unsigned int get_flags() const;
|
||||
BOOST_ARCHIVE_DECL void end_preamble(); // default implementation does nothing
|
||||
BOOST_ARCHIVE_DECL library_version_type get_library_version() const;
|
||||
BOOST_ARCHIVE_DECL unsigned int get_flags() const;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -40,23 +40,23 @@ namespace serialization {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
|
||||
class basic_oarchive;
|
||||
class basic_pointer_oserializer;
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer :
|
||||
class BOOST_SYMBOL_VISIBLE basic_oserializer :
|
||||
public basic_serializer
|
||||
{
|
||||
private:
|
||||
basic_pointer_oserializer *m_bpos;
|
||||
protected:
|
||||
explicit basic_oserializer(
|
||||
explicit BOOST_ARCHIVE_DECL basic_oserializer(
|
||||
const boost::serialization::extended_type_info & type_
|
||||
);
|
||||
// account for bogus gcc warning
|
||||
#if defined(__GNUC__)
|
||||
virtual
|
||||
#endif
|
||||
~basic_oserializer();
|
||||
BOOST_ARCHIVE_DECL ~basic_oserializer();
|
||||
public:
|
||||
bool serialized_as_pointer() const {
|
||||
return m_bpos != NULL;
|
||||
|
||||
@@ -37,20 +37,20 @@ namespace serialization {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer;
|
||||
class basic_iarchive;
|
||||
class basic_iserializer;
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer
|
||||
class BOOST_SYMBOL_VISIBLE basic_pointer_iserializer
|
||||
: public basic_serializer {
|
||||
protected:
|
||||
explicit basic_pointer_iserializer(
|
||||
explicit BOOST_ARCHIVE_DECL basic_pointer_iserializer(
|
||||
const boost::serialization::extended_type_info & type_
|
||||
);
|
||||
// account for bogus gcc warning
|
||||
#if defined(__GNUC__)
|
||||
virtual
|
||||
#endif
|
||||
~basic_pointer_iserializer();
|
||||
BOOST_ARCHIVE_DECL ~basic_pointer_iserializer();
|
||||
public:
|
||||
virtual void * heap_allocation() const = 0;
|
||||
virtual const basic_iserializer & get_basic_serializer() const = 0;
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace serialization {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
|
||||
class basic_oarchive;
|
||||
class basic_oserializer;
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer :
|
||||
class BOOST_SYMBOL_VISIBLE basic_pointer_oserializer :
|
||||
public basic_serializer
|
||||
{
|
||||
protected:
|
||||
explicit basic_pointer_oserializer(
|
||||
explicit BOOST_ARCHIVE_DECL basic_pointer_oserializer(
|
||||
const boost::serialization::extended_type_info & type_
|
||||
);
|
||||
public:
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
#if defined(__GNUC__)
|
||||
virtual
|
||||
#endif
|
||||
~basic_pointer_oserializer();
|
||||
BOOST_ARCHIVE_DECL ~basic_pointer_oserializer();
|
||||
virtual const basic_oserializer & get_basic_serializer() const = 0;
|
||||
virtual void save_object_ptr(
|
||||
basic_oarchive & ar,
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace detail {
|
||||
|
||||
class basic_serializer;
|
||||
|
||||
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
class BOOST_SYMBOL_VISIBLE
|
||||
basic_serializer_map : public
|
||||
boost::noncopyable
|
||||
{
|
||||
@@ -50,9 +50,9 @@ basic_serializer_map : public
|
||||
> map_type;
|
||||
map_type m_map;
|
||||
public:
|
||||
bool insert(const basic_serializer * bs);
|
||||
void erase(const basic_serializer * bs);
|
||||
const basic_serializer * find(
|
||||
BOOST_ARCHIVE_DECL bool insert(const basic_serializer * bs);
|
||||
BOOST_ARCHIVE_DECL void erase(const basic_serializer * bs);
|
||||
BOOST_ARCHIVE_DECL const basic_serializer * find(
|
||||
const boost::serialization::extended_type_info & type_
|
||||
) const;
|
||||
private:
|
||||
|
||||
@@ -62,7 +62,7 @@ private:
|
||||
protected:
|
||||
// default processing - invoke serialization library
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
void load_override(T & t){
|
||||
archive::load(* this->This(), t);
|
||||
}
|
||||
// default implementations of functions which emit start/end tags for
|
||||
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
protected:
|
||||
// default processing - invoke serialization library
|
||||
template<class T>
|
||||
void save_override(T & t, BOOST_PFTO int){
|
||||
void save_override(T & t){
|
||||
archive::save(* this->This(), t);
|
||||
}
|
||||
void save_start(const char * /*name*/){}
|
||||
|
||||
@@ -22,58 +22,38 @@
|
||||
// http://www.boost.org/more/separate_compilation.html
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/preprocessor/facilities/empty.hpp>
|
||||
|
||||
#if defined(BOOST_HAS_DECLSPEC)
|
||||
#if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK))
|
||||
#if defined(BOOST_ARCHIVE_SOURCE)
|
||||
#if defined(__BORLANDC__)
|
||||
#define BOOST_ARCHIVE_DECL(T) T __export
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export
|
||||
#else
|
||||
#define BOOST_ARCHIVE_DECL(T) __declspec(dllexport) T
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T
|
||||
#endif
|
||||
#else
|
||||
#if defined(__BORLANDC__)
|
||||
#define BOOST_ARCHIVE_DECL(T) T __import
|
||||
#else
|
||||
#define BOOST_ARCHIVE_DECL(T) __declspec(dllimport) T
|
||||
#endif
|
||||
#endif
|
||||
#if defined(BOOST_WARCHIVE_SOURCE)
|
||||
#if defined(__BORLANDC__)
|
||||
#define BOOST_WARCHIVE_DECL(T) T __export
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __export
|
||||
#else
|
||||
#define BOOST_WARCHIVE_DECL(T) __declspec(dllexport) T
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllexport) T
|
||||
#endif
|
||||
#else
|
||||
#if defined(__BORLANDC__)
|
||||
#define BOOST_WARCHIVE_DECL(T) T __import
|
||||
#else
|
||||
#define BOOST_WARCHIVE_DECL(T) __declspec(dllimport) T
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(BOOST_WARCHIVE_SOURCE) && !defined(BOOST_ARCHIVE_SOURCE)
|
||||
#if defined(__BORLANDC__)
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T __import
|
||||
#else
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) __declspec(dllimport) T
|
||||
#endif
|
||||
#endif
|
||||
#if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK))
|
||||
#if defined(BOOST_ARCHIVE_SOURCE)
|
||||
#define BOOST_ARCHIVE_DECL BOOST_SYMBOL_EXPORT
|
||||
#else
|
||||
#define BOOST_ARCHIVE_DECL BOOST_SYMBOL_IMPORT
|
||||
#endif
|
||||
#endif // BOOST_HAS_DECLSPEC
|
||||
#if defined(BOOST_WARCHIVE_SOURCE)
|
||||
#define BOOST_WARCHIVE_DECL BOOST_SYMBOL_EXPORT
|
||||
#else
|
||||
#define BOOST_WARCHIVE_DECL BOOST_SYMBOL_IMPORT
|
||||
#endif
|
||||
#if !defined(BOOST_WARCHIVE_SOURCE) && !defined(BOOST_ARCHIVE_SOURCE)
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_IMPORT
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_WARCHIVE_SOURCE) || defined(BOOST_ARCHIVE_SOURCE)
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_EXPORT
|
||||
#else
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if ! defined(BOOST_ARCHIVE_DECL)
|
||||
#define BOOST_ARCHIVE_DECL(T) T
|
||||
#define BOOST_ARCHIVE_DECL
|
||||
#endif
|
||||
#if ! defined(BOOST_WARCHIVE_DECL)
|
||||
#define BOOST_WARCHIVE_DECL(T) T
|
||||
#define BOOST_WARCHIVE_DECL
|
||||
#endif
|
||||
#if ! defined(BOOST_ARCHIVE_OR_WARCHIVE_DECL)
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T
|
||||
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
#endif
|
||||
|
||||
#endif // BOOST_ARCHIVE_DETAIL_DECL_HPP
|
||||
|
||||
@@ -55,11 +55,12 @@ class helper_collection
|
||||
collection m_collection;
|
||||
|
||||
struct predicate {
|
||||
BOOST_DELETED_FUNCTION(predicate & operator=(const predicate & rhs))
|
||||
public:
|
||||
const void * const m_ti;
|
||||
bool operator()(helper_value_type const &rhs) const {
|
||||
return m_ti == rhs.first;
|
||||
}
|
||||
predicate & operator=(const void * ti); // to suppress warning
|
||||
predicate(const void * ti) :
|
||||
m_ti(ti)
|
||||
{}
|
||||
@@ -69,7 +70,7 @@ protected:
|
||||
~helper_collection(){}
|
||||
public:
|
||||
template<typename Helper>
|
||||
Helper& get_helper(void * const id = 0) {
|
||||
Helper& find_helper(void * const id = 0) {
|
||||
collection::const_iterator it =
|
||||
std::find_if(
|
||||
m_collection.begin(),
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/detail/iserializer.hpp>
|
||||
#include <boost/archive/detail/helper_collection.hpp>
|
||||
#include <boost/serialization/singleton.hpp>
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
@@ -27,7 +28,7 @@ namespace boost {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
|
||||
class basic_pointer_iserializer;
|
||||
|
||||
template<class Archive>
|
||||
class interface_iarchive
|
||||
@@ -55,9 +56,16 @@ public:
|
||||
this->This()->register_basic_serializer(bpis.get_basic_serializer());
|
||||
return & bpis;
|
||||
}
|
||||
template<class Helper>
|
||||
Helper &
|
||||
get_helper(void * const id = 0){
|
||||
helper_collection & hc = this->This()->get_helper_collection();
|
||||
return hc.template find_helper<Helper>(id);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
Archive & operator>>(T & t){
|
||||
this->This()->load_override(t, 0);
|
||||
this->This()->load_override(t);
|
||||
return * this->This();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace boost {
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
|
||||
class BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_pointer_oserializer;
|
||||
|
||||
template<class Archive>
|
||||
class interface_oarchive
|
||||
@@ -57,22 +57,25 @@ public:
|
||||
this->This()->register_basic_serializer(bpos.get_basic_serializer());
|
||||
return & bpos;
|
||||
}
|
||||
|
||||
template<class Helper>
|
||||
Helper &
|
||||
get_helper(void * const id = 0){
|
||||
helper_collection & hc = this->This()->get_helper_collection();
|
||||
return hc.template find_helper<Helper>(id);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
Archive & operator<<(T & t){
|
||||
this->This()->save_override(t, 0);
|
||||
Archive & operator<<(const T & t){
|
||||
this->This()->save_override(t);
|
||||
return * this->This();
|
||||
}
|
||||
|
||||
// the & operator
|
||||
template<class T>
|
||||
Archive & operator&(T & t){
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
return * this->This() << const_cast<const T &>(t);
|
||||
#else
|
||||
return * this->This() << t;
|
||||
#endif
|
||||
}
|
||||
Archive & operator&(const T & t){
|
||||
return * this ->This() << t;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -58,8 +58,7 @@ namespace std{
|
||||
|
||||
#include <boost/serialization/assume_abstract.hpp>
|
||||
#define DONT_USE_HAS_NEW_OPERATOR ( \
|
||||
defined(__BORLANDC__) \
|
||||
|| BOOST_WORKAROUND(__IBMCPP__, < 1210) \
|
||||
BOOST_WORKAROUND(__IBMCPP__, < 1210) \
|
||||
|| defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \
|
||||
)
|
||||
#if ! DONT_USE_HAS_NEW_OPERATOR
|
||||
@@ -618,40 +617,6 @@ inline void load(Archive & ar, T &t){
|
||||
typex::invoke(ar, t);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
// BORLAND
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
|
||||
// borland has a couple of problems
|
||||
// a) if function is partially specialized - see below
|
||||
// const paramters are transformed to non-const ones
|
||||
// b) implementation of base_object can't be made to work
|
||||
// correctly which results in all base_object s being const.
|
||||
// So, strip off the const for borland. This breaks the trap
|
||||
// for loading const objects - but I see no alternative
|
||||
template<class Archive, class T>
|
||||
inline void load(Archive &ar, const T & t){
|
||||
load(ar, const_cast<T &>(t));
|
||||
}
|
||||
#endif
|
||||
|
||||
// let wrappers through.
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
template<class Archive, class T>
|
||||
inline void load_wrapper(Archive &ar, const T&t, mpl::true_){
|
||||
boost::archive::load(ar, const_cast<T&>(t));
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
|
||||
template<class Archive, class T>
|
||||
inline void load(Archive &ar, const T&t){
|
||||
load_wrapper(ar,t,serialization::is_wrapper< T >());
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ namespace serialization {
|
||||
namespace archive {
|
||||
namespace detail{
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
|
||||
class BOOST_ARCHIVE_DECL basic_iserializer;
|
||||
class BOOST_ARCHIVE_DECL basic_pointer_iserializer;
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
@@ -166,10 +166,13 @@ private:
|
||||
virtual void load_end(const char * name){
|
||||
ArchiveImplementation::load_end(name);
|
||||
}
|
||||
|
||||
virtual void register_basic_serializer(const basic_iserializer & bis){
|
||||
ArchiveImplementation::register_basic_serializer(bis);
|
||||
}
|
||||
virtual helper_collection &
|
||||
get_helper_collection(){
|
||||
return ArchiveImplementation::get_helper_collection();
|
||||
}
|
||||
public:
|
||||
// this can't be inheriteded because they appear in mulitple
|
||||
// parents
|
||||
|
||||
@@ -39,8 +39,8 @@ namespace serialization {
|
||||
namespace archive {
|
||||
namespace detail{
|
||||
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
|
||||
class BOOST_ARCHIVE_DECL basic_oserializer;
|
||||
class BOOST_ARCHIVE_DECL basic_pointer_oserializer;
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
@@ -160,6 +160,10 @@ private:
|
||||
virtual void register_basic_serializer(const detail::basic_oserializer & bos){
|
||||
ArchiveImplementation::register_basic_serializer(bos);
|
||||
}
|
||||
virtual helper_collection &
|
||||
get_helper_collection(){
|
||||
return ArchiveImplementation::get_helper_collection();
|
||||
}
|
||||
public:
|
||||
// this can't be inheriteded because they appear in mulitple
|
||||
// parents
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace extra_detail { // anon
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(bool)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL bool
|
||||
archive_serializer_map<Archive>::insert(const basic_serializer * bs){
|
||||
return boost::serialization::singleton<
|
||||
extra_detail::map<Archive>
|
||||
@@ -45,7 +45,7 @@ archive_serializer_map<Archive>::insert(const basic_serializer * bs){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
archive_serializer_map<Archive>::erase(const basic_serializer * bs){
|
||||
if(boost::serialization::singleton<
|
||||
extra_detail::map<Archive>
|
||||
@@ -57,7 +57,7 @@ archive_serializer_map<Archive>::erase(const basic_serializer * bs){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(const basic_serializer *)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL const basic_serializer *
|
||||
archive_serializer_map<Archive>::find(
|
||||
const boost::serialization::extended_type_info & eti
|
||||
) {
|
||||
|
||||
@@ -32,11 +32,11 @@ namespace archive {
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// implementation of binary_binary_archive
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_binary_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_iarchive<Archive>::load_override(class_name_type & t){
|
||||
std::string cn;
|
||||
cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
|
||||
load_override(cn, 0);
|
||||
load_override(cn);
|
||||
if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::invalid_class_name)
|
||||
@@ -47,8 +47,8 @@ basic_binary_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_binary_iarchive<Archive>::init(){
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_iarchive<Archive>::init(void){
|
||||
// read signature in an archive version independent manner
|
||||
std::string file_signature;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace archive {
|
||||
// implementation of basic_binary_iprimitive
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>::init()
|
||||
{
|
||||
// Detect attempts to pass native binary archives across
|
||||
@@ -90,7 +90,7 @@ basic_binary_iprimitive<Archive, Elem, Tr>::init()
|
||||
}
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>::load(wchar_t * ws)
|
||||
{
|
||||
std::size_t l; // number of wchar_t !!!
|
||||
@@ -100,7 +100,7 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(wchar_t * ws)
|
||||
}
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>::load(std::string & s)
|
||||
{
|
||||
std::size_t l;
|
||||
@@ -117,7 +117,7 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(std::string & s)
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>::load(char * s)
|
||||
{
|
||||
std::size_t l;
|
||||
@@ -129,7 +129,7 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(char * s)
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>::load(std::wstring & ws)
|
||||
{
|
||||
std::size_t l;
|
||||
@@ -145,7 +145,7 @@ basic_binary_iprimitive<Archive, Elem, Tr>::load(std::wstring & ws)
|
||||
#endif
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>::basic_binary_iprimitive(
|
||||
std::basic_streambuf<Elem, Tr> & sb,
|
||||
bool no_codecvt
|
||||
@@ -194,7 +194,7 @@ class input_streambuf_access : public std::basic_streambuf<Elem, Tr> {
|
||||
// scoped_ptr requires that archive_locale be a complete type at time of
|
||||
// destruction so define destructor here rather than in the header
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_binary_iprimitive<Archive, Elem, Tr>::~basic_binary_iprimitive(){
|
||||
// push back unread characters
|
||||
//destructor can't throw !
|
||||
|
||||
@@ -28,11 +28,7 @@ namespace archive {
|
||||
// implementation of binary_binary_oarchive
|
||||
|
||||
template<class Archive>
|
||||
#if !defined(__BORLANDC__)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_oarchive<Archive>::init(){
|
||||
// write signature in an archive version independent manner
|
||||
const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace archive {
|
||||
// implementation of basic_binary_oprimitive
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>::init()
|
||||
{
|
||||
// record native sizes of fundamental types
|
||||
@@ -57,7 +57,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::init()
|
||||
}
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>::save(const char * s)
|
||||
{
|
||||
std::size_t l = std::strlen(s);
|
||||
@@ -66,7 +66,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save(const char * s)
|
||||
}
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::string &s)
|
||||
{
|
||||
std::size_t l = static_cast<std::size_t>(s.size());
|
||||
@@ -76,7 +76,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::string &s)
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>::save(const wchar_t * ws)
|
||||
{
|
||||
std::size_t l = std::wcslen(ws);
|
||||
@@ -87,7 +87,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save(const wchar_t * ws)
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::wstring &ws)
|
||||
{
|
||||
std::size_t l = ws.size();
|
||||
@@ -97,7 +97,7 @@ basic_binary_oprimitive<Archive, Elem, Tr>::save(const std::wstring &ws)
|
||||
#endif
|
||||
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>::basic_binary_oprimitive(
|
||||
std::basic_streambuf<Elem, Tr> & sb,
|
||||
bool no_codecvt
|
||||
@@ -146,7 +146,7 @@ class output_streambuf_access : public std::basic_streambuf<Elem, Tr> {
|
||||
// scoped_ptr requires that g be a complete type at time of
|
||||
// destruction so define destructor here rather than in the header
|
||||
template<class Archive, class Elem, class Tr>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_binary_oprimitive<Archive, Elem, Tr>::~basic_binary_oprimitive(){
|
||||
// flush buffer
|
||||
//destructor can't throw
|
||||
|
||||
@@ -29,11 +29,11 @@ namespace archive {
|
||||
// implementation of text_text_archive
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_text_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_text_iarchive<Archive>::load_override(class_name_type & t){
|
||||
std::string cn;
|
||||
cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
|
||||
load_override(cn, 0);
|
||||
load_override(cn);
|
||||
if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
|
||||
boost::serialization::throw_exception(
|
||||
archive_exception(archive_exception::invalid_class_name)
|
||||
@@ -44,7 +44,7 @@ basic_text_iarchive<Archive>::load_override(class_name_type & t, int){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_text_iarchive<Archive>::init(void){
|
||||
// read signature in an archive version independent manner
|
||||
std::string file_signature;
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace std{
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/archive/basic_text_iprimitive.hpp>
|
||||
#include <boost/archive/codecvt_null.hpp>
|
||||
@@ -53,7 +52,7 @@ namespace detail {
|
||||
// translate base64 text into binary and copy into buffer
|
||||
// until buffer is full.
|
||||
template<class IStream>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_text_iprimitive<IStream>::load_binary(
|
||||
void *address,
|
||||
std::size_t count
|
||||
@@ -87,11 +86,7 @@ basic_text_iprimitive<IStream>::load_binary(
|
||||
>
|
||||
binary;
|
||||
|
||||
binary i = binary(
|
||||
BOOST_MAKE_PFTO_WRAPPER(
|
||||
iterators::istream_iterator<CharType>(is)
|
||||
)
|
||||
);
|
||||
binary i = binary(iterators::istream_iterator<CharType>(is));
|
||||
|
||||
char * caddr = static_cast<char *>(address);
|
||||
|
||||
@@ -112,7 +107,7 @@ basic_text_iprimitive<IStream>::load_binary(
|
||||
}
|
||||
|
||||
template<class IStream>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_text_iprimitive<IStream>::basic_text_iprimitive(
|
||||
IStream &is_,
|
||||
bool no_codecvt
|
||||
@@ -142,7 +137,7 @@ basic_text_iprimitive<IStream>::basic_text_iprimitive(
|
||||
#endif
|
||||
|
||||
template<class IStream>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_text_iprimitive<IStream>::~basic_text_iprimitive(){
|
||||
is.sync();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace archive {
|
||||
// implementation of basic_text_oarchive
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_text_oarchive<Archive>::newtoken()
|
||||
{
|
||||
switch(delimiter){
|
||||
@@ -48,7 +48,7 @@ basic_text_oarchive<Archive>::newtoken()
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_text_oarchive<Archive>::init(){
|
||||
// write signature in an archive version independent manner
|
||||
const std::string file_signature(BOOST_ARCHIVE_SIGNATURE());
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
#include <cstddef> // NULL
|
||||
#include <algorithm> // std::copy
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/archive/basic_text_oprimitive.hpp>
|
||||
#include <boost/archive/codecvt_null.hpp>
|
||||
@@ -26,7 +25,7 @@ namespace archive {
|
||||
|
||||
// translate to base64 and copy in to buffer.
|
||||
template<class OStream>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_text_oprimitive<OStream>::save_binary(
|
||||
const void *address,
|
||||
std::size_t count
|
||||
@@ -59,9 +58,9 @@ basic_text_oprimitive<OStream>::save_binary(
|
||||
|
||||
boost::archive::iterators::ostream_iterator<CharType> oi(os);
|
||||
std::copy(
|
||||
base64_text(BOOST_MAKE_PFTO_WRAPPER(static_cast<const char *>(address))),
|
||||
base64_text(static_cast<const char *>(address)),
|
||||
base64_text(
|
||||
BOOST_MAKE_PFTO_WRAPPER(static_cast<const char *>(address) + count)
|
||||
static_cast<const char *>(address) + count
|
||||
),
|
||||
oi
|
||||
);
|
||||
@@ -75,7 +74,7 @@ basic_text_oprimitive<OStream>::save_binary(
|
||||
}
|
||||
|
||||
template<class OStream>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_text_oprimitive<OStream>::basic_text_oprimitive(
|
||||
OStream & os_,
|
||||
bool no_codecvt
|
||||
@@ -105,7 +104,7 @@ basic_text_oprimitive<OStream>::basic_text_oprimitive(
|
||||
#endif
|
||||
|
||||
template<class OStream>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_text_oprimitive<OStream>::~basic_text_oprimitive(){
|
||||
os << std::endl;
|
||||
}
|
||||
|
||||
@@ -72,14 +72,14 @@ public:
|
||||
friend struct return_values;
|
||||
|
||||
private:
|
||||
typedef BOOST_DEDUCED_TYPENAME std::basic_istream<CharType> IStream;
|
||||
typedef BOOST_DEDUCED_TYPENAME std::basic_string<CharType> StringType;
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::chset<CharType> chset_t;
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::chlit<CharType> chlit_t;
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::scanner<
|
||||
BOOST_DEDUCED_TYPENAME std::basic_string<CharType>::iterator
|
||||
typedef typename std::basic_istream<CharType> IStream;
|
||||
typedef typename std::basic_string<CharType> StringType;
|
||||
typedef typename boost::spirit::classic::chset<CharType> chset_t;
|
||||
typedef typename boost::spirit::classic::chlit<CharType> chlit_t;
|
||||
typedef typename boost::spirit::classic::scanner<
|
||||
typename std::basic_string<CharType>::iterator
|
||||
> scanner_t;
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::rule<scanner_t> rule_t;
|
||||
typedef typename boost::spirit::classic::rule<scanner_t> rule_t;
|
||||
// Start grammar definition
|
||||
rule_t
|
||||
Reference,
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace archive {
|
||||
// implementation of xml_text_archive
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_iarchive<Archive>::load_start(const char *name){
|
||||
// if there's no name
|
||||
if(NULL == name)
|
||||
@@ -41,7 +41,7 @@ basic_xml_iarchive<Archive>::load_start(const char *name){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_iarchive<Archive>::load_end(const char *name){
|
||||
// if there's no name
|
||||
if(NULL == name)
|
||||
@@ -77,37 +77,37 @@ basic_xml_iarchive<Archive>::load_end(const char *name){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_override(object_id_type & t, int){
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_iarchive<Archive>::load_override(object_id_type & t){
|
||||
t = object_id_type(this->This()->gimpl->rv.object_id);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_override(version_type & t, int){
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_iarchive<Archive>::load_override(version_type & t){
|
||||
t = version_type(this->This()->gimpl->rv.version);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_override(class_id_type & t, int){
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_iarchive<Archive>::load_override(class_id_type & t){
|
||||
t = class_id_type(this->This()->gimpl->rv.class_id);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_iarchive<Archive>::load_override(tracking_type & t, int){
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_iarchive<Archive>::load_override(tracking_type & t){
|
||||
t = this->This()->gimpl->rv.tracking_level;
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_xml_iarchive<Archive>::basic_xml_iarchive(unsigned int flags) :
|
||||
detail::common_iarchive<Archive>(flags),
|
||||
depth(0)
|
||||
{}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_xml_iarchive<Archive>::~basic_xml_iarchive(){}
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -58,7 +58,7 @@ struct XML_name {
|
||||
// implemenations of functions common to both types of xml output
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::write_attribute(
|
||||
const char *attribute_name,
|
||||
int t,
|
||||
@@ -72,7 +72,7 @@ basic_xml_oarchive<Archive>::write_attribute(
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::write_attribute(
|
||||
const char *attribute_name,
|
||||
const char *key
|
||||
@@ -85,7 +85,7 @@ basic_xml_oarchive<Archive>::write_attribute(
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::indent(){
|
||||
int i;
|
||||
for(i = depth; i-- > 0;)
|
||||
@@ -93,7 +93,7 @@ basic_xml_oarchive<Archive>::indent(){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_start(const char *name)
|
||||
{
|
||||
if(NULL == name)
|
||||
@@ -115,7 +115,7 @@ basic_xml_oarchive<Archive>::save_start(const char *name)
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_end(const char *name)
|
||||
{
|
||||
if(NULL == name)
|
||||
@@ -139,7 +139,7 @@ basic_xml_oarchive<Archive>::save_end(const char *name)
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::end_preamble(){
|
||||
if(pending_preamble){
|
||||
this->This()->put('>');
|
||||
@@ -148,14 +148,14 @@ basic_xml_oarchive<Archive>::end_preamble(){
|
||||
}
|
||||
#if 0
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const object_id_type & t, int)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(const object_id_type & t)
|
||||
{
|
||||
int i = t.t; // extra .t is for borland
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(
|
||||
const object_reference_type & t,
|
||||
int
|
||||
@@ -164,8 +164,8 @@ basic_xml_oarchive<Archive>::save_override(
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(const version_type & t)
|
||||
{
|
||||
int i = t.t; // extra .t is for borland
|
||||
write_attribute(BOOST_ARCHIVE_XML_VERSION(), i);
|
||||
@@ -173,55 +173,52 @@ basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const object_id_type & t, int)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(const object_id_type & t)
|
||||
{
|
||||
// borland doesn't do conversion of STRONG_TYPEDEFs very well
|
||||
const unsigned int i = t;
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(
|
||||
const object_reference_type & t,
|
||||
int
|
||||
const object_reference_type & t
|
||||
){
|
||||
const unsigned int i = t;
|
||||
write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_");
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const version_type & t, int)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(const version_type & t)
|
||||
{
|
||||
const unsigned int i = t;
|
||||
write_attribute(BOOST_ARCHIVE_XML_VERSION(), i);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const class_id_type & t, int)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(const class_id_type & t)
|
||||
{
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t);
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(
|
||||
const class_id_reference_type & t,
|
||||
int
|
||||
const class_id_reference_type & t
|
||||
){
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(), t);
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(
|
||||
const class_id_optional_type & t,
|
||||
int
|
||||
const class_id_optional_type & t
|
||||
){
|
||||
write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t);
|
||||
}
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const class_name_type & t, int)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(const class_name_type & t)
|
||||
{
|
||||
const char * key = t;
|
||||
if(NULL == key)
|
||||
@@ -230,14 +227,14 @@ basic_xml_oarchive<Archive>::save_override(const class_name_type & t, int)
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
basic_xml_oarchive<Archive>::save_override(const tracking_type & t, int)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::save_override(const tracking_type & t)
|
||||
{
|
||||
write_attribute(BOOST_ARCHIVE_XML_TRACKING(), t.t);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
|
||||
basic_xml_oarchive<Archive>::init(){
|
||||
// xml header
|
||||
this->This()->put("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n");
|
||||
@@ -250,7 +247,7 @@ basic_xml_oarchive<Archive>::init(){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_xml_oarchive<Archive>::basic_xml_oarchive(unsigned int flags) :
|
||||
detail::common_oarchive<Archive>(flags),
|
||||
depth(0),
|
||||
@@ -260,7 +257,7 @@ basic_xml_oarchive<Archive>::basic_xml_oarchive(unsigned int flags) :
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_OR_WARCHIVE_DECL
|
||||
basic_xml_oarchive<Archive>::~basic_xml_oarchive(){
|
||||
if(0 == (this->get_flags() & no_header)){
|
||||
BOOST_TRY{
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace boost {
|
||||
namespace archive {
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_iarchive_impl<Archive>::load(char *s)
|
||||
{
|
||||
std::size_t size;
|
||||
@@ -41,7 +41,7 @@ text_iarchive_impl<Archive>::load(char *s)
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_iarchive_impl<Archive>::load(std::string &s)
|
||||
{
|
||||
std::size_t size;
|
||||
@@ -60,7 +60,7 @@ text_iarchive_impl<Archive>::load(std::string &s)
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_iarchive_impl<Archive>::load(wchar_t *ws)
|
||||
{
|
||||
std::size_t size;
|
||||
@@ -74,7 +74,7 @@ text_iarchive_impl<Archive>::load(wchar_t *ws)
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_iarchive_impl<Archive>::load(std::wstring &ws)
|
||||
{
|
||||
std::size_t size;
|
||||
@@ -93,19 +93,19 @@ text_iarchive_impl<Archive>::load(std::wstring &ws)
|
||||
#endif // BOOST_NO_CWCHAR
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
text_iarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
basic_text_iarchive<Archive>::load_override(t, 0);
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_iarchive_impl<Archive>::load_override(class_name_type & t){
|
||||
basic_text_iarchive<Archive>::load_override(t);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_iarchive_impl<Archive>::init(){
|
||||
basic_text_iarchive<Archive>::init();
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
text_iarchive_impl<Archive>::text_iarchive_impl(
|
||||
std::istream & is,
|
||||
unsigned int flags
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace archive {
|
||||
// of template parameters used to create a text_oprimitive
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_oarchive_impl<Archive>::save(const char * s)
|
||||
{
|
||||
const std::size_t len = std::ostream::traits_type::length(s);
|
||||
@@ -48,7 +48,7 @@ text_oarchive_impl<Archive>::save(const char * s)
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_oarchive_impl<Archive>::save(const std::string &s)
|
||||
{
|
||||
const std::size_t size = s.size();
|
||||
@@ -60,7 +60,7 @@ text_oarchive_impl<Archive>::save(const std::string &s)
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_oarchive_impl<Archive>::save(const wchar_t * ws)
|
||||
{
|
||||
const std::size_t l = std::wcslen(ws);
|
||||
@@ -72,7 +72,7 @@ text_oarchive_impl<Archive>::save(const wchar_t * ws)
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_oarchive_impl<Archive>::save(const std::wstring &ws)
|
||||
{
|
||||
const std::size_t l = ws.size();
|
||||
@@ -84,7 +84,7 @@ text_oarchive_impl<Archive>::save(const std::wstring &ws)
|
||||
#endif // BOOST_NO_CWCHAR
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
text_oarchive_impl<Archive>::text_oarchive_impl(
|
||||
std::ostream & os,
|
||||
unsigned int flags
|
||||
@@ -104,7 +104,7 @@ text_oarchive_impl<Archive>::text_oarchive_impl(
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
text_oarchive_impl<Archive>::save_binary(const void *address, std::size_t count){
|
||||
put('\n');
|
||||
this->end_preamble();
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace archive {
|
||||
// implementation of wiprimtives functions
|
||||
//
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
text_wiarchive_impl<Archive>::load(char *s)
|
||||
{
|
||||
std::size_t size;
|
||||
@@ -43,7 +43,7 @@ text_wiarchive_impl<Archive>::load(char *s)
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
text_wiarchive_impl<Archive>::load(std::string &s)
|
||||
{
|
||||
std::size_t size;
|
||||
@@ -63,7 +63,7 @@ text_wiarchive_impl<Archive>::load(std::string &s)
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
text_wiarchive_impl<Archive>::load(wchar_t *s)
|
||||
{
|
||||
std::size_t size;
|
||||
@@ -78,7 +78,7 @@ text_wiarchive_impl<Archive>::load(wchar_t *s)
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
text_wiarchive_impl<Archive>::load(std::wstring &ws)
|
||||
{
|
||||
std::size_t size;
|
||||
@@ -97,7 +97,7 @@ text_wiarchive_impl<Archive>::load(std::wstring &ws)
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
text_wiarchive_impl<Archive>::text_wiarchive_impl(
|
||||
std::wistream & is,
|
||||
unsigned int flags
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace archive {
|
||||
// implementation of woarchive functions
|
||||
//
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
text_woarchive_impl<Archive>::save(const char *s)
|
||||
{
|
||||
// note: superfluous local variable fixes borland warning
|
||||
@@ -43,7 +43,7 @@ text_woarchive_impl<Archive>::save(const char *s)
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
text_woarchive_impl<Archive>::save(const std::string &s)
|
||||
{
|
||||
const std::size_t size = s.size();
|
||||
@@ -56,7 +56,7 @@ text_woarchive_impl<Archive>::save(const std::string &s)
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
text_woarchive_impl<Archive>::save(const wchar_t *ws)
|
||||
{
|
||||
const std::size_t size = std::wostream::traits_type::length(ws);
|
||||
@@ -68,7 +68,7 @@ text_woarchive_impl<Archive>::save(const wchar_t *ws)
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
text_woarchive_impl<Archive>::save(const std::wstring &ws)
|
||||
{
|
||||
const std::size_t size = ws.length();
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace archive {
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_iarchive_impl<Archive>::load(std::wstring &ws){
|
||||
std::string s;
|
||||
bool result = gimpl->parse_string(is, s);
|
||||
@@ -85,7 +85,7 @@ xml_iarchive_impl<Archive>::load(std::wstring &ws){
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_iarchive_impl<Archive>::load(wchar_t * ws){
|
||||
std::string s;
|
||||
bool result = gimpl->parse_string(is, s);
|
||||
@@ -117,7 +117,7 @@ xml_iarchive_impl<Archive>::load(wchar_t * ws){
|
||||
#endif // BOOST_NO_CWCHAR
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_iarchive_impl<Archive>::load(std::string &s){
|
||||
bool result = gimpl->parse_string(is, s);
|
||||
if(! result)
|
||||
@@ -127,7 +127,7 @@ xml_iarchive_impl<Archive>::load(std::string &s){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_iarchive_impl<Archive>::load(char * s){
|
||||
std::string tstring;
|
||||
bool result = gimpl->parse_string(is, tstring);
|
||||
@@ -140,8 +140,8 @@ xml_iarchive_impl<Archive>::load(char * s){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
xml_iarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_iarchive_impl<Archive>::load_override(class_name_type & t){
|
||||
const std::string & s = gimpl->rv.class_name;
|
||||
if(s.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)
|
||||
boost::serialization::throw_exception(
|
||||
@@ -153,7 +153,7 @@ xml_iarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_iarchive_impl<Archive>::init(){
|
||||
gimpl->init(is);
|
||||
this->set_library_version(
|
||||
@@ -162,7 +162,7 @@ xml_iarchive_impl<Archive>::init(){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
xml_iarchive_impl<Archive>::xml_iarchive_impl(
|
||||
std::istream &is_,
|
||||
unsigned int flags
|
||||
@@ -179,7 +179,7 @@ xml_iarchive_impl<Archive>::xml_iarchive_impl(
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
xml_iarchive_impl<Archive>::~xml_iarchive_impl(){
|
||||
if(0 == (this->get_flags() & no_header)){
|
||||
BOOST_TRY{
|
||||
|
||||
@@ -42,15 +42,15 @@ void save_iterator(std::ostream &os, InputIterator begin, InputIterator end){
|
||||
boost::archive::iterators::xml_escape<InputIterator>
|
||||
> translator;
|
||||
std::copy(
|
||||
translator(BOOST_MAKE_PFTO_WRAPPER(begin)),
|
||||
translator(BOOST_MAKE_PFTO_WRAPPER(end)),
|
||||
translator(begin),
|
||||
translator(end),
|
||||
boost::archive::iterators::ostream_iterator<char>(os)
|
||||
);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_oarchive_impl<Archive>::save(const std::wstring & ws){
|
||||
// at least one library doesn't typedef value_type for strings
|
||||
// so rather than using string directly make a pointer iterator out of it
|
||||
@@ -61,7 +61,7 @@ xml_oarchive_impl<Archive>::save(const std::wstring & ws){
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_oarchive_impl<Archive>::save(const wchar_t * ws){
|
||||
save_iterator(os, ws, ws + std::wcslen(ws));
|
||||
}
|
||||
@@ -70,7 +70,7 @@ xml_oarchive_impl<Archive>::save(const wchar_t * ws){
|
||||
#endif // BOOST_NO_CWCHAR
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_oarchive_impl<Archive>::save(const std::string & s){
|
||||
// at least one library doesn't typedef value_type for strings
|
||||
// so rather than using string directly make a pointer iterator out of it
|
||||
@@ -78,27 +78,27 @@ xml_oarchive_impl<Archive>::save(const std::string & s){
|
||||
const char *
|
||||
> xml_escape_translator;
|
||||
std::copy(
|
||||
xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s.data())),
|
||||
xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s.data()+ s.size())),
|
||||
xml_escape_translator(s.data()),
|
||||
xml_escape_translator(s.data()+ s.size()),
|
||||
boost::archive::iterators::ostream_iterator<char>(os)
|
||||
);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
xml_oarchive_impl<Archive>::save(const char * s){
|
||||
typedef boost::archive::iterators::xml_escape<
|
||||
const char *
|
||||
> xml_escape_translator;
|
||||
std::copy(
|
||||
xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s)),
|
||||
xml_escape_translator(BOOST_MAKE_PFTO_WRAPPER(s + std::strlen(s))),
|
||||
xml_escape_translator(s),
|
||||
xml_escape_translator(s + std::strlen(s)),
|
||||
boost::archive::iterators::ostream_iterator<char>(os)
|
||||
);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
xml_oarchive_impl<Archive>::xml_oarchive_impl(
|
||||
std::ostream & os_,
|
||||
unsigned int flags
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace std{
|
||||
|
||||
#include <boost/io/ios_state.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/serialization/string.hpp>
|
||||
|
||||
#include <boost/archive/basic_xml_archive.hpp>
|
||||
@@ -52,10 +51,10 @@ namespace { // anonymous
|
||||
void copy_to_ptr(char * s, const std::wstring & ws){
|
||||
std::copy(
|
||||
iterators::mb_from_wchar<std::wstring::const_iterator>(
|
||||
BOOST_MAKE_PFTO_WRAPPER(ws.begin())
|
||||
ws.begin()
|
||||
),
|
||||
iterators::mb_from_wchar<std::wstring::const_iterator>(
|
||||
BOOST_MAKE_PFTO_WRAPPER(ws.end())
|
||||
ws.end()
|
||||
),
|
||||
s
|
||||
);
|
||||
@@ -65,7 +64,7 @@ void copy_to_ptr(char * s, const std::wstring & ws){
|
||||
} // anonymous
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_wiarchive_impl<Archive>::load(std::string & s){
|
||||
std::wstring ws;
|
||||
bool result = gimpl->parse_string(is, ws);
|
||||
@@ -80,10 +79,10 @@ xml_wiarchive_impl<Archive>::load(std::string & s){
|
||||
s.reserve(ws.size());
|
||||
std::copy(
|
||||
iterators::mb_from_wchar<std::wstring::iterator>(
|
||||
BOOST_MAKE_PFTO_WRAPPER(ws.begin())
|
||||
ws.begin()
|
||||
),
|
||||
iterators::mb_from_wchar<std::wstring::iterator>(
|
||||
BOOST_MAKE_PFTO_WRAPPER(ws.end())
|
||||
ws.end()
|
||||
),
|
||||
std::back_inserter(s)
|
||||
);
|
||||
@@ -91,7 +90,7 @@ xml_wiarchive_impl<Archive>::load(std::string & s){
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_wiarchive_impl<Archive>::load(std::wstring & ws){
|
||||
bool result = gimpl->parse_string(is, ws);
|
||||
if(! result)
|
||||
@@ -102,7 +101,7 @@ xml_wiarchive_impl<Archive>::load(std::wstring & ws){
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_wiarchive_impl<Archive>::load(char * s){
|
||||
std::wstring ws;
|
||||
bool result = gimpl->parse_string(is, ws);
|
||||
@@ -115,7 +114,7 @@ xml_wiarchive_impl<Archive>::load(char * s){
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_wiarchive_impl<Archive>::load(wchar_t * ws){
|
||||
std::wstring twstring;
|
||||
bool result = gimpl->parse_string(is, twstring);
|
||||
@@ -129,8 +128,8 @@ xml_wiarchive_impl<Archive>::load(wchar_t * ws){
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
xml_wiarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_wiarchive_impl<Archive>::load_override(class_name_type & t){
|
||||
const std::wstring & ws = gimpl->rv.class_name;
|
||||
if(ws.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)
|
||||
boost::serialization::throw_exception(
|
||||
@@ -140,7 +139,7 @@ xml_wiarchive_impl<Archive>::load_override(class_name_type & t, int){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_wiarchive_impl<Archive>::init(){
|
||||
gimpl->init(is);
|
||||
this->set_library_version(
|
||||
@@ -149,7 +148,7 @@ xml_wiarchive_impl<Archive>::init(){
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
|
||||
std::wistream &is_,
|
||||
unsigned int flags
|
||||
@@ -177,7 +176,7 @@ xml_wiarchive_impl<Archive>::xml_wiarchive_impl(
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
xml_wiarchive_impl<Archive>::~xml_wiarchive_impl(){
|
||||
if(0 == (this->get_flags() & no_header)){
|
||||
BOOST_TRY{
|
||||
|
||||
@@ -52,14 +52,14 @@ void save_iterator(std::wostream &os, InputIterator begin, InputIterator end){
|
||||
iterators::xml_escape<InputIterator>
|
||||
> xmbtows;
|
||||
std::copy(
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(begin)),
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(end)),
|
||||
xmbtows(begin),
|
||||
xmbtows(end),
|
||||
boost::archive::iterators::ostream_iterator<wchar_t>(os)
|
||||
);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_woarchive_impl<Archive>::save(const std::string & s){
|
||||
// note: we don't use s.begin() and s.end() because dinkumware
|
||||
// doesn't have string::value_type defined. So use a wrapper
|
||||
@@ -71,47 +71,47 @@ xml_woarchive_impl<Archive>::save(const std::string & s){
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_woarchive_impl<Archive>::save(const std::wstring & ws){
|
||||
#if 0
|
||||
typedef iterators::xml_escape<std::wstring::const_iterator> xmbtows;
|
||||
std::copy(
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.begin())),
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.end())),
|
||||
xmbtows(ws.begin()),
|
||||
xmbtows(ws.end()),
|
||||
boost::archive::iterators::ostream_iterator<wchar_t>(os)
|
||||
);
|
||||
#endif
|
||||
typedef iterators::xml_escape<const wchar_t *> xmbtows;
|
||||
std::copy(
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data())),
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data() + ws.size())),
|
||||
xmbtows(ws.data()),
|
||||
xmbtows(ws.data() + ws.size()),
|
||||
boost::archive::iterators::ostream_iterator<wchar_t>(os)
|
||||
);
|
||||
}
|
||||
#endif //BOOST_NO_STD_WSTRING
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_woarchive_impl<Archive>::save(const char * s){
|
||||
save_iterator(os, s, s + std::strlen(s));
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
xml_woarchive_impl<Archive>::save(const wchar_t * ws){
|
||||
os << ws;
|
||||
typedef iterators::xml_escape<const wchar_t *> xmbtows;
|
||||
std::copy(
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws)),
|
||||
xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws + std::wcslen(ws))),
|
||||
xmbtows(ws),
|
||||
xmbtows(ws + std::wcslen(ws)),
|
||||
boost::archive::iterators::ostream_iterator<wchar_t>(os)
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
xml_woarchive_impl<Archive>::xml_woarchive_impl(
|
||||
std::wostream & os_,
|
||||
unsigned int flags
|
||||
@@ -141,7 +141,7 @@ xml_woarchive_impl<Archive>::xml_woarchive_impl(
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
xml_woarchive_impl<Archive>::~xml_woarchive_impl(){
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/transform_iterator.hpp>
|
||||
#include <boost/archive/iterators/dataflow_exception.hpp>
|
||||
|
||||
@@ -88,9 +86,9 @@ class base64_from_binary :
|
||||
public:
|
||||
// make composible buy using templated constructor
|
||||
template<class T>
|
||||
base64_from_binary(BOOST_PFTO_WRAPPER(T) start) :
|
||||
base64_from_binary(T start) :
|
||||
super_t(
|
||||
Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))),
|
||||
Base(static_cast< T >(start)),
|
||||
detail::from_6_bit<CharType>()
|
||||
)
|
||||
{}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
#include <boost/iterator/transform_iterator.hpp>
|
||||
@@ -96,9 +95,9 @@ class binary_from_base64 : public
|
||||
public:
|
||||
// make composible buy using templated constructor
|
||||
template<class T>
|
||||
binary_from_base64(BOOST_PFTO_WRAPPER(T) start) :
|
||||
binary_from_base64(T start) :
|
||||
super_t(
|
||||
Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))),
|
||||
Base(static_cast< T >(start)),
|
||||
detail::to_6_bit<CharType>()
|
||||
)
|
||||
{}
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
namespace std{ using ::memcpy; }
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
|
||||
@@ -83,8 +81,8 @@ private:
|
||||
public:
|
||||
// make composible buy using templated constructor
|
||||
template<class T>
|
||||
insert_linebreaks(BOOST_PFTO_WRAPPER(T) start) :
|
||||
super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
|
||||
insert_linebreaks(T start) :
|
||||
super_t(Base(static_cast< T >(start))),
|
||||
m_count(0)
|
||||
{}
|
||||
// intel 7.1 doesn't like default copy constructor
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
|
||||
namespace boost {
|
||||
@@ -86,7 +85,7 @@ class mb_from_wchar
|
||||
wchar_t value = * this->base_reference();
|
||||
#if (defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 3) \
|
||||
|| ((__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION >= 8))))
|
||||
m_bend = std::wcrtomb(m_buffer, value, 0);
|
||||
m_bend = std::wcrtomb(m_buffer, value,0);
|
||||
#else
|
||||
m_bend = std::wctomb(m_buffer, value);
|
||||
#endif
|
||||
@@ -114,8 +113,8 @@ class mb_from_wchar
|
||||
public:
|
||||
// make composible buy using templated constructor
|
||||
template<class T>
|
||||
mb_from_wchar(BOOST_PFTO_WRAPPER(T) start) :
|
||||
super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
|
||||
mb_from_wchar(T start) :
|
||||
super_t(Base(static_cast< T >(start))),
|
||||
m_bend(0),
|
||||
m_bnext(0),
|
||||
m_full(false)
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/iterator/filter_iterator.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
@@ -153,8 +151,8 @@ public:
|
||||
// remove_whitespace(){} // why is this needed?
|
||||
// make composible buy using templated constructor
|
||||
template<class T>
|
||||
remove_whitespace(BOOST_PFTO_WRAPPER(T) start) :
|
||||
super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))))
|
||||
remove_whitespace(T start) :
|
||||
super_t(Base(static_cast< T >(start)))
|
||||
{}
|
||||
// intel 7.1 doesn't like default copy constructor
|
||||
remove_whitespace(const remove_whitespace & rhs) :
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
// character and 8 bit bytes. Lowest common multiple is 24 => 4 6 bit characters
|
||||
// or 3 8 bit characters
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
|
||||
@@ -110,8 +108,8 @@ class transform_width :
|
||||
public:
|
||||
// make composible buy using templated constructor
|
||||
template<class T>
|
||||
transform_width(BOOST_PFTO_WRAPPER(T) start) :
|
||||
super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
|
||||
transform_width(T start) :
|
||||
super_t(Base(static_cast< T >(start))),
|
||||
m_buffer_out_full(false),
|
||||
// To disable GCC warning, but not truly necessary
|
||||
//(m_buffer_in will be initialized later before being
|
||||
@@ -154,7 +152,7 @@ void transform_width<Base, BitsOut, BitsIn, CharType>::fill() {
|
||||
|
||||
// append these bits to the next output
|
||||
// up to the size of the output
|
||||
unsigned int i = std::min(missing_bits, m_remaining_bits);
|
||||
unsigned int i = (std::min)(missing_bits, m_remaining_bits);
|
||||
// shift interesting bits to least significant position
|
||||
base_value_type j = m_buffer_in >> (m_remaining_bits - i);
|
||||
// and mask off the un interesting higher bits
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace std{
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_adaptor.hpp>
|
||||
#include <boost/archive/iterators/dataflow_exception.hpp>
|
||||
@@ -89,8 +88,8 @@ class wchar_from_mb
|
||||
public:
|
||||
// make composible buy using templated constructor
|
||||
template<class T>
|
||||
wchar_from_mb(BOOST_PFTO_WRAPPER(T) start) :
|
||||
super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))),
|
||||
wchar_from_mb(T start) :
|
||||
super_t(Base(static_cast< T >(start))),
|
||||
m_full(false)
|
||||
{}
|
||||
// intel 7.1 doesn't like default copy constructor
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/archive/iterators/escape.hpp>
|
||||
|
||||
namespace boost {
|
||||
@@ -40,8 +39,8 @@ public:
|
||||
wchar_t fill(const wchar_t * & bstart, const wchar_t * & bend);
|
||||
|
||||
template<class T>
|
||||
xml_escape(BOOST_PFTO_WRAPPER(T) start) :
|
||||
super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))))
|
||||
xml_escape(T start) :
|
||||
super_t(Base(static_cast< T >(start)))
|
||||
{}
|
||||
// intel 7.1 doesn't like default copy constructor
|
||||
xml_escape(const xml_escape & rhs) :
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <boost/serialization/throw_exception.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
#include <boost/archive/iterators/unescape.hpp>
|
||||
#include <boost/archive/iterators/dataflow_exception.hpp>
|
||||
@@ -54,8 +53,8 @@ public:
|
||||
value_type drain();
|
||||
|
||||
template<class T>
|
||||
xml_unescape(BOOST_PFTO_WRAPPER(T) start) :
|
||||
super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))))
|
||||
xml_unescape(T start) :
|
||||
super_t(Base(static_cast< T >(start)))
|
||||
{}
|
||||
// intel 7.1 doesn't like default copy constructor
|
||||
xml_unescape(const xml_unescape & rhs) :
|
||||
|
||||
@@ -29,7 +29,6 @@ namespace std{
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/archive/detail/iserializer.hpp>
|
||||
#include <boost/archive/detail/interface_iarchive.hpp>
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
@@ -44,13 +43,13 @@ namespace serialization {
|
||||
} // namespace serialization
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive;
|
||||
class BOOST_ARCHIVE_DECL basic_iarchive;
|
||||
class BOOST_ARCHIVE_DECL basic_iarchive;
|
||||
}
|
||||
|
||||
class polymorphic_iarchive;
|
||||
|
||||
class polymorphic_iarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE polymorphic_iarchive_impl :
|
||||
public detail::interface_iarchive<polymorphic_iarchive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -98,22 +97,19 @@ public:
|
||||
virtual void load_start(const char * name) = 0;
|
||||
virtual void load_end(const char * name) = 0;
|
||||
virtual void register_basic_serializer(const detail::basic_iserializer & bis) = 0;
|
||||
virtual detail::helper_collection & get_helper_collection() = 0;
|
||||
|
||||
// msvc and borland won't automatically pass these to the base class so
|
||||
// make it explicit here
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int)
|
||||
void load_override(T & t)
|
||||
{
|
||||
archive::load(* this->This(), t);
|
||||
}
|
||||
// special treatment for name-value pairs.
|
||||
template<class T>
|
||||
void load_override(
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
const
|
||||
#endif
|
||||
boost::serialization::nvp< T > & t,
|
||||
int
|
||||
const boost::serialization::nvp< T > & t
|
||||
){
|
||||
load_start(t.name());
|
||||
archive::load(* this->This(), t.value());
|
||||
@@ -156,7 +152,7 @@ public:
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class polymorphic_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE polymorphic_iarchive :
|
||||
public polymorphic_iarchive_impl
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace std{
|
||||
#endif
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
#include <boost/archive/detail/oserializer.hpp>
|
||||
#include <boost/archive/detail/interface_oarchive.hpp>
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
@@ -43,13 +42,13 @@ namespace serialization {
|
||||
} // namespace serialization
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive;
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer;
|
||||
class BOOST_ARCHIVE_DECL basic_oarchive;
|
||||
class BOOST_ARCHIVE_DECL basic_oserializer;
|
||||
}
|
||||
|
||||
class polymorphic_oarchive;
|
||||
|
||||
class polymorphic_oarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE polymorphic_oarchive_impl :
|
||||
public detail::interface_oarchive<polymorphic_oarchive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -98,23 +97,21 @@ public:
|
||||
virtual void save_start(const char * name) = 0;
|
||||
virtual void save_end(const char * name) = 0;
|
||||
virtual void register_basic_serializer(const detail::basic_oserializer & bos) = 0;
|
||||
virtual detail::helper_collection & get_helper_collection() = 0;
|
||||
|
||||
virtual void end_preamble() = 0;
|
||||
|
||||
// msvc and borland won't automatically pass these to the base class so
|
||||
// make it explicit here
|
||||
template<class T>
|
||||
void save_override(T & t, BOOST_PFTO int)
|
||||
void save_override(T & t)
|
||||
{
|
||||
archive::save(* this->This(), t);
|
||||
}
|
||||
// special treatment for name-value pairs.
|
||||
template<class T>
|
||||
void save_override(
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
const
|
||||
#endif
|
||||
::boost::serialization::nvp< T > & t, int
|
||||
const ::boost::serialization::nvp< T > & t
|
||||
){
|
||||
save_start(t.name());
|
||||
archive::save(* this->This(), t.const_value());
|
||||
@@ -139,7 +136,7 @@ public:
|
||||
};
|
||||
|
||||
// note: preserve naming symmetry
|
||||
class polymorphic_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE polymorphic_oarchive :
|
||||
public polymorphic_oarchive_impl
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace detail {
|
||||
} // namespace detail
|
||||
|
||||
template<class Archive>
|
||||
class text_iarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE text_iarchive_impl :
|
||||
public basic_text_iprimitive<std::istream>,
|
||||
public basic_text_iarchive<Archive>
|
||||
{
|
||||
@@ -72,33 +72,30 @@ protected:
|
||||
load(v);
|
||||
t = boost::serialization::item_version_type(v);
|
||||
}
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(wchar_t * t);
|
||||
#endif
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
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 !!!
|
||||
// make this protected so it can be called from a derived archive
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
basic_text_iarchive<Archive>::load_override(t, 0);
|
||||
void load_override(T & t){
|
||||
basic_text_iarchive<Archive>::load_override(t);
|
||||
}
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
load_override(class_name_type & t, int);
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load_override(class_name_type & t);
|
||||
BOOST_ARCHIVE_DECL void
|
||||
init();
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
text_iarchive_impl(std::istream & is, unsigned int flags);
|
||||
// don't import inline definitions! leave this as a reminder.
|
||||
//BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
//BOOST_ARCHIVE_DECL
|
||||
~text_iarchive_impl(){};
|
||||
};
|
||||
|
||||
@@ -119,7 +116,7 @@ protected:
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class text_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE text_iarchive :
|
||||
public text_iarchive_impl<text_iarchive>{
|
||||
public:
|
||||
text_iarchive(std::istream & is_, unsigned int flags = 0) :
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace detail {
|
||||
} // namespace detail
|
||||
|
||||
template<class Archive>
|
||||
class text_oarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE text_oarchive_impl :
|
||||
/* protected ? */ public basic_text_oprimitive<std::ostream>,
|
||||
public basic_text_oarchive<Archive>
|
||||
{
|
||||
@@ -78,32 +78,32 @@ protected:
|
||||
void save(const boost::serialization::item_version_type & t){
|
||||
save(static_cast<const unsigned int>(t));
|
||||
}
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const wchar_t * t);
|
||||
#endif
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const std::wstring &ws);
|
||||
#endif
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
text_oarchive_impl(std::ostream & os, unsigned int flags);
|
||||
// don't import inline definitions! leave this as a reminder.
|
||||
//BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
//BOOST_ARCHIVE_DECL
|
||||
~text_oarchive_impl(){};
|
||||
public:
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save_binary(const void *address, std::size_t count);
|
||||
};
|
||||
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from text_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class text_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE text_oarchive :
|
||||
public text_oarchive_impl<text_oarchive>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace detail {
|
||||
} // namespace detail
|
||||
|
||||
template<class Archive>
|
||||
class text_wiarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE text_wiarchive_impl :
|
||||
public basic_text_iprimitive<std::wistream>,
|
||||
public basic_text_iarchive<Archive>
|
||||
{
|
||||
@@ -76,25 +76,23 @@ protected:
|
||||
load(v);
|
||||
t = boost::serialization::item_version_type(v);
|
||||
}
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(wchar_t * t);
|
||||
#endif
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
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 !!!
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
basic_text_iarchive<Archive>::load_override(t, 0);
|
||||
void load_override(T & t){
|
||||
basic_text_iarchive<Archive>::load_override(t);
|
||||
}
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
text_wiarchive_impl(std::wistream & is, unsigned int flags);
|
||||
~text_wiarchive_impl(){};
|
||||
};
|
||||
@@ -116,7 +114,7 @@ protected:
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class text_wiarchive :
|
||||
class BOOST_SYMBOL_VISIBLE text_wiarchive :
|
||||
public text_wiarchive_impl<text_wiarchive>{
|
||||
public:
|
||||
text_wiarchive(std::wistream & is, unsigned int flags = 0) :
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace detail {
|
||||
} // namespace detail
|
||||
|
||||
template<class Archive>
|
||||
class text_woarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE text_woarchive_impl :
|
||||
public basic_text_oprimitive<std::wostream>,
|
||||
public basic_text_oarchive<Archive>
|
||||
{
|
||||
@@ -83,16 +83,16 @@ protected:
|
||||
void save(const boost::serialization::item_version_type & t){
|
||||
save(static_cast<const unsigned int>(t));
|
||||
}
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
save(const char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
save(const wchar_t * t);
|
||||
#endif
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
save(const std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
save(const std::wstring &ws);
|
||||
#endif
|
||||
text_woarchive_impl(std::wostream & os, unsigned int flags) :
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from text_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class text_woarchive :
|
||||
class BOOST_SYMBOL_VISIBLE text_woarchive :
|
||||
public text_woarchive_impl<text_woarchive>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/archive/detail/decl.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
@@ -32,7 +31,7 @@ namespace archive {
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// exceptions thrown by xml archives
|
||||
//
|
||||
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) xml_archive_exception :
|
||||
class BOOST_SYMBOL_VISIBLE xml_archive_exception :
|
||||
public virtual boost::archive::archive_exception
|
||||
{
|
||||
public:
|
||||
@@ -41,7 +40,7 @@ public:
|
||||
xml_archive_tag_mismatch,
|
||||
xml_archive_tag_name_error
|
||||
} exception_code;
|
||||
xml_archive_exception(
|
||||
BOOST_ARCHIVE_DECL xml_archive_exception(
|
||||
exception_code c,
|
||||
const char * e1 = NULL,
|
||||
const char * e2 = NULL
|
||||
|
||||
@@ -44,7 +44,7 @@ class basic_xml_grammar;
|
||||
typedef basic_xml_grammar<char> xml_grammar;
|
||||
|
||||
template<class Archive>
|
||||
class xml_iarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE xml_iarchive_impl :
|
||||
public basic_text_iprimitive<std::istream>,
|
||||
public basic_xml_iarchive<Archive>
|
||||
{
|
||||
@@ -86,29 +86,29 @@ protected:
|
||||
load(v);
|
||||
t = boost::serialization::item_version_type(v);
|
||||
}
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(wchar_t * t);
|
||||
#endif
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
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(T & t){
|
||||
basic_xml_iarchive<Archive>::load_override(t);
|
||||
}
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
load_override(class_name_type & t, int);
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load_override(class_name_type & t);
|
||||
BOOST_ARCHIVE_DECL void
|
||||
init();
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
xml_iarchive_impl(std::istream & is, unsigned int flags);
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
~xml_iarchive_impl();
|
||||
};
|
||||
|
||||
@@ -128,7 +128,7 @@ protected:
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class xml_iarchive :
|
||||
class BOOST_SYMBOL_VISIBLE xml_iarchive :
|
||||
public xml_iarchive_impl<xml_iarchive>{
|
||||
public:
|
||||
xml_iarchive(std::istream & is, unsigned int flags = 0) :
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace detail {
|
||||
} // namespace detail
|
||||
|
||||
template<class Archive>
|
||||
class xml_oarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE xml_oarchive_impl :
|
||||
public basic_text_oprimitive<std::ostream>,
|
||||
public basic_xml_oarchive<Archive>
|
||||
{
|
||||
@@ -82,19 +82,19 @@ protected:
|
||||
save(const boost::serialization::item_version_type & t){
|
||||
save(static_cast<const unsigned int>(t));
|
||||
}
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const wchar_t * t);
|
||||
#endif
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_ARCHIVE_DECL(void)
|
||||
BOOST_ARCHIVE_DECL void
|
||||
save(const std::wstring &ws);
|
||||
#endif
|
||||
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_ARCHIVE_DECL
|
||||
xml_oarchive_impl(std::ostream & os, unsigned int flags);
|
||||
~xml_oarchive_impl(){}
|
||||
public:
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from xml_oarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class xml_oarchive :
|
||||
class BOOST_SYMBOL_VISIBLE xml_oarchive :
|
||||
public xml_oarchive_impl<xml_oarchive>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -58,7 +58,7 @@ class basic_xml_grammar;
|
||||
typedef basic_xml_grammar<wchar_t> xml_wgrammar;
|
||||
|
||||
template<class Archive>
|
||||
class xml_wiarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE xml_wiarchive_impl :
|
||||
public basic_text_iprimitive<std::wistream>,
|
||||
public basic_xml_iarchive<Archive>
|
||||
{
|
||||
@@ -99,29 +99,29 @@ protected:
|
||||
load(v);
|
||||
t = boost::serialization::item_version_type(v);
|
||||
}
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(wchar_t * t);
|
||||
#endif
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load(std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
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(T & t){
|
||||
basic_xml_iarchive<Archive>::load_override(t);
|
||||
}
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
load_override(class_name_type & t, int);
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
load_override(class_name_type & t);
|
||||
BOOST_WARCHIVE_DECL void
|
||||
init();
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
xml_wiarchive_impl(std::wistream & is, unsigned int flags) ;
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
~xml_wiarchive_impl();
|
||||
};
|
||||
|
||||
@@ -142,7 +142,7 @@ protected:
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class xml_wiarchive :
|
||||
class BOOST_SYMBOL_VISIBLE xml_wiarchive :
|
||||
public xml_wiarchive_impl<xml_wiarchive>{
|
||||
public:
|
||||
xml_wiarchive(std::wistream & is, unsigned int flags = 0) :
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace detail {
|
||||
} // namespace detail
|
||||
|
||||
template<class Archive>
|
||||
class xml_woarchive_impl :
|
||||
class BOOST_SYMBOL_VISIBLE xml_woarchive_impl :
|
||||
public basic_text_oprimitive<std::wostream>,
|
||||
public basic_xml_oarchive<Archive>
|
||||
{
|
||||
@@ -97,21 +97,21 @@ protected:
|
||||
save(const boost::serialization::item_version_type & t){
|
||||
save(static_cast<const unsigned int>(t));
|
||||
}
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
save(const char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
save(const wchar_t * t);
|
||||
#endif
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
save(const std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_WARCHIVE_DECL(void)
|
||||
BOOST_WARCHIVE_DECL void
|
||||
save(const std::wstring &ws);
|
||||
#endif
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
xml_woarchive_impl(std::wostream & os, unsigned int flags);
|
||||
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
|
||||
BOOST_WARCHIVE_DECL
|
||||
~xml_woarchive_impl();
|
||||
public:
|
||||
void
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
// do not derive from this class. If you want to extend this functionality
|
||||
// via inhertance, derived from xml_woarchive_impl instead. This will
|
||||
// preserve correct static polymorphism.
|
||||
class xml_woarchive :
|
||||
class BOOST_SYMBOL_VISIBLE xml_woarchive :
|
||||
public xml_woarchive_impl<xml_woarchive>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/serialization/pfto.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace archive {
|
||||
@@ -66,19 +64,19 @@ public:
|
||||
friend inline void serialize(
|
||||
Archive & ar,
|
||||
T & t,
|
||||
const BOOST_PFTO unsigned int file_version
|
||||
const unsigned int file_version
|
||||
);
|
||||
template<class Archive, class T>
|
||||
friend inline void save_construct_data(
|
||||
Archive & ar,
|
||||
const T * t,
|
||||
const BOOST_PFTO unsigned int file_version
|
||||
const unsigned int file_version
|
||||
);
|
||||
template<class Archive, class T>
|
||||
friend inline void load_construct_data(
|
||||
Archive & ar,
|
||||
T * t,
|
||||
const BOOST_PFTO unsigned int file_version
|
||||
const unsigned int file_version
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -33,17 +33,8 @@ namespace boost { namespace serialization {
|
||||
|
||||
// traits to specify whether to use an optimized array serialization
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
// workaround for Borland compiler
|
||||
template <class Archive>
|
||||
struct use_array_optimization {
|
||||
template <class T> struct apply : boost::mpl::false_ {};
|
||||
};
|
||||
|
||||
#else
|
||||
template <class Archive>
|
||||
struct use_array_optimization : boost::mpl::always<boost::mpl::false_> {};
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
class array :
|
||||
@@ -125,10 +116,7 @@ private:
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
const
|
||||
#endif
|
||||
array< T > make_array( T* t, std::size_t s){
|
||||
const array< T > make_array( T* t, std::size_t s){
|
||||
return array< T >(t, s);
|
||||
}
|
||||
|
||||
@@ -154,10 +142,6 @@ void serialize(Archive& ar, std::array<T,N>& a, const unsigned int /* version */
|
||||
|
||||
} } // end namespace boost::serialization
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
// ignore optimizations for Borland
|
||||
#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive)
|
||||
#else
|
||||
#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive) \
|
||||
namespace boost { namespace serialization { \
|
||||
template <> struct use_array_optimization<Archive> { \
|
||||
@@ -166,6 +150,5 @@ template <> struct use_array_optimization<Archive> { \
|
||||
, typename boost::remove_const<ValueType>::type \
|
||||
>::type {}; \
|
||||
}; }}
|
||||
#endif // __BORLANDC__
|
||||
|
||||
#endif //BOOST_SERIALIZATION_ARRAY_HPP
|
||||
|
||||
@@ -84,16 +84,6 @@ namespace detail
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
#if defined(__BORLANDC__) && __BORLANDC__ < 0x610
|
||||
template<class Base, class Derived>
|
||||
const Base &
|
||||
base_object(const Derived & d)
|
||||
{
|
||||
BOOST_STATIC_ASSERT(! is_pointer<Derived>::value);
|
||||
detail::base_register<Base, Derived>::invoke();
|
||||
return access::cast_reference<const Base, Derived>(d);
|
||||
}
|
||||
#else
|
||||
template<class Base, class Derived>
|
||||
typename detail::base_cast<Base, Derived>::type &
|
||||
base_object(Derived &d)
|
||||
@@ -104,7 +94,6 @@ base_object(Derived &d)
|
||||
detail::base_register<type, Derived>::invoke();
|
||||
return access::cast_reference<type, Derived>(d);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace serialization
|
||||
} // namespace boost
|
||||
|
||||
@@ -68,10 +68,7 @@ struct binary_object :
|
||||
// just a little helper to support the convention that all serialization
|
||||
// wrappers follow the naming convention make_xxxxx
|
||||
inline
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
const
|
||||
#endif
|
||||
binary_object
|
||||
const binary_object
|
||||
make_binary_object(/* const */ void * t, std::size_t size){
|
||||
return binary_object(t, size);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ namespace std{
|
||||
#include <boost/serialization/detail/stack_constructor.hpp>
|
||||
#include <boost/serialization/collection_size_type.hpp>
|
||||
#include <boost/serialization/item_version_type.hpp>
|
||||
#include <boost/serialization/detail/is_default_constructible.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
||||
namespace boost{
|
||||
namespace serialization {
|
||||
@@ -47,118 +49,55 @@ namespace stl {
|
||||
// implementation of serialization for STL containers
|
||||
//
|
||||
|
||||
// sequential container input
|
||||
template<class Archive, class Container>
|
||||
struct archive_input_seq
|
||||
{
|
||||
inline typename Container::iterator
|
||||
operator()(
|
||||
Archive &ar,
|
||||
Container &s,
|
||||
const unsigned int v,
|
||||
typename Container::iterator hint
|
||||
){
|
||||
typedef typename Container::value_type type;
|
||||
detail::stack_construct<Archive, type> t(ar, v);
|
||||
// borland fails silently w/o full namespace
|
||||
ar >> boost::serialization::make_nvp("item", t.reference());
|
||||
s.push_back(t.reference());
|
||||
ar.reset_object_address(& s.back() , & t.reference());
|
||||
return hint;
|
||||
}
|
||||
};
|
||||
|
||||
// map input
|
||||
template<class Archive, class Container>
|
||||
struct archive_input_map
|
||||
{
|
||||
inline typename Container::iterator
|
||||
operator()(
|
||||
Archive &ar,
|
||||
Container &s,
|
||||
const unsigned int v,
|
||||
typename Container::iterator hint
|
||||
){
|
||||
typedef typename Container::value_type type;
|
||||
detail::stack_construct<Archive, type> t(ar, v);
|
||||
// borland fails silently w/o full namespace
|
||||
ar >> boost::serialization::make_nvp("item", t.reference());
|
||||
typename Container::iterator result =
|
||||
s.insert(hint, t.reference());
|
||||
// note: the following presumes that the map::value_type was NOT tracked
|
||||
// in the archive. This is the usual case, but here there is no way
|
||||
// to determine that.
|
||||
ar.reset_object_address(
|
||||
& (result->second),
|
||||
& t.reference().second
|
||||
);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
// set input
|
||||
template<class Archive, class Container>
|
||||
struct archive_input_set
|
||||
{
|
||||
inline typename Container::iterator
|
||||
operator()(
|
||||
Archive &ar,
|
||||
Container &s,
|
||||
const unsigned int v,
|
||||
typename Container::iterator hint
|
||||
){
|
||||
typedef typename Container::value_type type;
|
||||
detail::stack_construct<Archive, type> t(ar, v);
|
||||
// borland fails silently w/o full namespace
|
||||
ar >> boost::serialization::make_nvp("item", t.reference());
|
||||
typename Container::iterator result =
|
||||
s.insert(hint, t.reference());
|
||||
ar.reset_object_address(& (* result), & t.reference());
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template<class Container>
|
||||
class reserve_imp
|
||||
{
|
||||
public:
|
||||
void operator()(Container &s, std::size_t count) const {
|
||||
s.reserve(count);
|
||||
}
|
||||
};
|
||||
|
||||
template<class Container>
|
||||
class no_reserve_imp
|
||||
{
|
||||
public:
|
||||
void operator()(Container & /* s */, std::size_t /* count */) const{}
|
||||
};
|
||||
|
||||
template<class Archive, class Container, class InputFunction, class R>
|
||||
inline void load_collection(Archive & ar, Container &s)
|
||||
{
|
||||
s.clear();
|
||||
const boost::archive::library_version_type library_version(
|
||||
ar.get_library_version()
|
||||
);
|
||||
// retrieve number of elements
|
||||
item_version_type item_version(0);
|
||||
collection_size_type count;
|
||||
ar >> BOOST_SERIALIZATION_NVP(count);
|
||||
if(boost::archive::library_version_type(3) < library_version){
|
||||
ar >> BOOST_SERIALIZATION_NVP(item_version);
|
||||
}
|
||||
|
||||
R rx;
|
||||
rx(s, count);
|
||||
InputFunction ifunc;
|
||||
typename Container::iterator hint;
|
||||
hint = s.begin();
|
||||
template<
|
||||
class Archive,
|
||||
class T
|
||||
>
|
||||
typename boost::enable_if<
|
||||
typename detail::is_default_constructible<
|
||||
typename T::value_type
|
||||
>,
|
||||
void
|
||||
>::type
|
||||
collection_load_impl(
|
||||
Archive & ar,
|
||||
T & t,
|
||||
collection_size_type count,
|
||||
item_version_type item_version
|
||||
){
|
||||
t.resize(count);
|
||||
typename T::iterator hint;
|
||||
hint = t.begin();
|
||||
while(count-- > 0){
|
||||
hint = ifunc(ar, s, item_version, hint);
|
||||
ar >> boost::serialization::make_nvp("item", *hint++);
|
||||
}
|
||||
}
|
||||
|
||||
template<
|
||||
class Archive,
|
||||
class T
|
||||
>
|
||||
typename boost::disable_if<
|
||||
typename detail::is_default_constructible<
|
||||
typename T::value_type
|
||||
>,
|
||||
void
|
||||
>::type
|
||||
collection_load_impl(
|
||||
Archive & ar,
|
||||
T & t,
|
||||
collection_size_type count,
|
||||
item_version_type item_version
|
||||
){
|
||||
t.clear();
|
||||
while(count-- > 0){
|
||||
detail::stack_construct<Archive, typename T::value_type> u(ar, item_version);
|
||||
ar >> boost::serialization::make_nvp("item", u.reference());
|
||||
t.push_back(u.reference());
|
||||
ar.reset_object_address(& t.back() , & u.reference());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace stl
|
||||
} // namespace serialization
|
||||
} // namespace boost
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/preprocessor/facilities/empty.hpp>
|
||||
|
||||
// note: this version incorporates the related code into the the
|
||||
// the same library as BOOST_ARCHIVE. This could change some day in the
|
||||
@@ -28,7 +27,6 @@
|
||||
#undef BOOST_SERIALIZATION_DECL
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_DECLSPEC // defined in config system
|
||||
// we need to import/export our code only if the user has specifically
|
||||
// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
|
||||
// libraries to be dynamically linked, or BOOST_SERIALIZATION_DYN_LINK
|
||||
@@ -39,24 +37,15 @@
|
||||
#endif
|
||||
// export if this is our own source, otherwise import:
|
||||
#if defined(BOOST_SERIALIZATION_SOURCE)
|
||||
#if defined(__BORLANDC__)
|
||||
#define BOOST_SERIALIZATION_DECL(T) T __export
|
||||
#else
|
||||
#define BOOST_SERIALIZATION_DECL(T) __declspec(dllexport) T
|
||||
#endif
|
||||
#define BOOST_SERIALIZATION_DECL BOOST_SYMBOL_EXPORT
|
||||
#else
|
||||
#if defined(__BORLANDC__)
|
||||
#define BOOST_SERIALIZATION_DECL(T) T __import
|
||||
#else
|
||||
#define BOOST_SERIALIZATION_DECL(T) __declspec(dllimport) T
|
||||
#endif
|
||||
#define BOOST_SERIALIZATION_DECL BOOST_SYMBOL_IMPORT
|
||||
#endif // defined(BOOST_SERIALIZATION_SOURCE)
|
||||
#endif // defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK)
|
||||
#endif // BOOST_HAS_DECLSPEC
|
||||
|
||||
// if BOOST_SERIALIZATION_DECL isn't defined yet define it now:
|
||||
#ifndef BOOST_SERIALIZATION_DECL
|
||||
#define BOOST_SERIALIZATION_DECL(T) T
|
||||
#define BOOST_SERIALIZATION_DECL
|
||||
#endif
|
||||
|
||||
// enable automatic library variant selection ------------------------------//
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/serialization/collections_save_imp.hpp>
|
||||
#include <boost/serialization/collections_load_imp.hpp>
|
||||
#include <boost/serialization/detail/stack_constructor.hpp>
|
||||
#include <boost/serialization/detail/is_default_constructible.hpp>
|
||||
#include <boost/serialization/split_free.hpp>
|
||||
|
||||
namespace boost {
|
||||
@@ -43,7 +43,7 @@ template<class Archive, class U, class Allocator>
|
||||
inline void load(
|
||||
Archive & ar,
|
||||
std::deque<U, Allocator> &t,
|
||||
const unsigned int /*file_version*/
|
||||
const unsigned int /* file_version */
|
||||
){
|
||||
const boost::archive::library_version_type library_version(
|
||||
ar.get_library_version()
|
||||
@@ -55,23 +55,7 @@ inline void load(
|
||||
if(boost::archive::library_version_type(3) < library_version){
|
||||
ar >> BOOST_SERIALIZATION_NVP(item_version);
|
||||
}
|
||||
if(detail::is_default_constructible<U>()){
|
||||
t.resize(count);
|
||||
typename std::deque<U, Allocator>::iterator hint;
|
||||
hint = t.begin();
|
||||
while(count-- > 0){
|
||||
ar >> boost::serialization::make_nvp("item", *hint++);
|
||||
}
|
||||
}
|
||||
else{
|
||||
t.clear();
|
||||
while(count-- > 0){
|
||||
detail::stack_construct<Archive, U> u(ar, item_version);
|
||||
ar >> boost::serialization::make_nvp("item", u.reference());
|
||||
t.push_back(u.reference());
|
||||
ar.reset_object_address(& t.back() , & u.reference());
|
||||
}
|
||||
}
|
||||
stl::collection_load_impl(ar, t, count, item_version);
|
||||
}
|
||||
|
||||
// split non-intrusive serialization function member into separate
|
||||
|
||||
@@ -16,7 +16,10 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_TYPE_TRAITS
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 1101) \
|
||||
|| ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
|
||||
#include <type_traits>
|
||||
namespace boost{
|
||||
namespace serialization {
|
||||
|
||||
@@ -45,11 +45,6 @@ namespace std{
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn -8026 // Functions with excep. spec. are not expanded inline
|
||||
# pragma warn -8027 // Functions containing try are not expanded inline
|
||||
#endif
|
||||
|
||||
namespace boost_132 {
|
||||
|
||||
// Debug hooks
|
||||
@@ -71,10 +66,6 @@ void sp_array_destructor_hook(void * px);
|
||||
// Hence, the temporary #pragma option -pc below. The version
|
||||
// check is deliberately conservative.
|
||||
|
||||
#if defined(__BORLANDC__) && __BORLANDC__ == 0x551
|
||||
# pragma option push -pc
|
||||
#endif
|
||||
|
||||
class bad_weak_ptr: public std::exception
|
||||
{
|
||||
public:
|
||||
@@ -85,10 +76,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(__BORLANDC__) && __BORLANDC__ == 0x551
|
||||
# pragma option pop
|
||||
#endif
|
||||
|
||||
namespace detail{
|
||||
|
||||
class sp_counted_base
|
||||
@@ -201,12 +188,12 @@ public:
|
||||
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
|
||||
template<class T> void cbi_call_constructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &, int)
|
||||
template<class T> void cbi_call_constructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &)
|
||||
{
|
||||
boost::sp_scalar_constructor_hook(px, sizeof(T), pn);
|
||||
}
|
||||
|
||||
template<class T> void cbi_call_constructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &, int)
|
||||
template<class T> void cbi_call_constructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &)
|
||||
{
|
||||
boost::sp_array_constructor_hook(px);
|
||||
}
|
||||
@@ -215,12 +202,12 @@ template<class P, class D> void cbi_call_constructor_hook(sp_counted_base *, P c
|
||||
{
|
||||
}
|
||||
|
||||
template<class T> void cbi_call_destructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &, int)
|
||||
template<class T> void cbi_call_destructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &)
|
||||
{
|
||||
boost::sp_scalar_destructor_hook(px, sizeof(T), pn);
|
||||
}
|
||||
|
||||
template<class T> void cbi_call_destructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &, int)
|
||||
template<class T> void cbi_call_destructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &)
|
||||
{
|
||||
boost::sp_array_destructor_hook(px);
|
||||
}
|
||||
@@ -561,9 +548,4 @@ inline shared_count::shared_count(weak_count const & r): pi_(r.pi_)
|
||||
|
||||
BOOST_SERIALIZATION_ASSUME_ABSTRACT(boost_132::detail::sp_counted_base)
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
# pragma warn .8027 // Functions containing try are not expanded inline
|
||||
# pragma warn .8026 // Functions with excep. spec. are not expanded inline
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
|
||||
|
||||
@@ -120,13 +120,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x564) )
|
||||
template<class Y>
|
||||
explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter<Y>()) // Y must be complete
|
||||
#else
|
||||
template<class Y>
|
||||
explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter<Y>()) // Y must be complete
|
||||
#endif
|
||||
{
|
||||
detail::sp_enable_shared_from_this( pn, p, p );
|
||||
}
|
||||
@@ -145,15 +140,13 @@ public:
|
||||
// generated copy constructor, assignment, destructor are fine...
|
||||
|
||||
// except that Borland C++ has a bug, and g++ with -Wsynth warns
|
||||
#if defined(__BORLANDC__) || defined(__GNUC__)
|
||||
|
||||
#if defined(__GNUC__)
|
||||
shared_ptr & operator=(shared_ptr const & r) // never throws
|
||||
{
|
||||
px = r.px;
|
||||
pn = r.pn; // shared_count::op= doesn't throw
|
||||
return *this;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<class Y>
|
||||
|
||||
@@ -36,11 +36,7 @@ struct stack_allocate
|
||||
private:
|
||||
typedef typename boost::aligned_storage<
|
||||
sizeof(T),
|
||||
#if BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560))
|
||||
8
|
||||
#else
|
||||
boost::alignment_of<T>::value
|
||||
#endif
|
||||
boost::alignment_of<T>::value
|
||||
> type;
|
||||
type storage_;
|
||||
};
|
||||
|
||||
@@ -63,10 +63,7 @@ private:
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
const
|
||||
#endif
|
||||
ephemeral_object<T> ephemeral(const char * name, T & t){
|
||||
const ephemeral_object<T> ephemeral(const char * name, T & t){
|
||||
return ephemeral_object<T>(name, t);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,9 +86,6 @@ struct ptr_serialization_support
|
||||
{
|
||||
# if defined(BOOST_MSVC) || defined(__SUNPRO_CC)
|
||||
virtual BOOST_DLLEXPORT void instantiate() BOOST_USED;
|
||||
# elif defined(__BORLANDC__)
|
||||
static BOOST_DLLEXPORT void instantiate() BOOST_USED;
|
||||
enum { x = sizeof(instantiate(),3) };
|
||||
# else
|
||||
static BOOST_DLLEXPORT void instantiate() BOOST_USED;
|
||||
typedef instantiate_function<
|
||||
@@ -102,17 +99,11 @@ BOOST_DLLEXPORT void
|
||||
ptr_serialization_support<Archive,Serializable>::instantiate()
|
||||
{
|
||||
export_impl<Archive,Serializable>::enable_save(
|
||||
#if ! defined(__BORLANDC__)
|
||||
typename
|
||||
#endif
|
||||
Archive::is_saving()
|
||||
typename Archive::is_saving()
|
||||
);
|
||||
|
||||
export_impl<Archive,Serializable>::enable_load(
|
||||
#if ! defined(__BORLANDC__)
|
||||
typename
|
||||
#endif
|
||||
Archive::is_loading()
|
||||
typename Archive::is_loading()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace void_cast_detail{
|
||||
class void_caster;
|
||||
}
|
||||
|
||||
class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info :
|
||||
class BOOST_SYMBOL_VISIBLE extended_type_info :
|
||||
private boost::noncopyable
|
||||
{
|
||||
private:
|
||||
@@ -56,12 +56,12 @@ private:
|
||||
const char * m_key;
|
||||
|
||||
protected:
|
||||
void key_unregister() const;
|
||||
void key_register() const;
|
||||
BOOST_SERIALIZATION_DECL void key_unregister() const;
|
||||
BOOST_SERIALIZATION_DECL void key_register() const;
|
||||
// this class can't be used as is. It's just the
|
||||
// common functionality for all type_info replacement
|
||||
// systems. Hence, make these protected
|
||||
extended_type_info(
|
||||
BOOST_SERIALIZATION_DECL extended_type_info(
|
||||
const unsigned int type_info_key,
|
||||
const char * key
|
||||
);
|
||||
@@ -69,20 +69,20 @@ protected:
|
||||
#if defined(__GNUC__)
|
||||
virtual
|
||||
#endif
|
||||
~extended_type_info();
|
||||
BOOST_SERIALIZATION_DECL ~extended_type_info();
|
||||
public:
|
||||
const char * get_key() const {
|
||||
return m_key;
|
||||
}
|
||||
virtual const char * get_debug_info() const = 0;
|
||||
bool operator<(const extended_type_info &rhs) const;
|
||||
bool operator==(const extended_type_info &rhs) const;
|
||||
BOOST_SERIALIZATION_DECL bool operator<(const extended_type_info &rhs) const;
|
||||
BOOST_SERIALIZATION_DECL bool operator==(const extended_type_info &rhs) const;
|
||||
bool operator!=(const extended_type_info &rhs) const {
|
||||
return !(operator==(rhs));
|
||||
}
|
||||
// note explicit "export" of static function to work around
|
||||
// gcc 4.5 mingw error
|
||||
static const extended_type_info *
|
||||
static BOOST_SERIALIZATION_DECL const extended_type_info *
|
||||
find(const char *key);
|
||||
// for plugins
|
||||
virtual void * construct(unsigned int /*count*/ = 0, ...) const = 0;
|
||||
|
||||
@@ -52,16 +52,16 @@ namespace no_rtti_system {
|
||||
|
||||
// common base class to share type_info_key. This is used to
|
||||
// identify the method used to keep track of the extended type
|
||||
class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info_no_rtti_0 :
|
||||
class BOOST_SYMBOL_VISIBLE extended_type_info_no_rtti_0 :
|
||||
public extended_type_info
|
||||
{
|
||||
protected:
|
||||
extended_type_info_no_rtti_0(const char * key);
|
||||
~extended_type_info_no_rtti_0();
|
||||
BOOST_SERIALIZATION_DECL extended_type_info_no_rtti_0(const char * key);
|
||||
BOOST_SERIALIZATION_DECL ~extended_type_info_no_rtti_0();
|
||||
public:
|
||||
virtual bool
|
||||
virtual BOOST_SERIALIZATION_DECL bool
|
||||
is_less_than(const boost::serialization::extended_type_info &rhs) const ;
|
||||
virtual bool
|
||||
virtual BOOST_SERIALIZATION_DECL bool
|
||||
is_equal(const boost::serialization::extended_type_info &rhs) const ;
|
||||
};
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace boost {
|
||||
namespace serialization {
|
||||
namespace typeid_system {
|
||||
|
||||
class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info_typeid_0 :
|
||||
class BOOST_SYMBOL_VISIBLE extended_type_info_typeid_0 :
|
||||
public extended_type_info
|
||||
{
|
||||
virtual const char * get_debug_info() const {
|
||||
@@ -59,16 +59,16 @@ class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info_typeid_0 :
|
||||
}
|
||||
protected:
|
||||
const std::type_info * m_ti;
|
||||
extended_type_info_typeid_0(const char * key);
|
||||
~extended_type_info_typeid_0();
|
||||
void type_register(const std::type_info & ti);
|
||||
void type_unregister();
|
||||
const extended_type_info *
|
||||
BOOST_SERIALIZATION_DECL extended_type_info_typeid_0(const char * key);
|
||||
BOOST_SERIALIZATION_DECL ~extended_type_info_typeid_0();
|
||||
BOOST_SERIALIZATION_DECL void type_register(const std::type_info & ti);
|
||||
BOOST_SERIALIZATION_DECL void type_unregister();
|
||||
BOOST_SERIALIZATION_DECL const extended_type_info *
|
||||
get_extended_type_info(const std::type_info & ti) const;
|
||||
public:
|
||||
virtual bool
|
||||
virtual BOOST_SERIALIZATION_DECL bool
|
||||
is_less_than(const extended_type_info &rhs) const;
|
||||
virtual bool
|
||||
virtual BOOST_SERIALIZATION_DECL bool
|
||||
is_equal(const extended_type_info &rhs) const;
|
||||
const std::type_info & get_typeid() const {
|
||||
return *m_ti;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/comparison/greater.hpp>
|
||||
#include <boost/preprocessor/facilities/empty.hpp>
|
||||
|
||||
namespace std{
|
||||
#if defined(__LIBCOMO__)
|
||||
|
||||
@@ -31,11 +31,7 @@
|
||||
// release mode.
|
||||
|
||||
#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__)
|
||||
# if defined(__BORLANDC__)
|
||||
# define BOOST_DLLEXPORT __export
|
||||
# else
|
||||
# define BOOST_DLLEXPORT __declspec(dllexport)
|
||||
# endif
|
||||
# define BOOST_DLLEXPORT __declspec(dllexport)
|
||||
#elif ! defined(_WIN32) && ! defined(_WIN64)
|
||||
# if defined(__MWERKS__)
|
||||
# define BOOST_DLLEXPORT __declspec(dllexport)
|
||||
|
||||
@@ -16,20 +16,12 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstddef> // size_t
|
||||
#include <forward_list>
|
||||
#include <iterator> // distance
|
||||
|
||||
#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::size_t;
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/collections_save_imp.hpp>
|
||||
#include <boost/serialization/collections_load_imp.hpp>
|
||||
#include <boost/archive/detail/basic_iarchive.hpp>
|
||||
#include <boost/serialization/access.hpp>
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <boost/serialization/collection_size_type.hpp>
|
||||
#include <boost/serialization/item_version_type.hpp>
|
||||
@@ -53,6 +45,42 @@ inline void save(
|
||||
>(ar, t, count);
|
||||
}
|
||||
|
||||
namespace stl {
|
||||
|
||||
template<
|
||||
class Archive,
|
||||
class T,
|
||||
class Allocator
|
||||
>
|
||||
typename boost::disable_if<
|
||||
typename detail::is_default_constructible<
|
||||
typename std::forward_list<T, Allocator>::value_type
|
||||
>,
|
||||
void
|
||||
>::type
|
||||
collection_load_impl(
|
||||
Archive & ar,
|
||||
std::forward_list<T, Allocator> &t,
|
||||
collection_size_type count,
|
||||
item_version_type item_version
|
||||
){
|
||||
t.clear();
|
||||
boost::serialization::detail::stack_construct<Archive, T> u(ar, item_version);
|
||||
ar >> boost::serialization::make_nvp("item", u.reference());
|
||||
t.push_front(u.reference());
|
||||
typename std::forward_list<T, Allocator>::iterator last;
|
||||
last = t.begin();
|
||||
ar.reset_object_address(&(*t.begin()) , & u.reference());
|
||||
while(--count > 0){
|
||||
detail::stack_construct<Archive, T> u(ar, item_version);
|
||||
ar >> boost::serialization::make_nvp("item", u.reference());
|
||||
last = t.insert_after(last, u.reference());
|
||||
ar.reset_object_address(&(*last) , & u.reference());
|
||||
}
|
||||
}
|
||||
|
||||
} // stl
|
||||
|
||||
template<class Archive, class U, class Allocator>
|
||||
inline void load(
|
||||
Archive & ar,
|
||||
@@ -69,29 +97,7 @@ inline void load(
|
||||
if(boost::archive::library_version_type(3) < library_version){
|
||||
ar >> BOOST_SERIALIZATION_NVP(item_version);
|
||||
}
|
||||
if(detail::is_default_constructible<U>()){
|
||||
t.resize(count);
|
||||
typename std::forward_list<U, Allocator>::iterator hint;
|
||||
hint = t.begin();
|
||||
while(count-- > 0){
|
||||
ar >> boost::serialization::make_nvp("item", *hint++);
|
||||
}
|
||||
}
|
||||
else{
|
||||
t.clear();
|
||||
boost::serialization::detail::stack_construct<Archive, U> u(ar, item_version);
|
||||
ar >> boost::serialization::make_nvp("item", u.reference());
|
||||
t.push_front(u.reference());
|
||||
typename std::forward_list<U, Allocator>::iterator last;
|
||||
last = t.begin();
|
||||
ar.reset_object_address(&(*t.begin()) , & u.reference());
|
||||
while(--count > 0){
|
||||
detail::stack_construct<Archive, U> u(ar, item_version);
|
||||
ar >> boost::serialization::make_nvp("item", u.reference());
|
||||
last = t.insert_after(last, u.reference());
|
||||
ar.reset_object_address(&(*last) , & u.reference());
|
||||
}
|
||||
}
|
||||
stl::collection_load_impl(ar, t, count, item_version);
|
||||
}
|
||||
|
||||
// split non-intrusive serialization function member into separate
|
||||
|
||||
@@ -63,19 +63,11 @@ struct implementation_level_impl {
|
||||
//else
|
||||
typename mpl::eval_if<
|
||||
is_array< T >,
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
|
||||
mpl::int_<not_serializable>,
|
||||
#else
|
||||
mpl::int_<object_serializable>,
|
||||
#endif
|
||||
//else
|
||||
typename mpl::eval_if<
|
||||
is_enum< T >,
|
||||
//#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
|
||||
// mpl::int_<not_serializable>,
|
||||
//#else
|
||||
mpl::int_<primitive_type>,
|
||||
//#endif
|
||||
//else
|
||||
mpl::int_<not_serializable>
|
||||
>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/serialization/collections_save_imp.hpp>
|
||||
#include <boost/serialization/collections_load_imp.hpp>
|
||||
|
||||
#include <boost/archive/detail/basic_iarchive.hpp>
|
||||
#include <boost/serialization/access.hpp>
|
||||
@@ -29,7 +30,6 @@
|
||||
#include <boost/serialization/item_version_type.hpp>
|
||||
#include <boost/serialization/split_free.hpp>
|
||||
#include <boost/serialization/detail/stack_constructor.hpp>
|
||||
#include <boost/serialization/detail/is_default_constructible.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
@@ -62,23 +62,7 @@ inline void load(
|
||||
if(boost::archive::library_version_type(3) < library_version){
|
||||
ar >> BOOST_SERIALIZATION_NVP(item_version);
|
||||
}
|
||||
if(detail::is_default_constructible<U>()){
|
||||
t.resize(count);
|
||||
typename std::list<U, Allocator>::iterator hint;
|
||||
hint = t.begin();
|
||||
while(count-- > 0){
|
||||
ar >> boost::serialization::make_nvp("item", *hint++);
|
||||
}
|
||||
}
|
||||
else{
|
||||
t.clear();
|
||||
while(count-- > 0){
|
||||
detail::stack_construct<Archive, U> u(ar, item_version);
|
||||
ar >> boost::serialization::make_nvp("item", u.reference());
|
||||
t.push_back(u.reference());
|
||||
ar.reset_object_address(& t.back() , & u.reference());
|
||||
}
|
||||
}
|
||||
stl::collection_load_impl(ar, t, count, item_version);
|
||||
}
|
||||
|
||||
// split non-intrusive serialization function member into separate
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user