Commit 93a5b4a0 authored by jean-pierre charras's avatar jean-pierre charras

Upgrade boost to version 1.53.0 and clipper to 5.03

parent 42c2399a

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// boost aligned_storage.hpp header file // boost aligned_storage.hpp header file
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// Copyright (c) 2002-2003 // Copyright (c) 2002-2003
// Eric Friedman, Itay Maman // Eric Friedman, Itay Maman
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at // accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ALIGNED_STORAGE_HPP #ifndef BOOST_ALIGNED_STORAGE_HPP
#define BOOST_ALIGNED_STORAGE_HPP #define BOOST_ALIGNED_STORAGE_HPP
#include <cstddef> // for std::size_t #include <cstddef> // for std::size_t
#include "boost/config.hpp" #include "boost/config.hpp"
#include "boost/detail/workaround.hpp" #include "boost/detail/workaround.hpp"
#include "boost/type_traits/alignment_of.hpp" #include "boost/type_traits/alignment_of.hpp"
#include "boost/type_traits/type_with_alignment.hpp" #include "boost/type_traits/type_with_alignment.hpp"
#include "boost/type_traits/is_pod.hpp" #include "boost/type_traits/is_pod.hpp"
#include "boost/mpl/eval_if.hpp" #include "boost/mpl/eval_if.hpp"
#include "boost/mpl/identity.hpp" #include "boost/mpl/identity.hpp"
#include "boost/type_traits/detail/bool_trait_def.hpp" #include "boost/type_traits/detail/bool_trait_def.hpp"
namespace boost { namespace boost {
namespace detail { namespace aligned_storage { namespace detail { namespace aligned_storage {
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(
std::size_t std::size_t
, alignment_of_max_align = ::boost::alignment_of<max_align>::value , alignment_of_max_align = ::boost::alignment_of<max_align>::value
); );
// //
// To be TR1 conforming this must be a POD type: // To be TR1 conforming this must be a POD type:
// //
template < template <
std::size_t size_ std::size_t size_
, std::size_t alignment_ , std::size_t alignment_
> >
struct aligned_storage_imp struct aligned_storage_imp
{ {
union data_t union data_t
{ {
char buf[size_]; char buf[size_];
typename mpl::eval_if_c< typename mpl::eval_if_c<
alignment_ == std::size_t(-1) alignment_ == std::size_t(-1)
, mpl::identity<detail::max_align> , mpl::identity<detail::max_align>
, type_with_alignment<alignment_> , type_with_alignment<alignment_>
>::type align_; >::type align_;
} data_; } data_;
void* address() const { return const_cast<aligned_storage_imp*>(this); } void* address() const { return const_cast<aligned_storage_imp*>(this); }
}; };
template< std::size_t alignment_ > template< std::size_t alignment_ >
struct aligned_storage_imp<0u,alignment_> struct aligned_storage_imp<0u,alignment_>
{ {
/* intentionally empty */ /* intentionally empty */
void* address() const { return 0; } void* address() const { return 0; }
}; };
}} // namespace detail::aligned_storage }} // namespace detail::aligned_storage
template < template <
std::size_t size_ std::size_t size_
, std::size_t alignment_ = std::size_t(-1) , std::size_t alignment_ = std::size_t(-1)
> >
class aligned_storage : class aligned_storage :
#ifndef __BORLANDC__ #ifndef __BORLANDC__
private private
#else #else
public public
#endif #endif
detail::aligned_storage::aligned_storage_imp<size_, alignment_> detail::aligned_storage::aligned_storage_imp<size_, alignment_>
{ {
public: // constants public: // constants
typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type; typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(
std::size_t std::size_t
, size = size_ , size = size_
); );
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(
std::size_t std::size_t
, alignment = ( , alignment = (
alignment_ == std::size_t(-1) alignment_ == std::size_t(-1)
? ::boost::detail::aligned_storage::alignment_of_max_align ? ::boost::detail::aligned_storage::alignment_of_max_align
: alignment_ : alignment_
) )
); );
#if defined(__GNUC__) &&\ #if defined(__GNUC__) &&\
(__GNUC__ > 3) ||\ (__GNUC__ > 3) ||\
(__GNUC__ == 3 && (__GNUC_MINOR__ > 2 ||\ (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 ||\
(__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >=3))) (__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >=3)))
private: // noncopyable private: // noncopyable
aligned_storage(const aligned_storage&); aligned_storage(const aligned_storage&);
aligned_storage& operator=(const aligned_storage&); aligned_storage& operator=(const aligned_storage&);
#else // gcc less than 3.2.3 #else // gcc less than 3.2.3
public: // _should_ be noncopyable, but GCC compiler emits error public: // _should_ be noncopyable, but GCC compiler emits error
aligned_storage(const aligned_storage&); aligned_storage(const aligned_storage&);
aligned_storage& operator=(const aligned_storage&); aligned_storage& operator=(const aligned_storage&);
#endif // gcc < 3.2.3 workaround #endif // gcc < 3.2.3 workaround
public: // structors public: // structors
aligned_storage() aligned_storage()
{ {
} }
~aligned_storage() ~aligned_storage()
{ {
} }
public: // accessors public: // accessors
void* address() void* address()
{ {
return static_cast<type*>(this)->address(); return static_cast<type*>(this)->address();
} }
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
const void* address() const const void* address() const
{ {
return static_cast<const type*>(this)->address(); return static_cast<const type*>(this)->address();
} }
#else // MSVC6 #else // MSVC6
const void* address() const; const void* address() const;
#endif // MSVC6 workaround #endif // MSVC6 workaround
}; };
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
// MSVC6 seems not to like inline functions with const void* returns, so we // MSVC6 seems not to like inline functions with const void* returns, so we
// declare the following here: // declare the following here:
template <std::size_t S, std::size_t A> template <std::size_t S, std::size_t A>
const void* aligned_storage<S,A>::address() const const void* aligned_storage<S,A>::address() const
{ {
return const_cast< aligned_storage<S,A>* >(this)->address(); return const_cast< aligned_storage<S,A>* >(this)->address();
} }
#endif // MSVC6 workaround #endif // MSVC6 workaround
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// //
// Make sure that is_pod recognises aligned_storage<>::type // Make sure that is_pod recognises aligned_storage<>::type
// as a POD (Note that aligned_storage<> itself is not a POD): // as a POD (Note that aligned_storage<> itself is not a POD):
// //
template <std::size_t size_, std::size_t alignment_> template <std::size_t size_, std::size_t alignment_>
struct is_pod<boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> > struct is_pod<boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> >
BOOST_TT_AUX_BOOL_C_BASE(true) BOOST_TT_AUX_BOOL_C_BASE(true)
{ {
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true) BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true)
}; };
#endif #endif
} // namespace boost } // namespace boost
#include "boost/type_traits/detail/bool_trait_undef.hpp" #include "boost/type_traits/detail/bool_trait_undef.hpp"
#endif // BOOST_ALIGNED_STORAGE_HPP #endif // BOOST_ALIGNED_STORAGE_HPP
This diff is collapsed.
#ifndef BOOST_ARCHIVE_ADD_FACET_HPP #ifndef BOOST_ARCHIVE_ADD_FACET_HPP
#define BOOST_ARCHIVE_ADD_FACET_HPP #define BOOST_ARCHIVE_ADD_FACET_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once # pragma once
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// add_facet.hpp // add_facet.hpp
// (C) Copyright 2003 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2003 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <locale> #include <locale>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
// does STLport uses native STL for locales? // does STLport uses native STL for locales?
#if (defined(__SGI_STL_PORT)&& defined(_STLP_NO_OWN_IOSTREAMS)) #if (defined(__SGI_STL_PORT)&& defined(_STLP_NO_OWN_IOSTREAMS))
// and this native STL lib is old Dinkumware (has not defined _CPPLIB_VER) // and this native STL lib is old Dinkumware (has not defined _CPPLIB_VER)
# if (defined(_YVALS) && !defined(__IBMCPP__)) || !defined(_CPPLIB_VER) # if (defined(_YVALS) && !defined(__IBMCPP__)) || !defined(_CPPLIB_VER)
# define BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT # define BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
# endif # endif
#endif #endif
namespace boost { namespace boost {
namespace archive { namespace archive {
template<class Facet> template<class Facet>
inline std::locale * inline std::locale *
add_facet(const std::locale &l, Facet * f){ add_facet(const std::locale &l, Facet * f){
return return
#if defined BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT #if defined BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
// std namespace used for native locale // std namespace used for native locale
new std::locale(std::_Addfac(l, f)); new std::locale(std::_Addfac(l, f));
#elif BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) // old Dinkumwar #elif BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) // old Dinkumwar
// std namespace used for native locale // std namespace used for native locale
new std::locale(std::_Addfac(l, f)); new std::locale(std::_Addfac(l, f));
#else #else
// standard compatible // standard compatible
new std::locale(l, f); new std::locale(l, f);
#endif #endif
} }
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
#undef BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT #undef BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
#endif // BOOST_ARCHIVE_ADD_FACET_HPP #endif // BOOST_ARCHIVE_ADD_FACET_HPP
#ifndef BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP #ifndef BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP
#define BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP #define BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once # pragma once
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// archive/archive_exception.hpp: // archive/archive_exception.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <exception> #include <exception>
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <string> #include <string>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/preprocessor/empty.hpp> #include <boost/preprocessor/empty.hpp>
#include <boost/archive/detail/decl.hpp> #include <boost/archive/detail/decl.hpp>
// note: the only reason this is in here is that windows header // note: the only reason this is in here is that windows header
// includes #define exception_code _exception_code (arrrgghhhh!). // includes #define exception_code _exception_code (arrrgghhhh!).
// the most expedient way to address this is be sure that this // the most expedient way to address this is be sure that this
// header is always included whenever this header file is included. // header is always included whenever this header file is included.
#if defined(BOOST_WINDOWS) #if defined(BOOST_WINDOWS)
#include <excpt.h> #include <excpt.h>
#endif #endif
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost { namespace boost {
namespace archive { namespace archive {
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// exceptions thrown by archives // exceptions thrown by archives
// //
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception : class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception :
public virtual std::exception public virtual std::exception
{ {
public: protected:
typedef enum { char m_buffer[128];
no_exception, // initialized without code public:
other_exception, // any excepton not listed below typedef enum {
unregistered_class, // attempt to serialize a pointer of an no_exception, // initialized without code
// an unregistered class other_exception, // any excepton not listed below
invalid_signature, // first line of archive does not contain unregistered_class, // attempt to serialize a pointer of an
// expected string // an unregistered class
unsupported_version,// archive created with library version invalid_signature, // first line of archive does not contain
// subsequent to this one // expected string
pointer_conflict, // an attempt has been made to directly unsupported_version,// archive created with library version
// serialize an object which has // subsequent to this one
// already been serialzed through a pointer. pointer_conflict, // an attempt has been made to directly
// Were this permited, the archive load would result // serialize an object which has
// in the creation of an extra copy of the obect. // already been serialzed through a pointer.
incompatible_native_format, // attempt to read native binary format // Were this permited, the archive load would result
// on incompatible platform // in the creation of an extra copy of the obect.
array_size_too_short,// array being loaded doesn't fit in array allocated incompatible_native_format, // attempt to read native binary format
input_stream_error, // error on input stream // on incompatible platform
invalid_class_name, // class name greater than the maximum permitted. array_size_too_short,// array being loaded doesn't fit in array allocated
// most likely a corrupted archive or an attempt input_stream_error, // error on input stream
// to insert virus via buffer overrun method. invalid_class_name, // class name greater than the maximum permitted.
unregistered_cast, // base - derived relationship not registered with // most likely a corrupted archive or an attempt
// void_cast_register // to insert virus via buffer overrun method.
unsupported_class_version, // type saved with a version # greater than the unregistered_cast, // base - derived relationship not registered with
// one used by the program. This indicates that the proggram // void_cast_register
// needs to be rebuilt. unsupported_class_version, // type saved with a version # greater than the
multiple_code_instantiation, // code for implementing serialization for some // one used by the program. This indicates that the proggram
// type has been instantiated in more than one module. // needs to be rebuilt.
output_stream_error // error on input stream multiple_code_instantiation, // code for implementing serialization for some
} exception_code; // type has been instantiated in more than one module.
protected: output_stream_error // error on input stream
std::string m_msg; } exception_code;
public: public:
exception_code code; exception_code code;
archive_exception( archive_exception(
exception_code c, exception_code c,
const char * e1 = NULL, const char * e1 = NULL,
const char * e2 = NULL const char * e2 = NULL
); );
~archive_exception() throw (); virtual ~archive_exception() throw();
virtual const char *what( ) const throw(); virtual const char *what() const throw();
protected: protected:
archive_exception(); unsigned int
}; append(unsigned int l, const char * a);
archive_exception();
}// namespace archive };
}// namespace boost
}// namespace archive
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas }// namespace boost
#endif //BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif //BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP
This diff is collapsed.
#ifndef BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP #ifndef BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP
#define BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP #define BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once # pragma once
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_streambuf_local_saver.hpp // basic_streambuf_local_saver.hpp
// (C) Copyright 2005 Robert Ramey - http://www.rrsd.com // (C) Copyright 2005 Robert Ramey - http://www.rrsd.com
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
// note derived from boost/io/ios_state.hpp // note derived from boost/io/ios_state.hpp
// Copyright 2002, 2005 Daryle Walker. Use, modification, and distribution // Copyright 2002, 2005 Daryle Walker. Use, modification, and distribution
// are subject to the Boost Software License, Version 1.0. (See accompanying // are subject to the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.) // file LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
// See <http://www.boost.org/libs/io/> for the library's home page. // See <http://www.boost.org/libs/io/> for the library's home page.
#ifndef BOOST_NO_STD_LOCALE #ifndef BOOST_NO_STD_LOCALE
#include <locale> // for std::locale #include <locale> // for std::locale
#include <streambuf> // for std::basic_streambuf #include <streambuf> // for std::basic_streambuf
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable : 4511 4512) # pragma warning(disable : 4511 4512)
#endif #endif
namespace boost{ namespace boost{
namespace archive{ namespace archive{
template < typename Ch, class Tr > template < typename Ch, class Tr >
class basic_streambuf_locale_saver : class basic_streambuf_locale_saver :
private boost::noncopyable private boost::noncopyable
{ {
public: public:
typedef ::std::basic_streambuf<Ch, Tr> state_type; typedef ::std::basic_streambuf<Ch, Tr> state_type;
typedef ::std::locale aspect_type; typedef ::std::locale aspect_type;
explicit basic_streambuf_locale_saver( state_type &s ) explicit basic_streambuf_locale_saver( state_type &s )
: s_save_( s ), a_save_( s.getloc() ) : s_save_( s ), a_save_( s.getloc() )
{} {}
basic_streambuf_locale_saver( state_type &s, aspect_type const &a ) basic_streambuf_locale_saver( state_type &s, aspect_type const &a )
: s_save_( s ), a_save_( s.pubimbue(a) ) : s_save_( s ), a_save_( s.pubimbue(a) )
{} {}
~basic_streambuf_locale_saver() ~basic_streambuf_locale_saver()
{ this->restore(); } { this->restore(); }
void restore() void restore()
{ s_save_.pubimbue( a_save_ ); } { s_save_.pubimbue( a_save_ ); }
private: private:
state_type & s_save_; state_type & s_save_;
aspect_type const a_save_; aspect_type const a_save_;
}; };
} // archive } // archive
} // boost } // boost
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#endif // BOOST_NO_STD_LOCALE #endif // BOOST_NO_STD_LOCALE
#endif // BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP #endif // BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP
#ifndef BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP #ifndef BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once # pragma once
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_text_iarchive.hpp // basic_text_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
// archives stored as text - note these ar templated on the basic // archives stored as text - note these ar templated on the basic
// stream templates to accommodate wide (and other?) kind of characters // stream templates to accommodate wide (and other?) kind of characters
// //
// note the fact that on libraries without wide characters, ostream is // note the fact that on libraries without wide characters, ostream is
// is not a specialization of basic_ostream which in fact is not defined // is not a specialization of basic_ostream which in fact is not defined
// in such cases. So we can't use basic_ostream<IStream::char_type> but rather // in such cases. So we can't use basic_ostream<IStream::char_type> but rather
// use two template parameters // use two template parameters
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#include <boost/archive/detail/common_iarchive.hpp> #include <boost/archive/detail/common_iarchive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable : 4511 4512) # pragma warning(disable : 4511 4512)
#endif #endif
namespace boost { namespace boost {
namespace archive { namespace archive {
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class basic_text_iarchive - read serialized objects from a input text stream // class basic_text_iarchive - read serialized objects from a input text stream
template<class Archive> template<class Archive>
class basic_text_iarchive : class basic_text_iarchive :
public detail::common_iarchive<Archive> public detail::common_iarchive<Archive>
{ {
protected: protected:
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public: public:
#elif defined(BOOST_MSVC) #elif defined(BOOST_MSVC)
// for some inexplicable reason insertion of "class" generates compile erro // for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1 // on msvc 7.1
friend detail::interface_iarchive<Archive>; friend detail::interface_iarchive<Archive>;
#else #else
friend class detail::interface_iarchive<Archive>; friend class detail::interface_iarchive<Archive>;
#endif #endif
// intermediate level to support override of operators // intermediate level to support override of operators
// fot templates in the absence of partial function // fot templates in the absence of partial function
// template ordering // template ordering
typedef detail::common_iarchive<Archive> detail_common_iarchive; typedef detail::common_iarchive<Archive> detail_common_iarchive;
template<class T> template<class T>
void load_override(T & t, BOOST_PFTO int){ void load_override(T & t, BOOST_PFTO int){
this->detail_common_iarchive::load_override(t, 0); this->detail_common_iarchive::load_override(t, 0);
} }
// text file don't include the optional information // 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*/, int){}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(class_name_type & t, int); load_override(class_name_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
init(void); init(void);
basic_text_iarchive(unsigned int flags) : basic_text_iarchive(unsigned int flags) :
detail::common_iarchive<Archive>(flags) detail::common_iarchive<Archive>(flags)
{} {}
~basic_text_iarchive(){} ~basic_text_iarchive(){}
}; };
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP #endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP #ifndef BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP
#define BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP #define BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once # pragma once
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_text_iprimitive.hpp // basic_text_iprimitive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
// archives stored as text - note these are templated on the basic // archives stored as text - note these are templated on the basic
// stream templates to accommodate wide (and other?) kind of characters // stream templates to accommodate wide (and other?) kind of characters
// //
// Note the fact that on libraries without wide characters, ostream is // Note the fact that on libraries without wide characters, ostream is
// not a specialization of basic_ostream which in fact is not defined // not a specialization of basic_ostream which in fact is not defined
// in such cases. So we can't use basic_ostream<IStream::char_type> but rather // in such cases. So we can't use basic_ostream<IStream::char_type> but rather
// use two template parameters // use two template parameters
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <locale> #include <locale>
#include <cstddef> // size_t #include <cstddef> // size_t
#include <boost/config.hpp> #include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE) #if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{ namespace std{
using ::size_t; using ::size_t;
#if ! defined(BOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT) #if ! defined(BOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT)
using ::locale; using ::locale;
#endif #endif
} // namespace std } // namespace std
#endif #endif
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#include <boost/archive/dinkumware.hpp> #include <boost/archive/dinkumware.hpp>
#endif #endif
#include <boost/limits.hpp> #include <boost/limits.hpp>
#include <boost/io/ios_state.hpp> #include <boost/io/ios_state.hpp>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/serialization/throw_exception.hpp> #include <boost/serialization/throw_exception.hpp>
#include <boost/archive/archive_exception.hpp> #include <boost/archive/archive_exception.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp> #include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost { namespace boost {
namespace archive { namespace archive {
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class basic_text_iarchive - load serialized objects from a input text stream // class basic_text_iarchive - load serialized objects from a input text stream
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning( push ) #pragma warning( push )
#pragma warning( disable : 4244 4267 ) #pragma warning( disable : 4244 4267 )
#endif #endif
template<class IStream> template<class IStream>
class basic_text_iprimitive class basic_text_iprimitive
{ {
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
protected: protected:
#else #else
public: public:
#endif #endif
IStream &is; IStream &is;
io::ios_flags_saver flags_saver; io::ios_flags_saver flags_saver;
io::ios_precision_saver precision_saver; io::ios_precision_saver precision_saver;
#ifndef BOOST_NO_STD_LOCALE #ifndef BOOST_NO_STD_LOCALE
boost::scoped_ptr<std::locale> archive_locale; boost::scoped_ptr<std::locale> archive_locale;
basic_streambuf_locale_saver< basic_streambuf_locale_saver<
BOOST_DEDUCED_TYPENAME IStream::char_type, BOOST_DEDUCED_TYPENAME IStream::char_type,
BOOST_DEDUCED_TYPENAME IStream::traits_type BOOST_DEDUCED_TYPENAME IStream::traits_type
> locale_saver; > locale_saver;
#endif #endif
template<class T> template<class T>
void load(T & t) void load(T & t)
{ {
if(! is.fail()){ if(! is.fail()){
is >> t; is >> t;
return; return;
} }
boost::serialization::throw_exception( boost::serialization::throw_exception(
archive_exception(archive_exception::input_stream_error) archive_exception(archive_exception::input_stream_error)
); );
} }
void load(char & t) void load(char & t)
{ {
short int i; short int i;
load(i); load(i);
t = i; t = i;
} }
void load(signed char & t) void load(signed char & t)
{ {
short int i; short int i;
load(i); load(i);
t = i; t = i;
} }
void load(unsigned char & t) void load(unsigned char & t)
{ {
unsigned short int i; unsigned short int i;
load(i); load(i);
t = i; t = i;
} }
#ifndef BOOST_NO_INTRINSIC_WCHAR_T #ifndef BOOST_NO_INTRINSIC_WCHAR_T
void load(wchar_t & t) void load(wchar_t & t)
{ {
BOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int)); BOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int));
int i; int i;
load(i); load(i);
t = i; t = i;
} }
#endif #endif
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_text_iprimitive(IStream &is, bool no_codecvt); basic_text_iprimitive(IStream &is, bool no_codecvt);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_text_iprimitive(); ~basic_text_iprimitive();
public: public:
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_binary(void *address, std::size_t count); load_binary(void *address, std::size_t count);
}; };
#if defined(_MSC_VER) #if defined(_MSC_VER)
#pragma warning( pop ) #pragma warning( pop )
#endif #endif
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pop pragmas #include <boost/archive/detail/abi_suffix.hpp> // pop pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP #endif // BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP #ifndef BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once # pragma once
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_text_oarchive.hpp // basic_text_oarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
// archives stored as text - note these ar templated on the basic // archives stored as text - note these ar templated on the basic
// stream templates to accommodate wide (and other?) kind of characters // stream templates to accommodate wide (and other?) kind of characters
// //
// note the fact that on libraries without wide characters, ostream is // note the fact that on libraries without wide characters, ostream is
// is not a specialization of basic_ostream which in fact is not defined // is not a specialization of basic_ostream which in fact is not defined
// in such cases. So we can't use basic_ostream<OStream::char_type> but rather // in such cases. So we can't use basic_ostream<OStream::char_type> but rather
// use two template parameters // use two template parameters
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#include <boost/archive/detail/common_oarchive.hpp> #include <boost/archive/detail/common_oarchive.hpp>
#include <boost/serialization/string.hpp> #include <boost/serialization/string.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable : 4511 4512) # pragma warning(disable : 4511 4512)
#endif #endif
namespace boost { namespace boost {
namespace archive { namespace archive {
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class basic_text_oarchive // class basic_text_oarchive
template<class Archive> template<class Archive>
class basic_text_oarchive : class basic_text_oarchive :
public detail::common_oarchive<Archive> public detail::common_oarchive<Archive>
{ {
protected: protected:
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|| BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560)) || BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560))
public: public:
#elif defined(BOOST_MSVC) #elif defined(BOOST_MSVC)
// for some inexplicable reason insertion of "class" generates compile erro // for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1 // on msvc 7.1
friend detail::interface_oarchive<Archive>; friend detail::interface_oarchive<Archive>;
#else #else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
#endif #endif
enum { enum {
none, none,
eol, eol,
space space
} delimiter; } delimiter;
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
newtoken(); newtoken();
void newline(){ void newline(){
delimiter = eol; delimiter = eol;
} }
// default processing - kick back to base class. Note the // default processing - kick back to base class. Note the
// extra stuff to get it passed borland compilers // extra stuff to get it passed borland compilers
typedef detail::common_oarchive<Archive> detail_common_oarchive; typedef detail::common_oarchive<Archive> detail_common_oarchive;
template<class T> template<class T>
void save_override(T & t, BOOST_PFTO int){ void save_override(T & t, BOOST_PFTO int){
this->detail_common_oarchive::save_override(t, 0); this->detail_common_oarchive::save_override(t, 0);
} }
// start new objects on a new line // start new objects on a new line
void save_override(const object_id_type & t, int){ void save_override(const object_id_type & t, int){
this->This()->newline(); this->This()->newline();
this->detail_common_oarchive::save_override(t, 0); this->detail_common_oarchive::save_override(t, 0);
} }
// text file don't include the optional information // 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 */, int){}
void save_override(const class_name_type & t, int){ void save_override(const class_name_type & t, int){
const std::string s(t); const std::string s(t);
* this->This() << s; * this->This() << s;
} }
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
init(); init();
basic_text_oarchive(unsigned int flags) : basic_text_oarchive(unsigned int flags) :
detail::common_oarchive<Archive>(flags), detail::common_oarchive<Archive>(flags),
delimiter(none) delimiter(none)
{} {}
~basic_text_oarchive(){} ~basic_text_oarchive(){}
}; };
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP #endif // BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP #ifndef BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once # pragma once
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_xml_archive.hpp: // basic_xml_archive.hpp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <boost/archive/archive_exception.hpp> #include <boost/archive/archive_exception.hpp>
#include <boost/archive/detail/auto_link_archive.hpp> #include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost { namespace boost {
namespace archive { namespace archive {
// constant strings used in xml i/o // constant strings used in xml i/o
extern extern
BOOST_ARCHIVE_DECL(const char *) BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_OBJECT_ID(); BOOST_ARCHIVE_XML_OBJECT_ID();
extern extern
BOOST_ARCHIVE_DECL(const char *) BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_OBJECT_REFERENCE(); BOOST_ARCHIVE_XML_OBJECT_REFERENCE();
extern extern
BOOST_ARCHIVE_DECL(const char *) BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_CLASS_ID(); BOOST_ARCHIVE_XML_CLASS_ID();
extern extern
BOOST_ARCHIVE_DECL(const char *) BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(); BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE();
extern extern
BOOST_ARCHIVE_DECL(const char *) BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_CLASS_NAME(); BOOST_ARCHIVE_XML_CLASS_NAME();
extern extern
BOOST_ARCHIVE_DECL(const char *) BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_TRACKING(); BOOST_ARCHIVE_XML_TRACKING();
extern extern
BOOST_ARCHIVE_DECL(const char *) BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_VERSION(); BOOST_ARCHIVE_XML_VERSION();
extern extern
BOOST_ARCHIVE_DECL(const char *) BOOST_ARCHIVE_DECL(const char *)
BOOST_ARCHIVE_XML_SIGNATURE(); BOOST_ARCHIVE_XML_SIGNATURE();
}// namespace archive }// namespace archive
}// namespace boost }// namespace boost
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP #endif // BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP
#ifndef BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP #ifndef BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP #define BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP
// MS compatible compilers support #pragma once // MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once # pragma once
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_xml_iarchive.hpp // basic_xml_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/serialization/pfto.hpp> #include <boost/serialization/pfto.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#include <boost/archive/detail/common_iarchive.hpp> #include <boost/archive/detail/common_iarchive.hpp>
#include <boost/serialization/nvp.hpp> #include <boost/serialization/nvp.hpp>
#include <boost/serialization/string.hpp> #include <boost/serialization/string.hpp>
#include <boost/mpl/assert.hpp> #include <boost/mpl/assert.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable : 4511 4512) # pragma warning(disable : 4511 4512)
#endif #endif
namespace boost { namespace boost {
namespace archive { namespace archive {
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// class xml_iarchive - read serialized objects from a input text stream // class xml_iarchive - read serialized objects from a input text stream
template<class Archive> template<class Archive>
class basic_xml_iarchive : class basic_xml_iarchive :
public detail::common_iarchive<Archive> public detail::common_iarchive<Archive>
{ {
protected: protected:
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
public: public:
#elif defined(BOOST_MSVC) #elif defined(BOOST_MSVC)
// for some inexplicable reason insertion of "class" generates compile erro // for some inexplicable reason insertion of "class" generates compile erro
// on msvc 7.1 // on msvc 7.1
friend detail::interface_oarchive<Archive>; friend detail::interface_oarchive<Archive>;
#else #else
friend class detail::interface_oarchive<Archive>; friend class detail::interface_oarchive<Archive>;
#endif #endif
unsigned int depth; unsigned int depth;
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_start(const char *name); load_start(const char *name);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_end(const char *name); load_end(const char *name);
// Anything not an attribute and not a name-value pair is an // Anything not an attribute and not a name-value pair is an
// should be trapped here. // should be trapped here.
template<class T> template<class T>
void load_override(T & t, BOOST_PFTO int) void load_override(T & t, BOOST_PFTO int)
{ {
// If your program fails to compile here, its most likely due to // If your program fails to compile here, its most likely due to
// not specifying an nvp wrapper around the variable to // not specifying an nvp wrapper around the variable to
// be serialized. // be serialized.
BOOST_MPL_ASSERT((serialization::is_wrapper< T >)); BOOST_MPL_ASSERT((serialization::is_wrapper< T >));
this->detail_common_iarchive::load_override(t, 0); this->detail_common_iarchive::load_override(t, 0);
} }
// Anything not an attribute - see below - should be a name value // Anything not an attribute - see below - should be a name value
// pair and be processed here // pair and be processed here
typedef detail::common_iarchive<Archive> detail_common_iarchive; typedef detail::common_iarchive<Archive> detail_common_iarchive;
template<class T> template<class T>
void load_override( void load_override(
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
const const
#endif #endif
boost::serialization::nvp< T > & t, boost::serialization::nvp< T > & t,
int int
){ ){
this->This()->load_start(t.name()); this->This()->load_start(t.name());
this->detail_common_iarchive::load_override(t.value(), 0); this->detail_common_iarchive::load_override(t.value(), 0);
this->This()->load_end(t.name()); this->This()->load_end(t.name());
} }
// specific overrides for attributes - handle as // specific overrides for attributes - handle as
// primitives. These are not name-value pairs // primitives. These are not name-value pairs
// so they have to be intercepted here and passed on to load. // so they have to be intercepted here and passed on to load.
// although the class_id is included in the xml text file in order // although the class_id is included in the xml text file in order
// to make the file self describing, it isn't used when loading // to make the file self describing, it isn't used when loading
// an xml archive. So we can skip it here. Note: we MUST override // 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 // it otherwise it will be loaded as a normal primitive w/o tag and
// leaving the archive in an undetermined state // leaving the archive in an undetermined state
void load_override(class_id_optional_type & /* t */, int){} void load_override(class_id_optional_type & /* t */, int){}
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(object_id_type & t, int); load_override(object_id_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(version_type & t, int); load_override(version_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(class_id_type & t, int); load_override(class_id_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
load_override(tracking_type & t, int); load_override(tracking_type & t, int);
// class_name_type can't be handled here as it depends upon the // class_name_type can't be handled here as it depends upon the
// char type used by the stream. So require the derived implementation // char type used by the stream. So require the derived implementation
// handle this. // handle this.
// void load_override(class_name_type & t, int); // void load_override(class_name_type & t, int);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
basic_xml_iarchive(unsigned int flags); basic_xml_iarchive(unsigned int flags);
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_xml_iarchive(); ~basic_xml_iarchive();
}; };
} // namespace archive } // namespace archive
} // namespace boost } // namespace boost
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP #endif // BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// abi_prefix.hpp // abi_prefix.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <boost/config/abi_prefix.hpp> // must be the last header #include <boost/config/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
# pragma warning(push) # pragma warning(push)
# pragma warning(disable : 4251 4231 4660 4275) # pragma warning(disable : 4251 4231 4660 4275)
#endif #endif
#if defined( __BORLANDC__ ) #if defined( __BORLANDC__ )
#pragma nopushoptwarn #pragma nopushoptwarn
#endif #endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// abi_suffix.hpp // abi_suffix.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software // Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#ifdef BOOST_MSVC #ifdef BOOST_MSVC
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas #include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#if defined( __BORLANDC__ ) #if defined( __BORLANDC__ )
#pragma nopushoptwarn #pragma nopushoptwarn
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment