From 3333ab69d62d1be7ae7dd7a4e56cc4bb608d3add Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Fri, 4 Jan 2013 19:42:37 +0000 Subject: Add boost serialization library We'll need it before too long Change-Id: Ia34c7f26e1aedbc13a2fc10c980994cbcb7cb348 diff --git a/.gitignore b/.gitignore index b24578d..c1e0637 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,7 @@ Swift/QtUI/swift Swift/QtUI/COPYING Swift/QtUI/DefaultTheme.qrc checker-report.xml -VERSION.* +/VERSION.* cppcheck.log /build /.settings/ diff --git a/3rdParty/Boost/.gitignore b/3rdParty/Boost/.gitignore index f86949c..faa799d 100644 --- a/3rdParty/Boost/.gitignore +++ b/3rdParty/Boost/.gitignore @@ -7,4 +7,3 @@ *.ilk *.manifest /bcp -uuid diff --git a/3rdParty/Boost/SConscript b/3rdParty/Boost/SConscript index 6578736..ba5aa47 100644 --- a/3rdParty/Boost/SConscript +++ b/3rdParty/Boost/SConscript @@ -99,7 +99,46 @@ elif env.get("BOOST_BUNDLED", False) : "src/libs/program_options/src/program_options_utf8_codecvt_facet.cpp", "src/libs/program_options/src/value_semantic.cpp", "src/libs/program_options/src/variables_map.cpp", - "src/libs/program_options/src/winmain.cpp"] + "src/libs/program_options/src/winmain.cpp", + "src/libs/serialization/src/archive_exception.cpp", + "src/libs/serialization/src/basic_archive.cpp", + "src/libs/serialization/src/basic_iarchive.cpp", + "src/libs/serialization/src/basic_iserializer.cpp", + "src/libs/serialization/src/basic_oarchive.cpp", + "src/libs/serialization/src/basic_oserializer.cpp", + "src/libs/serialization/src/basic_pointer_iserializer.cpp", + "src/libs/serialization/src/basic_pointer_oserializer.cpp", + "src/libs/serialization/src/basic_serializer_map.cpp", + "src/libs/serialization/src/basic_text_iprimitive.cpp", + "src/libs/serialization/src/basic_text_oprimitive.cpp", + "src/libs/serialization/src/basic_text_wiprimitive.cpp", + "src/libs/serialization/src/basic_text_woprimitive.cpp", + "src/libs/serialization/src/basic_xml_archive.cpp", + "src/libs/serialization/src/binary_iarchive.cpp", + "src/libs/serialization/src/binary_oarchive.cpp", + "src/libs/serialization/src/binary_wiarchive.cpp", + "src/libs/serialization/src/binary_woarchive.cpp", + "src/libs/serialization/src/codecvt_null.cpp", + "src/libs/serialization/src/extended_type_info.cpp", + "src/libs/serialization/src/extended_type_info_no_rtti.cpp", + "src/libs/serialization/src/extended_type_info_typeid.cpp", + "src/libs/serialization/src/polymorphic_iarchive.cpp", + "src/libs/serialization/src/polymorphic_oarchive.cpp", + "src/libs/serialization/src/shared_ptr_helper.cpp", + "src/libs/serialization/src/stl_port.cpp", + "src/libs/serialization/src/text_iarchive.cpp", + "src/libs/serialization/src/text_oarchive.cpp", + "src/libs/serialization/src/text_wiarchive.cpp", + "src/libs/serialization/src/text_woarchive.cpp", + "src/libs/serialization/src/utf8_codecvt_facet.cpp", + "src/libs/serialization/src/void_cast.cpp", + "src/libs/serialization/src/xml_archive_exception.cpp", + "src/libs/serialization/src/xml_grammar.cpp", + "src/libs/serialization/src/xml_iarchive.cpp", + "src/libs/serialization/src/xml_oarchive.cpp", + "src/libs/serialization/src/xml_wgrammar.cpp", + "src/libs/serialization/src/xml_wiarchive.cpp", + "src/libs/serialization/src/xml_woarchive.cpp"] if env["PLATFORM"] != "darwin" or env["target"] == "native" : sources += [ @@ -125,6 +164,7 @@ elif env.get("BOOST_BUNDLED", False) : bcp_env.MergeFlags(bcp_env["BOOST_FLAGS"]) bcp_env.Append(CPPPATH = ["src/tools/bcp"]) bcp_env.Replace(CPPDEFINES = [flag for flag in bcp_env["CPPDEFINES"] if flag[0] != "BOOST_FILESYSTEM_VERSION"]) + bcp_env.UseFlags(bcp_env["PLATFORM_FLAGS"]) bcp_env.Program("bcp", [ "src/tools/bcp/add_path.cpp", "src/tools/bcp/add_dependent_lib.cpp", diff --git a/3rdParty/Boost/src/boost/archive/add_facet.hpp b/3rdParty/Boost/src/boost/archive/add_facet.hpp new file mode 100644 index 0000000..6bafe9b --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/add_facet.hpp @@ -0,0 +1,55 @@ +#ifndef BOOST_ARCHIVE_ADD_FACET_HPP +#define BOOST_ARCHIVE_ADD_FACET_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// add_facet.hpp + +// (C) Copyright 2003 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 +#include +#include + +// does STLport uses native STL for locales? +#if (defined(__SGI_STL_PORT)&& defined(_STLP_NO_OWN_IOSTREAMS)) +// and this native STL lib is old Dinkumware (has not defined _CPPLIB_VER) +# if (defined(_YVALS) && !defined(__IBMCPP__)) || !defined(_CPPLIB_VER) +# define BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT +# endif +#endif + +namespace boost { +namespace archive { + +template +inline std::locale * +add_facet(const std::locale &l, Facet * f){ + return + #if defined BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT + // std namespace used for native locale + new std::locale(std::_Addfac(l, f)); + #elif BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) // old Dinkumwar + // std namespace used for native locale + new std::locale(std::_Addfac(l, f)); + #else + // standard compatible + new std::locale(l, f); + #endif +} + +} // namespace archive +} // namespace boost + +#undef BOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT + +#endif // BOOST_ARCHIVE_ADD_FACET_HPP diff --git a/3rdParty/Boost/src/boost/archive/archive_exception.hpp b/3rdParty/Boost/src/boost/archive/archive_exception.hpp new file mode 100644 index 0000000..b5f33f6 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/archive_exception.hpp @@ -0,0 +1,97 @@ +#ifndef BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP +#define BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// archive/archive_exception.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 +#include +#include + +#include +#include +#include + +// note: the only reason this is in here is that windows header +// includes #define exception_code _exception_code (arrrgghhhh!). +// the most expedient way to address this is be sure that this +// header is always included whenever this header file is included. +#if defined(BOOST_WINDOWS) +#include +#endif + +#include // must be the last header + +namespace boost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// exceptions thrown by archives +// +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception : + public virtual std::exception +{ +public: + typedef enum { + no_exception, // initialized without code + other_exception, // any excepton not listed below + unregistered_class, // attempt to serialize a pointer of an + // an unregistered class + invalid_signature, // first line of archive does not contain + // expected string + unsupported_version,// archive created with library version + // subsequent to this one + pointer_conflict, // an attempt has been made to directly + // serialize an object which has + // already been serialzed through a pointer. + // Were this permited, the archive load would result + // in the creation of an extra copy of the obect. + incompatible_native_format, // attempt to read native binary format + // on incompatible platform + array_size_too_short,// array being loaded doesn't fit in array allocated + input_stream_error, // error on input stream + invalid_class_name, // class name greater than the maximum permitted. + // most likely a corrupted archive or an attempt + // to insert virus via buffer overrun method. + unregistered_cast, // base - derived relationship not registered with + // void_cast_register + unsupported_class_version, // type saved with a version # greater than the + // one used by the program. This indicates that the proggram + // needs to be rebuilt. + multiple_code_instantiation, // code for implementing serialization for some + // type has been instantiated in more than one module. + output_stream_error // error on input stream + } exception_code; +protected: + std::string m_msg; +public: + exception_code code; + archive_exception( + exception_code c, + const char * e1 = NULL, + const char * e2 = NULL + ); + ~archive_exception() throw (); + virtual const char *what( ) const throw(); +protected: + archive_exception(); +}; + +}// namespace archive +}// namespace boost + +#include // pops abi_suffix.hpp pragmas + +#endif //BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_archive.hpp b/3rdParty/Boost/src/boost/archive/basic_archive.hpp new file mode 100644 index 0000000..c5ac880 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_archive.hpp @@ -0,0 +1,301 @@ +#ifndef BOOST_ARCHIVE_BASIC_ARCHIVE_HPP +#define BOOST_ARCHIVE_BASIC_ARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_archive.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 +#include +#include // size_t +#include +#include + +#include +#include // must be the last header + +namespace boost { +namespace archive { + +#if defined(_MSC_VER) +#pragma warning( push ) +#pragma warning( disable : 4244 4267 ) +#endif + +/* NOTE : Warning : Warning : Warning : Warning : Warning + * Don't ever changes this. If you do, they previously created + * binary archives won't be readable !!! + */ +class library_version_type { +private: + typedef uint_least16_t base_type; + base_type t; +public: + library_version_type(): t(0) {}; + explicit library_version_type(const unsigned int & t_) : t(t_){ + BOOST_ASSERT(t_ <= boost::integer_traits::const_max); + } + library_version_type(const library_version_type & t_) : + t(t_.t) + {} + library_version_type & operator=(const library_version_type & rhs){ + t = rhs.t; + return *this; + } + // used for text output + operator base_type () const { + return t; + } + // used for text input + operator base_type & (){ + return t; + } + bool operator==(const library_version_type & rhs) const { + return t == rhs.t; + } + bool operator<(const library_version_type & rhs) const { + return t < rhs.t; + } +}; + +BOOST_ARCHIVE_DECL(library_version_type) +BOOST_ARCHIVE_VERSION(); + +class version_type { +private: + typedef uint_least32_t base_type; + base_type t; +public: + // should be private - but MPI fails if it's not!!! + version_type(): t(0) {}; + explicit version_type(const unsigned int & t_) : t(t_){ + BOOST_ASSERT(t_ <= boost::integer_traits::const_max); + } + version_type(const version_type & t_) : + t(t_.t) + {} + version_type & operator=(const version_type & rhs){ + t = rhs.t; + return *this; + } + // used for text output + operator base_type () const { + return t; + } + // used for text intput + operator base_type & (){ + return t; + } + bool operator==(const version_type & rhs) const { + return t == rhs.t; + } + bool operator<(const version_type & rhs) const { + return t < rhs.t; + } +}; + +class class_id_type { +private: + typedef int_least16_t base_type; + base_type t; +public: + // should be private - but then can't use BOOST_STRONG_TYPE below + class_id_type() : t(0) {}; + explicit class_id_type(const int t_) : t(t_){ + BOOST_ASSERT(t_ <= boost::integer_traits::const_max); + } + explicit class_id_type(const std::size_t t_) : t(t_){ + // BOOST_ASSERT(t_ <= boost::integer_traits::const_max); + } + class_id_type(const class_id_type & t_) : + t(t_.t) + {} + class_id_type & operator=(const class_id_type & rhs){ + t = rhs.t; + return *this; + } + + // used for text output + operator int () const { + return t; + } + // used for text input + operator int_least16_t &() { + return t; + } + bool operator==(const class_id_type & rhs) const { + return t == rhs.t; + } + bool operator<(const class_id_type & rhs) const { + return t < rhs.t; + } +}; + +#define NULL_POINTER_TAG boost::archive::class_id_type(-1) + +class object_id_type { +private: + typedef uint_least32_t base_type; + base_type t; +public: + object_id_type(): t(0) {}; + // note: presumes that size_t >= unsigned int. + explicit object_id_type(const std::size_t & t_) : t(t_){ + BOOST_ASSERT(t_ <= boost::integer_traits::const_max); + } + object_id_type(const object_id_type & t_) : + t(t_.t) + {} + object_id_type & operator=(const object_id_type & rhs){ + t = rhs.t; + return *this; + } + // used for text output + operator uint_least32_t () const { + return t; + } + // used for text input + operator uint_least32_t & () { + return t; + } + bool operator==(const object_id_type & rhs) const { + return t == rhs.t; + } + bool operator<(const object_id_type & rhs) const { + return t < rhs.t; + } +}; + +#if defined(_MSC_VER) +#pragma warning( pop ) +#endif + +struct tracking_type { + bool t; + explicit tracking_type(const bool t_ = false) + : t(t_) + {}; + tracking_type(const tracking_type & t_) + : t(t_.t) + {} + operator bool () const { + return t; + }; + operator bool & () { + return t; + }; + tracking_type & operator=(const bool t_){ + t = t_; + return *this; + } + bool operator==(const tracking_type & rhs) const { + return t == rhs.t; + } + bool operator==(const bool & rhs) const { + return t == rhs; + } + tracking_type & operator=(const tracking_type & rhs){ + t = rhs.t; + return *this; + } +}; + +struct class_name_type : + private boost::noncopyable +{ + char *t; + operator const char * & () const { + return const_cast(t); + } + operator char * () { + return t; + } + explicit class_name_type(const char *key_) + : t(const_cast(key_)){} + explicit class_name_type(char *key_) + : t(key_){} + class_name_type & operator=(const class_name_type & rhs){ + t = rhs.t; + return *this; + } +}; + +enum archive_flags { + no_header = 1, // suppress archive header info + no_codecvt = 2, // suppress alteration of codecvt facet + no_xml_tag_checking = 4, // suppress checking of xml tags + no_tracking = 8, // suppress ALL tracking + flags_last = 8 +}; + +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_SIGNATURE(); + +/* NOTE : Warning : Warning : Warning : Warning : Warning + * If any of these are changed to different sized types, + * binary_iarchive won't be able to read older archives + * unless you rev the library version and include conditional + * code based on the library version. There is nothing + * inherently wrong in doing this - but you have to be super + * careful because it's easy to get wrong and start breaking + * old archives !!! + */ + +#define BOOST_ARCHIVE_STRONG_TYPEDEF(T, D) \ + class D : public T { \ + public: \ + explicit D(const T tt) : T(tt){} \ + }; \ +/**/ + +BOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_reference_type) +BOOST_ARCHIVE_STRONG_TYPEDEF(class_id_type, class_id_optional_type) +BOOST_ARCHIVE_STRONG_TYPEDEF(object_id_type, object_reference_type) + +}// namespace archive +}// namespace boost + +#include // pops abi_suffix.hpp pragmas + +#include + +// set implementation level to primitive for all types +// used internally by the serialization library + +BOOST_CLASS_IMPLEMENTATION(boost::archive::library_version_type, primitive_type) +BOOST_CLASS_IMPLEMENTATION(boost::archive::version_type, primitive_type) +BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_type, primitive_type) +BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_reference_type, primitive_type) +BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_optional_type, primitive_type) +BOOST_CLASS_IMPLEMENTATION(boost::archive::class_name_type, primitive_type) +BOOST_CLASS_IMPLEMENTATION(boost::archive::object_id_type, primitive_type) +BOOST_CLASS_IMPLEMENTATION(boost::archive::object_reference_type, primitive_type) +BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type, primitive_type) + +#include + +// set types used internally by the serialization library +// to be bitwise serializable + +BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::library_version_type) +BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::version_type) +BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_type) +BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_reference_type) +BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_id_optional_type) +BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::class_name_type) +BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_id_type) +BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::object_reference_type) +BOOST_IS_BITWISE_SERIALIZABLE(boost::archive::tracking_type) + +#endif //BOOST_ARCHIVE_BASIC_ARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_binary_iarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_binary_iarchive.hpp new file mode 100644 index 0000000..d851dab --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_binary_iarchive.hpp @@ -0,0 +1,222 @@ +#ifndef BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP +#define BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_iarchive.hpp +// +// archives stored as native binary - this should be the fastest way +// to archive the state of a group of obects. It makes no attempt to +// convert to any canonical form. + +// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE +// ON PLATFORM APART FROM THE ONE THEY ARE CREATED ON + +// (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 +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +#include // must be the last header + +namespace boost { +namespace archive { + +///////////////////////////////////////////////////////////////////////// +// class basic_binary_iarchive - read serialized objects from a input binary stream +template +class basic_binary_iarchive : + public detail::common_iarchive +{ +protected: +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +public: +#elif defined(BOOST_MSVC) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; +#else + friend class detail::interface_iarchive; +#endif + // intermediate level to support override of operators + // fot templates in the absence of partial function + // template ordering. If we get here pass to base class + // note extra nonsense to sneak it pass the borland compiers + typedef detail::common_iarchive detail_common_iarchive; + template + void load_override(T & t, BOOST_PFTO int version){ + this->detail_common_iarchive::load_override(t, static_cast(version)); + } + + // include these to trap a change in binary format which + // isn't specifically handled + // upto 32K classes + BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t)); + BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t)); + // upto 2G objects + BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t)); + 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(tracking_type & t, int /*version*/){ + library_version_type lvt = this->get_library_version(); + if(boost::archive::library_version_type(6) < lvt){ + int_least8_t x=0; + * this->This() >> x; + t = boost::archive::tracking_type(x); + } + else{ + bool x=0; + * this->This() >> x; + t = boost::archive::tracking_type(x); + } + } + void load_override(class_id_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_type(x); + } + else{ + int x=0; + * this->This() >> x; + t = boost::archive::class_id_type(x); + } + } + void load_override(class_id_reference_type & t, int version){ + load_override(static_cast(t), version); + } +#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){ + 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){ + uint_least8_t x=0; + * this->This() >> x; + t = boost::archive::version_type(x); + } + else + if(boost::archive::library_version_type(5) < lvt){ + uint_least16_t x=0; + * this->This() >> x; + t = boost::archive::version_type(x); + } + else + if(boost::archive::library_version_type(2) < lvt){ + // upto 255 versions + unsigned char x=0; + * this->This() >> x; + t = version_type(x); + } + else{ + unsigned int x=0; + * this->This() >> x; + t = boost::archive::version_type(x); + } + } + + void load_override(boost::serialization::item_version_type & t, int version){ + 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); + } + else + if(boost::archive::library_version_type(6) < lvt){ + uint_least16_t x=0; + * this->This() >> x; + t = boost::serialization::item_version_type(x); + } + else{ + unsigned int x=0; + * this->This() >> x; + t = boost::serialization::item_version_type(x); + } + } + + void load_override(serialization::collection_size_type & t, int version){ + if(boost::archive::library_version_type(5) < this->get_library_version()){ + this->detail_common_iarchive::load_override(t, version); + } + else{ + unsigned int x=0; + * this->This() >> x; + t = serialization::collection_size_type(x); + } + } + + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_override(class_name_type & t, int); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(); + + basic_binary_iarchive(unsigned int flags) : + detail::common_iarchive(flags) + {} +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_binary_iprimitive.hpp b/3rdParty/Boost/src/boost/archive/basic_binary_iprimitive.hpp new file mode 100644 index 0000000..fc27123 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_binary_iprimitive.hpp @@ -0,0 +1,190 @@ +#ifndef BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP +#define BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#if defined(_MSC_VER) +#pragma warning( disable : 4800 ) +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_iprimitive.hpp +// +// archives stored as native binary - this should be the fastest way +// to archive the state of a group of obects. It makes no attempt to +// convert to any canonical form. + +// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE +// ON PLATFORM APART FROM THE ONE THEY ARE CREATED ON + +// (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 +#include +#include +#include // std::memcpy +#include // std::size_t +#include // basic_streambuf +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::memcpy; + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include // must be the last header + +namespace boost { +namespace archive { + +///////////////////////////////////////////////////////////////////////////// +// class binary_iarchive - read serialized objects from a input binary stream +template +class basic_binary_iprimitive +{ +#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS + friend class load_access; +protected: +#else +public: +#endif + std::basic_streambuf & m_sb; + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + + #ifndef BOOST_NO_STD_LOCALE + boost::scoped_ptr archive_locale; + basic_streambuf_locale_saver locale_saver; + #endif + + // main template for serilization of primitive types + template + void load(T & t){ + load_binary(& t, sizeof(T)); + } + + ///////////////////////////////////////////////////////// + // fundamental types that need special treatment + + // trap usage of invalid uninitialized boolean + void load(bool & t){ + load_binary(& t, sizeof(t)); + int i = t; + BOOST_ASSERT(0 == i || 1 == i); + (void)i; // warning suppression for release builds. + } + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load(std::string &s); + #ifndef BOOST_NO_STD_WSTRING + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load(std::wstring &ws); + #endif + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load(char * t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load(wchar_t * t); + + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + basic_binary_iprimitive( + std::basic_streambuf & sb, + bool no_codecvt + ); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + ~basic_binary_iprimitive(); +public: + // we provide an optimized load for all fundamental types + // typedef serialization::is_bitwise_serializable + // use_array_optimization; + struct use_array_optimization { + template + #if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS) + struct apply { + typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type; + }; + #else + struct apply : public boost::serialization::is_bitwise_serializable< T > {}; + #endif + }; + + // the optimized load_array dispatches to load_binary + template + void load_array(serialization::array& a, unsigned int) + { + load_binary(a.address(),a.count()*sizeof(ValueType)); + } + + void + load_binary(void *address, std::size_t count); +}; + +template +inline void +basic_binary_iprimitive::load_binary( + void *address, + std::size_t count +){ + // note: an optimizer should eliminate the following for char files + BOOST_ASSERT( + static_cast(count / sizeof(Elem)) + <= boost::integer_traits::const_max + ); + std::streamsize s = static_cast(count / sizeof(Elem)); + std::streamsize scount = m_sb.sgetn( + static_cast(address), + s + ); + if(scount != s) + boost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + // note: an optimizer should eliminate the following for char files + BOOST_ASSERT(count % sizeof(Elem) <= boost::integer_traits::const_max); + s = static_cast(count % sizeof(Elem)); + if(0 < s){ +// if(is.fail()) +// boost::serialization::throw_exception( +// archive_exception(archive_exception::stream_error) +// ); + Elem t; + scount = m_sb.sgetn(& t, 1); + if(scount != 1) + boost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + std::memcpy(static_cast(address) + (count - s), &t, s); + } +} + +} // namespace archive +} // namespace boost + +#include // pop pragmas + +#endif // BOOST_ARCHIVE_BINARY_IPRIMITIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_binary_oarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_binary_oarchive.hpp new file mode 100644 index 0000000..01622b9 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_binary_oarchive.hpp @@ -0,0 +1,180 @@ +#ifndef BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP +#define BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_oarchive.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. + +// archives stored as native binary - this should be the fastest way +// to archive the state of a group of obects. It makes no attempt to +// convert to any canonical form. + +// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE +// ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// class basic_binary_oarchive - write serialized objects to a binary output stream +// note: this archive has no pretensions to portability. Archive format +// may vary across machine architectures and compilers. About the only +// guarentee is that an archive created with this code will be readable +// by a program built with the same tools for the same machne. This class +// 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 basic_binary_oarchive : + public archive::detail::common_oarchive +{ +protected: +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +public: +#elif defined(BOOST_MSVC) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; +#else + friend class detail::interface_oarchive; +#endif + // any datatype not specifed below will be handled by base class + typedef detail::common_oarchive detail_common_oarchive; + template + void save_override(const T & t, BOOST_PFTO int version){ + this->detail_common_oarchive::save_override(t, static_cast(version)); + } + + // include these to trap a change in binary format which + // isn't specifically handled + BOOST_STATIC_ASSERT(sizeof(tracking_type) == sizeof(bool)); + // upto 32K classes + BOOST_STATIC_ASSERT(sizeof(class_id_type) == sizeof(int_least16_t)); + BOOST_STATIC_ASSERT(sizeof(class_id_reference_type) == sizeof(int_least16_t)); + // upto 2G objects + BOOST_STATIC_ASSERT(sizeof(object_id_type) == sizeof(uint_least32_t)); + 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){} + + // enable this if we decide to support generation of previous versions + #if 0 + void save_override(const boost::archive::version_type & t, int version){ + library_version_type lvt = this->get_library_version(); + if(boost::archive::library_version_type(7) < lvt){ + this->detail_common_oarchive::save_override(t, version); + } + else + if(boost::archive::library_version_type(6) < lvt){ + const boost::uint_least16_t x = t; + * this->This() << x; + } + else{ + const unsigned int x = t; + * this->This() << x; + } + } + void save_override(const boost::serialization::item_version_type & t, int version){ + library_version_type lvt = this->get_library_version(); + if(boost::archive::library_version_type(7) < lvt){ + this->detail_common_oarchive::save_override(t, version); + } + else + if(boost::archive::library_version_type(6) < lvt){ + const boost::uint_least16_t x = t; + * this->This() << x; + } + else{ + const unsigned int x = t; + * this->This() << x; + } + } + + void save_override(class_id_type & t, int version){ + library_version_type lvt = this->get_library_version(); + if(boost::archive::library_version_type(7) < lvt){ + this->detail_common_oarchive::save_override(t, version); + } + else + if(boost::archive::library_version_type(6) < lvt){ + const boost::int_least16_t x = t; + * this->This() << x; + } + else{ + const int x = t; + * this->This() << x; + } + } + void save_override(class_id_reference_type & t, int version){ + save_override(static_cast(t), version); + } + + #endif + + // explicitly convert to char * to avoid compile ambiguities + void save_override(const class_name_type & t, int){ + const std::string s(t); + * this->This() << s; + } + + #if 0 + void save_override(const serialization::collection_size_type & t, int){ + if (get_library_version() < boost::archive::library_version_type(6)){ + unsigned int x=0; + * this->This() >> x; + t = serialization::collection_size_type(x); + } + else{ + * this->This() >> t; + } + } + #endif + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(); + + basic_binary_oarchive(unsigned int flags) : + detail::common_oarchive(flags) + {} +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_binary_oprimitive.hpp b/3rdParty/Boost/src/boost/archive/basic_binary_oprimitive.hpp new file mode 100644 index 0000000..53e44e4 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_binary_oprimitive.hpp @@ -0,0 +1,184 @@ +#ifndef BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP +#define BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_oprimitive.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. + +// archives stored as native binary - this should be the fastest way +// to archive the state of a group of obects. It makes no attempt to +// convert to any canonical form. + +// IN GENERAL, ARCHIVES CREATED WITH THIS CLASS WILL NOT BE READABLE +// ON PLATFORM APART FROM THE ONE THEY ARE CREATE ON + +#include +#include +#include +#include // basic_streambuf +#include +#include // size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include // must be the last header + +namespace boost { +namespace archive { + +///////////////////////////////////////////////////////////////////////// +// class basic_binary_oprimitive - binary output of prmitives + +template +class basic_binary_oprimitive +{ +#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS + friend class save_access; +protected: +#else +public: +#endif + std::basic_streambuf & m_sb; + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + #ifndef BOOST_NO_STD_LOCALE + boost::scoped_ptr archive_locale; + basic_streambuf_locale_saver locale_saver; + #endif + // default saving of primitives. + template + void save(const T & t) + { + save_binary(& t, sizeof(T)); + } + + ///////////////////////////////////////////////////////// + // fundamental types that need special treatment + + // trap usage of invalid uninitialized boolean which would + // otherwise crash on load. + void save(const bool t){ + BOOST_ASSERT(0 == static_cast(t) || 1 == static_cast(t)); + save_binary(& t, sizeof(t)); + } + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save(const std::string &s); + #ifndef BOOST_NO_STD_WSTRING + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save(const char * t); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save(const wchar_t * t); + + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(); + + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + basic_binary_oprimitive( + std::basic_streambuf & sb, + bool no_codecvt + ); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + ~basic_binary_oprimitive(); +public: + + // we provide an optimized save for all fundamental types + // typedef serialization::is_bitwise_serializable + // use_array_optimization; + // workaround without using mpl lambdas + struct use_array_optimization { + template + #if defined(BOOST_NO_DEPENDENT_NESTED_DERIVATIONS) + struct apply { + typedef BOOST_DEDUCED_TYPENAME boost::serialization::is_bitwise_serializable< T >::type type; + }; + #else + struct apply : public boost::serialization::is_bitwise_serializable< T > {}; + #endif + }; + + + // the optimized save_array dispatches to save_binary + template + void save_array(boost::serialization::array const& a, unsigned int) + { + save_binary(a.address(),a.count()*sizeof(ValueType)); + } + + void save_binary(const void *address, std::size_t count); +}; + +template +inline void +basic_binary_oprimitive::save_binary( + const void *address, + std::size_t count +){ + //BOOST_ASSERT( + // static_cast((std::numeric_limits::max)()) >= count + //); + // note: if the following assertions fail + // a likely cause is that the output stream is set to "text" + // mode where by cr characters recieve special treatment. + // be sure that the output stream is opened with ios::binary + //if(os.fail()) + // boost::serialization::throw_exception( + // archive_exception(archive_exception::output_stream_error) + // ); + // figure number of elements to output - round up + count = ( count + sizeof(Elem) - 1) + / sizeof(Elem); + BOOST_ASSERT(count <= std::size_t(boost::integer_traits::const_max)); + std::streamsize scount = m_sb.sputn( + static_cast(address), + static_cast(count) + ); + if(count != static_cast(scount)) + boost::serialization::throw_exception( + archive_exception(archive_exception::output_stream_error) + ); + //os.write( + // static_cast(address), + // count + //); + //BOOST_ASSERT(os.good()); +} + +} //namespace boost +} //namespace archive + +#include // pop pragmas + +#endif // BOOST_ARCHIVE_BASIC_BINARY_OPRIMITIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_streambuf_locale_saver.hpp b/3rdParty/Boost/src/boost/archive/basic_streambuf_locale_saver.hpp new file mode 100644 index 0000000..ca764e1 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_streambuf_locale_saver.hpp @@ -0,0 +1,73 @@ +#ifndef BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP +#define BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_streambuf_local_saver.hpp + +// (C) Copyright 2005 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. + +// note derived from boost/io/ios_state.hpp +// Copyright 2002, 2005 Daryle Walker. Use, modification, and distribution +// are subject to the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or a copy at .) + +// See for the library's home page. + +#ifndef BOOST_NO_STD_LOCALE + +#include // for std::locale +#include // for std::basic_streambuf + +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost{ +namespace archive{ + +template < typename Ch, class Tr > +class basic_streambuf_locale_saver : + private boost::noncopyable +{ +public: + typedef ::std::basic_streambuf state_type; + typedef ::std::locale aspect_type; + explicit basic_streambuf_locale_saver( state_type &s ) + : s_save_( s ), a_save_( s.getloc() ) + {} + basic_streambuf_locale_saver( state_type &s, aspect_type const &a ) + : s_save_( s ), a_save_( s.pubimbue(a) ) + {} + ~basic_streambuf_locale_saver() + { this->restore(); } + void restore() + { s_save_.pubimbue( a_save_ ); } +private: + state_type & s_save_; + aspect_type const a_save_; +}; + +} // archive +} // boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_NO_STD_LOCALE +#endif // BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_text_iarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_text_iarchive.hpp new file mode 100644 index 0000000..729d51a --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_text_iarchive.hpp @@ -0,0 +1,91 @@ +#ifndef BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP +#define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_iarchive.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. + +// archives stored as text - note these ar templated on the basic +// stream templates to accommodate wide (and other?) kind of characters +// +// note the fact that on libraries without wide characters, ostream is +// is not a specialization of basic_ostream which in fact is not defined +// in such cases. So we can't use basic_ostream but rather +// use two template parameters + +#include +#include +#include + +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +///////////////////////////////////////////////////////////////////////// +// class basic_text_iarchive - read serialized objects from a input text stream +template +class basic_text_iarchive : + public detail::common_iarchive +{ +protected: +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +public: +#elif defined(BOOST_MSVC) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_iarchive; +#else + friend class detail::interface_iarchive; +#endif + // intermediate level to support override of operators + // fot templates in the absence of partial function + // template ordering + typedef detail::common_iarchive detail_common_iarchive; + template + void load_override(T & t, BOOST_PFTO int){ + this->detail_common_iarchive::load_override(t, 0); + } + // text file don't include the optional information + void load_override(class_id_optional_type & /*t*/, int){} + + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_override(class_name_type & t, int); + + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(void); + + basic_text_iarchive(unsigned int flags) : + detail::common_iarchive(flags) + {} + ~basic_text_iarchive(){} +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_text_iprimitive.hpp b/3rdParty/Boost/src/boost/archive/basic_text_iprimitive.hpp new file mode 100644 index 0000000..b927ec9 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_text_iprimitive.hpp @@ -0,0 +1,144 @@ +#ifndef BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP +#define BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_iprimitive.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. + +// archives stored as text - note these are templated on the basic +// stream templates to accommodate wide (and other?) kind of characters +// +// Note the fact that on libraries without wide characters, ostream is +// not a specialization of basic_ostream which in fact is not defined +// in such cases. So we can't use basic_ostream but rather +// use two template parameters + +#include +#include +#include // size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; + #if ! defined(BOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT) + using ::locale; + #endif +} // namespace std +#endif + +#include +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include // must be the last header + +namespace boost { +namespace archive { + +///////////////////////////////////////////////////////////////////////// +// class basic_text_iarchive - load serialized objects from a input text stream +#if defined(_MSC_VER) +#pragma warning( push ) +#pragma warning( disable : 4244 4267 ) +#endif + +template +class basic_text_iprimitive +{ +#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +protected: +#else +public: +#endif + IStream &is; + io::ios_flags_saver flags_saver; + io::ios_precision_saver precision_saver; + + #ifndef BOOST_NO_STD_LOCALE + boost::scoped_ptr archive_locale; + basic_streambuf_locale_saver< + BOOST_DEDUCED_TYPENAME IStream::char_type, + BOOST_DEDUCED_TYPENAME IStream::traits_type + > locale_saver; + #endif + + template + void load(T & t) + { + if(! is.fail()){ + is >> t; + return; + } + boost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + } + + void load(char & t) + { + short int i; + load(i); + t = i; + } + void load(signed char & t) + { + short int i; + load(i); + t = i; + } + void load(unsigned char & t) + { + unsigned short int i; + load(i); + t = i; + } + + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + void load(wchar_t & t) + { + BOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int)); + int i; + load(i); + t = i; + } + #endif + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + basic_text_iprimitive(IStream &is, bool no_codecvt); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + ~basic_text_iprimitive(); +public: + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_binary(void *address, std::size_t count); +}; + +#if defined(_MSC_VER) +#pragma warning( pop ) +#endif + +} // namespace archive +} // namespace boost + +#include // pop pragmas + +#endif // BOOST_ARCHIVE_BASIC_TEXT_IPRIMITIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_text_oarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_text_oarchive.hpp new file mode 100644 index 0000000..dd10f65 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_text_oarchive.hpp @@ -0,0 +1,116 @@ +#ifndef BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP +#define BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_oarchive.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. + +// archives stored as text - note these ar templated on the basic +// stream templates to accommodate wide (and other?) kind of characters +// +// note the fact that on libraries without wide characters, ostream is +// is not a specialization of basic_ostream which in fact is not defined +// in such cases. So we can't use basic_ostream but rather +// use two template parameters + +#include +#include +#include +#include + +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +///////////////////////////////////////////////////////////////////////// +// class basic_text_oarchive +template +class basic_text_oarchive : + public detail::common_oarchive +{ +protected: +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ +|| BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560)) +public: +#elif defined(BOOST_MSVC) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; +#else + friend class detail::interface_oarchive; +#endif + enum { + none, + eol, + space + } delimiter; + + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + newtoken(); + + void newline(){ + delimiter = eol; + } + + // default processing - kick back to base class. Note the + // extra stuff to get it passed borland compilers + typedef detail::common_oarchive detail_common_oarchive; + template + void save_override(T & t, BOOST_PFTO int){ + this->detail_common_oarchive::save_override(t, 0); + } + + // start new objects on a new line + void save_override(const object_id_type & t, int){ + this->This()->newline(); + this->detail_common_oarchive::save_override(t, 0); + } + + // text file don't include the optional information + void save_override(const class_id_optional_type & /* t */, int){} + + void save_override(const class_name_type & t, int){ + const std::string s(t); + * this->This() << s; + } + + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(); + + basic_text_oarchive(unsigned int flags) : + detail::common_oarchive(flags), + delimiter(none) + {} + ~basic_text_oarchive(){} +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_text_oprimitive.hpp b/3rdParty/Boost/src/boost/archive/basic_text_oprimitive.hpp new file mode 100644 index 0000000..06885ad --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_text_oprimitive.hpp @@ -0,0 +1,173 @@ +#ifndef BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP +#define BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_oprimitive.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. + +// archives stored as text - note these ar templated on the basic +// stream templates to accommodate wide (and other?) kind of characters +// +// note the fact that on libraries without wide characters, ostream is +// is not a specialization of basic_ostream which in fact is not defined +// in such cases. So we can't use basic_ostream but rather +// use two template parameters + +#include +#include +#include // isnan +#include +#include // size_t + +#include +#include +#include +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; + #if ! defined(BOOST_DINKUMWARE_STDLIB) && ! defined(__SGI_STL_PORT) + using ::locale; + #endif +} // namespace std +#endif + +#include +#include +#include +#include +#include +#include +#include +#include // must be the last header + +namespace boost { +namespace archive { + +class save_access; + +///////////////////////////////////////////////////////////////////////// +// class basic_text_oprimitive - output of prmitives to stream +template +class basic_text_oprimitive +{ +#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +protected: +#else +public: +#endif + OStream &os; + io::ios_flags_saver flags_saver; + io::ios_precision_saver precision_saver; + + #ifndef BOOST_NO_STD_LOCALE + boost::scoped_ptr archive_locale; + basic_streambuf_locale_saver< + BOOST_DEDUCED_TYPENAME OStream::char_type, + BOOST_DEDUCED_TYPENAME OStream::traits_type + > locale_saver; + #endif + + // default saving of primitives. + template + void save(const T &t){ + if(os.fail()) + boost::serialization::throw_exception( + archive_exception(archive_exception::output_stream_error) + ); + os << t; + } + + ///////////////////////////////////////////////////////// + // fundamental types that need special treatment + void save(const bool t){ + // trap usage of invalid uninitialized boolean which would + // otherwise crash on load. + BOOST_ASSERT(0 == static_cast(t) || 1 == static_cast(t)); + if(os.fail()) + boost::serialization::throw_exception( + archive_exception(archive_exception::output_stream_error) + ); + os << t; + } + void save(const signed char t) + { + save(static_cast(t)); + } + void save(const unsigned char t) + { + save(static_cast(t)); + } + void save(const char t) + { + save(static_cast(t)); + } + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + void save(const wchar_t t) + { + BOOST_STATIC_ASSERT(sizeof(wchar_t) <= sizeof(int)); + save(static_cast(t)); + } + #endif + void save(const float t) + { + // must be a user mistake - can't serialize un-initialized data + if(os.fail()) + boost::serialization::throw_exception( + archive_exception(archive_exception::output_stream_error) + ); + os << std::setprecision(std::numeric_limits::digits10 + 2); + os << t; + } + void save(const double t) + { + // must be a user mistake - can't serialize un-initialized data + if(os.fail()) + boost::serialization::throw_exception( + archive_exception(archive_exception::output_stream_error) + ); + os << std::setprecision(std::numeric_limits::digits10 + 2); + os << t; + } + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + basic_text_oprimitive(OStream & os, bool no_codecvt); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + ~basic_text_oprimitive(); +public: + // unformatted append of one character + void put(BOOST_DEDUCED_TYPENAME OStream::char_type c){ + if(os.fail()) + boost::serialization::throw_exception( + archive_exception(archive_exception::output_stream_error) + ); + os.put(c); + } + // unformatted append of null terminated string + void put(const char * s){ + while('\0' != *s) + os.put(*s++); + } + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_binary(const void *address, std::size_t count); +}; + +} //namespace boost +} //namespace archive + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_TEXT_OPRIMITIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_xml_archive.hpp b/3rdParty/Boost/src/boost/archive/basic_xml_archive.hpp new file mode 100644 index 0000000..c99d94f --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_xml_archive.hpp @@ -0,0 +1,67 @@ +#ifndef BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP +#define BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_archive.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 + +#include +#include // must be the last header + +namespace boost { +namespace archive { + +// constant strings used in xml i/o + +extern +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_OBJECT_ID(); + +extern +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_OBJECT_REFERENCE(); + +extern +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_CLASS_ID(); + +extern +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(); + +extern +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_CLASS_NAME(); + +extern +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_TRACKING(); + +extern +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_VERSION(); + +extern +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_SIGNATURE(); + +}// namespace archive +}// namespace boost + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_XML_TEXT_ARCHIVE_HPP + diff --git a/3rdParty/Boost/src/boost/archive/basic_xml_iarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_xml_iarchive.hpp new file mode 100644 index 0000000..d7b8bfd --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_xml_iarchive.hpp @@ -0,0 +1,127 @@ +#ifndef BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP +#define BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_iarchive.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 +#include +#include + +#include + +#include +#include + +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +///////////////////////////////////////////////////////////////////////// +// class xml_iarchive - read serialized objects from a input text stream +template +class basic_xml_iarchive : + public detail::common_iarchive +{ +protected: +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +public: +#elif defined(BOOST_MSVC) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; +#else + friend class detail::interface_oarchive; +#endif + unsigned int depth; + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + load_start(const char *name); + 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 + void load_override(T & t, BOOST_PFTO int) + { + // 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); + } + + // Anything not an attribute - see below - should be a name value + // pair and be processed here + typedef detail::common_iarchive detail_common_iarchive; + template + void load_override( + #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + const + #endif + boost::serialization::nvp< T > & t, + int + ){ + this->This()->load_start(t.name()); + this->detail_common_iarchive::load_override(t.value(), 0); + this->This()->load_end(t.name()); + } + + // specific overrides for attributes - handle as + // primitives. These are not name-value pairs + // 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 + // 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 + // 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); + // 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); + + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + basic_xml_iarchive(unsigned int flags); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + ~basic_xml_iarchive(); +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/basic_xml_oarchive.hpp b/3rdParty/Boost/src/boost/archive/basic_xml_oarchive.hpp new file mode 100644 index 0000000..b571372 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/basic_xml_oarchive.hpp @@ -0,0 +1,145 @@ +#ifndef BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP +#define BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_oarchive.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 + +#include + +#include +#include +#include + +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// class basic_xml_oarchive - write serialized objects to a xml output stream +template +class basic_xml_oarchive : + public detail::common_oarchive +{ +protected: +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) +public: +#elif defined(BOOST_MSVC) + // for some inexplicable reason insertion of "class" generates compile erro + // on msvc 7.1 + friend detail::interface_oarchive; + friend class save_access; +#else + friend class detail::interface_oarchive; + friend class save_access; +#endif + // special stuff for xml output + unsigned int depth; + bool indent_next; + bool pending_preamble; + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + indent(); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + init(); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + write_attribute( + const char *attribute_name, + int t, + const char *conjunction = "=\"" + ); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + write_attribute( + const char *attribute_name, + const char *key + ); + // helpers used below + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_start(const char *name); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) + save_end(const char *name); + 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 + void save_override(T & t, BOOST_PFTO int) + { + // 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); + } + + // special treatment for name-value pairs. + typedef detail::common_oarchive detail_common_oarchive; + template + void save_override( + #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + const + #endif + ::boost::serialization::nvp< T > & t, + int + ){ + this->This()->save_start(t.name()); + this->detail_common_oarchive::save_override(t.const_value(), 0); + 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(BOOST_PP_EMPTY()) + basic_xml_oarchive(unsigned int flags); + BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) + ~basic_xml_oarchive(); +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/binary_iarchive.hpp b/3rdParty/Boost/src/boost/archive/binary_iarchive.hpp new file mode 100644 index 0000000..638d996 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/binary_iarchive.hpp @@ -0,0 +1,103 @@ +#ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_HPP +#define BOOST_ARCHIVE_BINARY_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_iarchive.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 +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +// do not derive from the classes below. If you want to extend this functionality +// via inhertance, derived from text_iarchive_impl instead. This will +// preserve correct static polymorphism. + +// same as binary_iarchive below - without the shared_ptr_helper +class naked_binary_iarchive : + public binary_iarchive_impl< + boost::archive::naked_binary_iarchive, + std::istream::char_type, + std::istream::traits_type + > +{ +public: + naked_binary_iarchive(std::istream & is, unsigned int flags = 0) : + binary_iarchive_impl< + naked_binary_iarchive, std::istream::char_type, std::istream::traits_type + >(is, flags) + {} + naked_binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) : + binary_iarchive_impl< + naked_binary_iarchive, std::istream::char_type, std::istream::traits_type + >(bsb, flags) + {} +}; + +} // namespace archive +} // namespace boost + +// note special treatment of shared_ptr. This type needs a special +// structure associated with every archive. We created a "mix-in" +// class to provide this functionality. Since shared_ptr holds a +// special esteem in the boost library - we included it here by default. +#include + +namespace boost { +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 : + public binary_iarchive_impl< + boost::archive::binary_iarchive, + std::istream::char_type, + std::istream::traits_type + >, + public detail::shared_ptr_helper +{ +public: + binary_iarchive(std::istream & is, unsigned int flags = 0) : + binary_iarchive_impl< + binary_iarchive, std::istream::char_type, std::istream::traits_type + >(is, flags) + {} + binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) : + binary_iarchive_impl< + binary_iarchive, std::istream::char_type, std::istream::traits_type + >(bsb, flags) + {} +}; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_iarchive) +BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_iarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/binary_iarchive_impl.hpp b/3rdParty/Boost/src/boost/archive/binary_iarchive_impl.hpp new file mode 100644 index 0000000..32c476d --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/binary_iarchive_impl.hpp @@ -0,0 +1,96 @@ +#ifndef BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP +#define BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_iarchive_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 +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class binary_iarchive_impl : + public basic_binary_iprimitive, + public basic_binary_iarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_iarchive; + friend class basic_binary_iarchive; + friend class load_access; +protected: +#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 + void load_override(T & t, BOOST_PFTO int){ + this->basic_binary_iarchive::load_override(t, 0L); + } + void init(unsigned int flags){ + if(0 != (flags & no_header)) + return; + #if ! defined(__MWERKS__) + this->basic_binary_iarchive::init(); + this->basic_binary_iprimitive::init(); + #else + basic_binary_iarchive::init(); + basic_binary_iprimitive::init(); + #endif + } + binary_iarchive_impl( + std::basic_streambuf & bsb, + unsigned int flags + ) : + basic_binary_iprimitive( + bsb, + 0 != (flags & no_codecvt) + ), + basic_binary_iarchive(flags) + { + init(flags); + } + binary_iarchive_impl( + std::basic_istream & is, + unsigned int flags + ) : + basic_binary_iprimitive( + * is.rdbuf(), + 0 != (flags & no_codecvt) + ), + basic_binary_iarchive(flags) + { + init(flags); + } +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP diff --git a/3rdParty/Boost/src/boost/archive/binary_oarchive.hpp b/3rdParty/Boost/src/boost/archive/binary_oarchive.hpp new file mode 100644 index 0000000..2aac14f --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/binary_oarchive.hpp @@ -0,0 +1,66 @@ +#ifndef BOOST_ARCHIVE_BINARY_OARCHIVE_HPP +#define BOOST_ARCHIVE_BINARY_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_oarchive.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 +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +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 : + public binary_oarchive_impl< + binary_oarchive, std::ostream::char_type, std::ostream::traits_type + > +{ +public: + binary_oarchive(std::ostream & os, unsigned int flags = 0) : + binary_oarchive_impl< + binary_oarchive, std::ostream::char_type, std::ostream::traits_type + >(os, flags) + {} + binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) : + binary_oarchive_impl< + binary_oarchive, std::ostream::char_type, std::ostream::traits_type + >(bsb, flags) + {} +}; + +typedef binary_oarchive naked_binary_oarchive; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_oarchive) +BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_oarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_ARCHIVE_BINARY_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/binary_oarchive_impl.hpp b/3rdParty/Boost/src/boost/archive/binary_oarchive_impl.hpp new file mode 100644 index 0000000..7ca773b --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/binary_oarchive_impl.hpp @@ -0,0 +1,97 @@ +#ifndef BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP +#define BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_oarchive_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 +#include +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class binary_oarchive_impl : + public basic_binary_oprimitive, + public basic_binary_oarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_oarchive; + friend class basic_binary_oarchive; + friend class save_access; +protected: +#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 + void save_override(T & t, BOOST_PFTO int){ + this->basic_binary_oarchive::save_override(t, 0L); + } + void init(unsigned int flags) { + if(0 != (flags & no_header)) + return; + #if ! defined(__MWERKS__) + this->basic_binary_oarchive::init(); + this->basic_binary_oprimitive::init(); + #else + basic_binary_oarchive::init(); + basic_binary_oprimitive::init(); + #endif + } + binary_oarchive_impl( + std::basic_streambuf & bsb, + unsigned int flags + ) : + basic_binary_oprimitive( + bsb, + 0 != (flags & no_codecvt) + ), + basic_binary_oarchive(flags) + { + init(flags); + } + binary_oarchive_impl( + std::basic_ostream & os, + unsigned int flags + ) : + basic_binary_oprimitive( + * os.rdbuf(), + 0 != (flags & no_codecvt) + ), + basic_binary_oarchive(flags) + { + init(flags); + } +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP diff --git a/3rdParty/Boost/src/boost/archive/binary_wiarchive.hpp b/3rdParty/Boost/src/boost/archive/binary_wiarchive.hpp new file mode 100644 index 0000000..b5f6a71 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/binary_wiarchive.hpp @@ -0,0 +1,93 @@ +#ifndef BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP +#define BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_wiarchive.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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include // wistream +#include +#include + +namespace boost { +namespace archive { + +// same as binary_wiarchive below - without the shared_ptr_helper +class naked_binary_wiarchive : + public binary_iarchive_impl< + boost::archive::naked_binary_wiarchive, + std::wistream::char_type, + std::wistream::traits_type + > +{ +public: + naked_binary_wiarchive(std::wistream & is, unsigned int flags = 0) : + binary_iarchive_impl< + naked_binary_wiarchive, + std::wistream::char_type, + std::wistream::traits_type + >(is, flags) + {} + naked_binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) : + binary_iarchive_impl< + naked_binary_wiarchive, + std::wistream::char_type, + std::wistream::traits_type + >(bsb, flags) + {} +}; + +} // namespace archive +} // namespace boost + +// note special treatment of shared_ptr. This type needs a special +// structure associated with every archive. We created a "mix-in" +// class to provide this functionality. Since shared_ptr holds a +// special esteem in the boost library - we included it here by default. +#include + +namespace boost { +namespace archive { + +class binary_wiarchive : + public binary_iarchive_impl< + binary_wiarchive, std::wistream::char_type, std::wistream::traits_type + > +{ +public: + binary_wiarchive(std::wistream & is, unsigned int flags = 0) : + binary_iarchive_impl< + binary_wiarchive, std::wistream::char_type, std::wistream::traits_type + >(is, flags) + {} + binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) : + binary_iarchive_impl< + binary_wiarchive, std::wistream::char_type, std::wistream::traits_type + >(bsb, flags) + {} +}; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_wiarchive) + +#endif // BOOST_NO_STD_WSTREAMBUF +#endif // BOOST_ARCHIVE_BINARY_WIARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/binary_woarchive.hpp b/3rdParty/Boost/src/boost/archive/binary_woarchive.hpp new file mode 100644 index 0000000..2075dac --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/binary_woarchive.hpp @@ -0,0 +1,61 @@ +#ifndef BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP +#define BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_woarchive.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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include +#include +#include + +namespace boost { +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_woarchive : + public binary_oarchive_impl< + binary_woarchive, std::wostream::char_type, std::wostream::traits_type + > +{ +public: + binary_woarchive(std::wostream & os, unsigned int flags = 0) : + binary_oarchive_impl< + binary_woarchive, std::wostream::char_type, std::wostream::traits_type + >(os, flags) + {} + binary_woarchive(std::wstreambuf & bsb, unsigned int flags = 0) : + binary_oarchive_impl< + binary_woarchive, std::wostream::char_type, std::wostream::traits_type + >(bsb, flags) + {} +}; + +typedef binary_woarchive naked_binary_woarchive; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_woarchive) + +#endif // BOOST_NO_STD_WSTREAMBUF +#endif // BOOST_ARCHIVE_BINARY_WOARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/codecvt_null.hpp b/3rdParty/Boost/src/boost/archive/codecvt_null.hpp new file mode 100644 index 0000000..910b261 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/codecvt_null.hpp @@ -0,0 +1,100 @@ +#ifndef BOOST_ARCHIVE_CODECVT_NULL_HPP +#define BOOST_ARCHIVE_CODECVT_NULL_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// codecvt_null.hpp: + +// (C) Copyright 2004 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for updates, documentation, and revision history. + +#include +#include // NULL, size_t +#include // for mbstate_t +#include +#include +#include // must be the last header + +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std { +// For STLport on WinCE, BOOST_NO_STDC_NAMESPACE can get defined if STLport is putting symbols in its own namespace. +// In the case of codecvt, however, this does not mean that codecvt is in the global namespace (it will be in STLport's namespace) +# if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) + using ::codecvt; +# endif + using ::mbstate_t; + using ::size_t; +} // namespace +#endif + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class codecvt_null; + +template<> +class codecvt_null : public std::codecvt +{ + virtual bool do_always_noconv() const throw() { + return true; + } +public: + explicit codecvt_null(std::size_t no_locale_manage = 0) : + std::codecvt(no_locale_manage) + {} +}; + +template<> +class codecvt_null : public std::codecvt +{ + virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result) + do_out( + std::mbstate_t & state, + const wchar_t * first1, + const wchar_t * last1, + const wchar_t * & next1, + char * first2, + char * last2, + char * & next2 + ) const; + virtual BOOST_WARCHIVE_DECL(std::codecvt_base::result) + do_in( + std::mbstate_t & state, + const char * first1, + const char * last1, + const char * & next1, + wchar_t * first2, + wchar_t * last2, + wchar_t * & next2 + ) const; + virtual int do_encoding( ) const throw( ){ + return sizeof(wchar_t) / sizeof(char); + } + virtual int do_max_length( ) const throw( ){ + return do_encoding(); + } +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif +#include // pop pragmas + +#endif //BOOST_ARCHIVE_CODECVT_NULL_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/abi_prefix.hpp b/3rdParty/Boost/src/boost/archive/detail/abi_prefix.hpp new file mode 100644 index 0000000..e39ef11 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/abi_prefix.hpp @@ -0,0 +1,20 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// abi_prefix.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 // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275) +#endif + +#if defined( __BORLANDC__ ) +#pragma nopushoptwarn +#endif + diff --git a/3rdParty/Boost/src/boost/archive/detail/abi_suffix.hpp b/3rdParty/Boost/src/boost/archive/detail/abi_suffix.hpp new file mode 100644 index 0000000..a283b36 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/abi_suffix.hpp @@ -0,0 +1,19 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// abi_suffix.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. + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +#include // pops abi_suffix.hpp pragmas + +#if defined( __BORLANDC__ ) +#pragma nopushoptwarn +#endif + diff --git a/3rdParty/Boost/src/boost/archive/detail/archive_serializer_map.hpp b/3rdParty/Boost/src/boost/archive/detail/archive_serializer_map.hpp new file mode 100644 index 0000000..6d2eec4 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/archive_serializer_map.hpp @@ -0,0 +1,55 @@ +#ifndef BOOST_ARCHIVE_SERIALIZER_MAP_HPP +#define BOOST_ARCHIVE_SERIALIZER_MAP_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// archive_serializer_map.hpp: extenstion of type_info required for +// serialization. + +// (C) Copyright 2009 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. + +// note: this is nothing more than the thinest of wrappers around +// basic_serializer_map so we can have a one map / archive type. + +#include +#include +#include // must be the last header + +namespace boost { + +namespace serialization { + class extended_type_info; +} // namespace serialization + +namespace archive { +namespace detail { + +class basic_serializer; + +template +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +archive_serializer_map { +public: + static bool insert(const basic_serializer * bs); + static void erase(const basic_serializer * bs); + static const basic_serializer * find( + const boost::serialization::extended_type_info & type_ + ); +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#include // must be the last header + +#endif //BOOST_ARCHIVE_SERIALIZER_MAP_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/auto_link_archive.hpp b/3rdParty/Boost/src/boost/archive/detail/auto_link_archive.hpp new file mode 100644 index 0000000..05956f0 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/auto_link_archive.hpp @@ -0,0 +1,48 @@ +#ifndef BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP +#define BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// auto_link_archive.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 + +// enable automatic library variant selection ------------------------------// + +#include + +#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SERIALIZATION_NO_LIB) \ +&& !defined(BOOST_ARCHIVE_SOURCE) && !defined(BOOST_WARCHIVE_SOURCE) \ +&& !defined(BOOST_SERIALIZATION_SOURCE) + + // Set the name of our library, this will get undef'ed by auto_link.hpp + // once it's done with it: + // + #define BOOST_LIB_NAME boost_serialization + // + // If we're importing code from a dll, then tell auto_link.hpp about it: + // + #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK) + # define BOOST_DYN_LINK + #endif + // + // And include the header that does the work: + // + #include +#endif // auto-linking disabled + +#endif // BOOST_ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/auto_link_warchive.hpp b/3rdParty/Boost/src/boost/archive/detail/auto_link_warchive.hpp new file mode 100644 index 0000000..4d4efcd --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/auto_link_warchive.hpp @@ -0,0 +1,47 @@ +#ifndef BOOST_ARCHIVE_DETAIL_AUTO_LINK_WARCHIVE_HPP +#define BOOST_ARCHIVE_DETAIL_AUTO_LINK_WARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// auto_link_warchive.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 + +// enable automatic library variant selection ------------------------------// + +#include + +#if !defined(BOOST_WARCHIVE_SOURCE) \ +&& !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SERIALIZATION_NO_LIB) + +// Set the name of our library, this will get undef'ed by auto_link.hpp +// once it's done with it: +// +#define BOOST_LIB_NAME boost_wserialization +// +// If we're importing code from a dll, then tell auto_link.hpp about it: +// +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK) +# define BOOST_DYN_LINK +#endif +// +// And include the header that does the work: +// +#include +#endif // auto-linking disabled + +#endif // ARCHIVE_DETAIL_AUTO_LINK_ARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_iarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_iarchive.hpp new file mode 100644 index 0000000..f62987e --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/basic_iarchive.hpp @@ -0,0 +1,110 @@ +#ifndef BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP +#define BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_iarchive.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. + +// can't use this - much as I'd like to as borland doesn't support it +// #include + +#include +#include + +#include +#include +#include +#include +#include // must be the last header + +namespace boost { +namespace serialization { + class extended_type_info; +} // namespace serialization + +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_iarchive - read serialized objects from a input stream +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : + private boost::noncopyable +{ + friend class basic_iarchive_impl; + // hide implementation of this class to minimize header conclusion + // in client code. I couldn't used scoped pointer with borland + // boost::scoped_ptr pimpl; + basic_iarchive_impl * pimpl; + + virtual void vload(version_type &t) = 0; + virtual void vload(object_id_type &t) = 0; + virtual void vload(class_id_type &t) = 0; + virtual void vload(class_id_optional_type &t) = 0; + virtual void vload(class_name_type &t) = 0; + virtual void vload(tracking_type &t) = 0; +protected: + basic_iarchive(unsigned int flags); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_iarchive(); +public: + // note: NOT part of the public API. + void next_object_pointer(void *t); + void register_basic_serializer( + const basic_iserializer & bis + ); + void load_object( + void *t, + const basic_iserializer & bis + ); + 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 + set_library_version(library_version_type archive_library_version); + library_version_type + get_library_version() const; + unsigned int + get_flags() const; + void + reset_object_address(const void * new_address, const void * old_address); + void + delete_created_pointers(); +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +// required by smart_cast for compilers not implementing +// partial template specialization +BOOST_TT_BROKEN_COMPILER_SPEC( + boost::archive::detail::basic_iarchive +) + +#include // pops abi_suffix.hpp pragmas + +#endif //BOOST_ARCHIVE_DETAIL_BASIC_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_iserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_iserializer.hpp new file mode 100644 index 0000000..2f4f6d8 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/basic_iserializer.hpp @@ -0,0 +1,95 @@ +#ifndef BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP +#define BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_iserializer.hpp: extenstion of type_info required for serialization. + +// (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 // NULL +#include + +#include +#include +#include +#include +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace serialization { + class extended_type_info; +} // namespace serialization + +// forward declarations +namespace archive { +namespace detail { + +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; + +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer : + public basic_serializer +{ +private: + basic_pointer_iserializer *m_bpis; +protected: + explicit basic_iserializer( + const boost::serialization::extended_type_info & type + ); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_iserializer(); +public: + bool serialized_as_pointer() const { + return m_bpis != NULL; + } + void set_bpis(basic_pointer_iserializer *bpis){ + m_bpis = bpis; + } + const basic_pointer_iserializer * get_bpis_ptr() const { + return m_bpis; + } + virtual void load_object_data( + basic_iarchive & ar, + void *x, + const unsigned int file_version + ) const = 0; + // returns true if class_info should be saved + virtual bool class_info() const = 0 ; + // returns true if objects should be tracked + virtual bool tracking(const unsigned int) const = 0 ; + // returns class version + virtual version_type version() const = 0 ; + // returns true if this class is polymorphic + virtual bool is_polymorphic() const = 0; + virtual void destroy(/*const*/ void *address) const = 0 ; +}; + +} // namespae detail +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_oarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_oarchive.hpp new file mode 100644 index 0000000..402e569 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/basic_oarchive.hpp @@ -0,0 +1,106 @@ +#ifndef BOOST_ARCHIVE_BASIC_OARCHIVE_HPP +#define BOOST_ARCHIVE_BASIC_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_oarchive.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 // NULL +#include +#include + +#include + +// can't use this - much as I'd like to as borland doesn't support it +// #include + +#include +#include + +#include // must be the last header + +namespace boost { +namespace serialization { + class extended_type_info; +} // namespace serialization + +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_oarchive - write serialized objects to an output stream +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : + private boost::noncopyable +{ + friend class basic_oarchive_impl; + // hide implementation of this class to minimize header conclusion + // in client code. note: borland can't use scoped_ptr + //boost::scoped_ptr pimpl; + basic_oarchive_impl * pimpl; + + // overload these to bracket object attributes. Used to implement + // xml archives + virtual void vsave(const version_type t) = 0; + virtual void vsave(const object_id_type t) = 0; + virtual void vsave(const object_reference_type t) = 0; + virtual void vsave(const class_id_type t) = 0; + virtual void vsave(const class_id_optional_type t) = 0; + virtual void vsave(const class_id_reference_type t) = 0; + virtual void vsave(const class_name_type & t) = 0; + virtual void vsave(const tracking_type t) = 0; +protected: + basic_oarchive(unsigned int flags = 0); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_oarchive(); +public: + // note: NOT part of the public interface + void register_basic_serializer( + const basic_oserializer & bos + ); + void save_object( + const void *x, + const basic_oserializer & bos + ); + void save_pointer( + const void * t, + const basic_pointer_oserializer * bpos_ptr + ); + void save_null_pointer(){ + 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; +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +// required by smart_cast for compilers not implementing +// partial template specialization +BOOST_TT_BROKEN_COMPILER_SPEC( + boost::archive::detail::basic_oarchive +) + +#include // pops abi_suffix.hpp pragmas + +#endif //BOOST_ARCHIVE_BASIC_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_oserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_oserializer.hpp new file mode 100644 index 0000000..74af7e6 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/basic_oserializer.hpp @@ -0,0 +1,93 @@ +#ifndef BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP +#define BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_oserializer.hpp: extenstion of type_info required for serialization. + +// (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 // NULL +#include +#include + +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace serialization { + class extended_type_info; +} // namespace serialization + +// forward declarations +namespace archive { +namespace detail { + +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive; +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; + +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer : + public basic_serializer +{ +private: + basic_pointer_oserializer *m_bpos; +protected: + explicit basic_oserializer( + const boost::serialization::extended_type_info & type_ + ); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_oserializer(); +public: + bool serialized_as_pointer() const { + return m_bpos != NULL; + } + void set_bpos(basic_pointer_oserializer *bpos){ + m_bpos = bpos; + } + const basic_pointer_oserializer * get_bpos() const { + return m_bpos; + } + virtual void save_object_data( + basic_oarchive & ar, const void * x + ) const = 0; + // returns true if class_info should be saved + virtual bool class_info() const = 0; + // returns true if objects should be tracked + virtual bool tracking(const unsigned int flags) const = 0; + // returns class version + virtual version_type version() const = 0; + // returns true if this class is polymorphic + virtual bool is_polymorphic() const = 0; +}; + +} // namespace detail +} // namespace serialization +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_pointer_iserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_pointer_iserializer.hpp new file mode 100644 index 0000000..d957b83 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/basic_pointer_iserializer.hpp @@ -0,0 +1,73 @@ +#ifndef BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP +#define BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_pointer_oserializer.hpp: extenstion of type_info required for +// serialization. + +// (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 +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace serialization { + class extended_type_info; +} // namespace serialization + +// forward declarations +namespace archive { +namespace detail { + +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive; +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; + +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer + : public basic_serializer { +protected: + explicit basic_pointer_iserializer( + const boost::serialization::extended_type_info & type_ + ); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_pointer_iserializer(); +public: + virtual const basic_iserializer & get_basic_serializer() const = 0; + virtual void load_object_ptr( + basic_iarchive & ar, + void * & x, + const unsigned int file_version + ) const = 0; +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_pointer_oserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_pointer_oserializer.hpp new file mode 100644 index 0000000..b0d3fb9 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/basic_pointer_oserializer.hpp @@ -0,0 +1,72 @@ +#ifndef BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP +#define BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_pointer_oserializer.hpp: extenstion of type_info required for +// serialization. + +// (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 +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace serialization { + class extended_type_info; +} // 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(BOOST_PP_EMPTY()) basic_pointer_oserializer : + public basic_serializer +{ +protected: + explicit basic_pointer_oserializer( + const boost::serialization::extended_type_info & type_ + ); +public: + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~basic_pointer_oserializer(); + virtual const basic_oserializer & get_basic_serializer() const = 0; + virtual void save_object_ptr( + basic_oarchive & ar, + const void * x + ) const = 0; +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_serializer.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_serializer.hpp new file mode 100644 index 0000000..5dbd886 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/basic_serializer.hpp @@ -0,0 +1,79 @@ +#ifndef BOOST_ARCHIVE_BASIC_SERIALIZER_HPP +#define BOOST_ARCHIVE_BASIC_SERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_serializer.hpp: extenstion of type_info required for serialization. + +// (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 +#include // NULL + +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { +namespace detail { + +class basic_serializer : + private boost::noncopyable +{ + const boost::serialization::extended_type_info * m_eti; +protected: + explicit basic_serializer( + const boost::serialization::extended_type_info & eti + ) : + m_eti(& eti) + { + BOOST_ASSERT(NULL != & eti); + } +public: + inline bool + operator<(const basic_serializer & rhs) const { + // can't compare address since there can be multiple eti records + // for the same type in different execution modules (that is, DLLS) + // leave this here as a reminder not to do this! + // return & lhs.get_eti() < & rhs.get_eti(); + return get_eti() < rhs.get_eti(); + } + const char * get_debug_info() const { + return m_eti->get_debug_info(); + } + const boost::serialization::extended_type_info & get_eti() const { + return * m_eti; + } +}; + +class basic_serializer_arg : public basic_serializer { +public: + basic_serializer_arg(const serialization::extended_type_info & eti) : + basic_serializer(eti) + {} +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_ARCHIVE_BASIC_SERIALIZER_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/basic_serializer_map.hpp b/3rdParty/Boost/src/boost/archive/detail/basic_serializer_map.hpp new file mode 100644 index 0000000..a991ea1 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/basic_serializer_map.hpp @@ -0,0 +1,69 @@ +#ifndef BOOST_SERIALIZER_MAP_HPP +#define BOOST_SERIALIZER_MAP_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_serializer_map.hpp: extenstion of type_info required for serialization. + +// (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 + +#include +#include +#include + +#include // must be the last header + +namespace boost { +namespace serialization { + class extended_type_info; +} + +namespace archive { +namespace detail { + +class basic_serializer; + +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_serializer_map : public + boost::noncopyable +{ + struct type_info_pointer_compare + { + bool operator()( + const basic_serializer * lhs, const basic_serializer * rhs + ) const ; + }; + typedef std::set< + const basic_serializer *, + type_info_pointer_compare + > map_type; + map_type m_map; +public: + bool insert(const basic_serializer * bs); + void erase(const basic_serializer * bs); + const basic_serializer * find( + const boost::serialization::extended_type_info & type_ + ) const; +private: + // cw 8.3 requires this + basic_serializer_map& operator=(basic_serializer_map const&); +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#include // must be the last header + +#endif // BOOST_SERIALIZER_MAP_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/check.hpp b/3rdParty/Boost/src/boost/archive/detail/check.hpp new file mode 100644 index 0000000..c9cba51 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/check.hpp @@ -0,0 +1,169 @@ +#ifndef BOOST_ARCHIVE_DETAIL_CHECK_HPP +#define BOOST_ARCHIVE_DETAIL_CHECK_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#pragma inline_depth(511) +#pragma inline_recursion(on) +#endif + +#if defined(__MWERKS__) +#pragma inline_depth(511) +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// check.hpp: interface for serialization system. + +// (C) Copyright 2009 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 + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace boost { +namespace archive { +namespace detail { + +// checks for objects + +template +inline void check_object_level(){ + typedef + BOOST_DEDUCED_TYPENAME mpl::greater_equal< + serialization::implementation_level< T >, + mpl::int_ + >::type typex; + + // trap attempts to serialize objects marked + // not_serializable + BOOST_STATIC_ASSERT(typex::value); +} + +template +inline void check_object_versioning(){ + typedef + BOOST_DEDUCED_TYPENAME mpl::or_< + BOOST_DEDUCED_TYPENAME mpl::greater< + serialization::implementation_level< T >, + mpl::int_ + >, + BOOST_DEDUCED_TYPENAME mpl::equal_to< + serialization::version< T >, + mpl::int_<0> + > + > typex; + // trap attempts to serialize with objects that don't + // save class information in the archive with versioning. + BOOST_STATIC_ASSERT(typex::value); +} + +template +inline void check_object_tracking(){ + // presume it has already been determined that + // T is not a const + BOOST_STATIC_ASSERT(! boost::is_const< T >::value); + typedef BOOST_DEDUCED_TYPENAME mpl::equal_to< + serialization::tracking_level< T >, + mpl::int_ + >::type typex; + // saving an non-const object of a type not marked "track_never) + + // may be an indicator of an error usage of the + // serialization library and should be double checked. + // See documentation on object tracking. Also, see the + // "rationale" section of the documenation + // for motivation for this checking. + + BOOST_STATIC_WARNING(typex::value); +} + +// checks for pointers + +template +inline void check_pointer_level(){ + // we should only invoke this once we KNOW that T + // has been used as a pointer!! + typedef + BOOST_DEDUCED_TYPENAME mpl::or_< + BOOST_DEDUCED_TYPENAME mpl::greater< + serialization::implementation_level< T >, + mpl::int_ + >, + BOOST_DEDUCED_TYPENAME mpl::not_< + BOOST_DEDUCED_TYPENAME mpl::equal_to< + serialization::tracking_level< T >, + mpl::int_ + > + > + > typex; + // Address the following when serializing to a pointer: + + // a) This type doesn't save class information in the + // archive. That is, the serialization trait implementation + // level <= object_serializable. + // b) Tracking for this type is set to "track selectively" + + // in this case, indication that an object is tracked is + // not stored in the archive itself - see level == object_serializable + // but rather the existence of the operation ar >> T * is used to + // infer that an object of this type should be tracked. So, if + // you save via a pointer but don't load via a pointer the operation + // will fail on load without given any valid reason for the failure. + + // So if your program traps here, consider changing the + // tracking or implementation level traits - or not + // serializing via a pointer. + BOOST_STATIC_WARNING(typex::value); +} + +template +void inline check_pointer_tracking(){ + typedef BOOST_DEDUCED_TYPENAME mpl::greater< + serialization::tracking_level< T >, + mpl::int_ + >::type typex; + // serializing an object of a type marked "track_never" through a pointer + // could result in creating more objects than were saved! + BOOST_STATIC_WARNING(typex::value); +} + +template +inline void check_const_loading(){ + typedef + BOOST_DEDUCED_TYPENAME mpl::or_< + BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper< T >, + BOOST_DEDUCED_TYPENAME mpl::not_< + BOOST_DEDUCED_TYPENAME boost::is_const< T > + > + >::type typex; + // cannot load data into a "const" object unless it's a + // wrapper around some other non-const object. + BOOST_STATIC_ASSERT(typex::value); +} + +} // detail +} // archive +} // boost + +#endif // BOOST_ARCHIVE_DETAIL_CHECK_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/common_iarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/common_iarchive.hpp new file mode 100644 index 0000000..54c07c3 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/common_iarchive.hpp @@ -0,0 +1,88 @@ +#ifndef BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP +#define BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// common_iarchive.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 + +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { +namespace detail { + +class extended_type_info; + +// note: referred to as Curiously Recurring Template Patter (CRTP) +template +class common_iarchive : + public basic_iarchive, + public interface_iarchive +{ + friend class interface_iarchive; +private: + virtual void vload(version_type & t){ + * this->This() >> t; + } + virtual void vload(object_id_type & t){ + * this->This() >> t; + } + virtual void vload(class_id_type & t){ + * this->This() >> t; + } + virtual void vload(class_id_optional_type & t){ + * this->This() >> t; + } + virtual void vload(tracking_type & t){ + * this->This() >> t; + } + virtual void vload(class_name_type &s){ + * this->This() >> s; + } +protected: + // default processing - invoke serialization library + template + void load_override(T & t, BOOST_PFTO int){ + archive::load(* this->This(), t); + } + // default implementations of functions which emit start/end tags for + // archive types that require them. + void load_start(const char * /*name*/){} + void load_end(const char * /*name*/){} + // default archive initialization + common_iarchive(unsigned int flags = 0) : + basic_iarchive(flags), + interface_iarchive() + {} +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP + diff --git a/3rdParty/Boost/src/boost/archive/detail/common_oarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/common_oarchive.hpp new file mode 100644 index 0000000..7962063 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/common_oarchive.hpp @@ -0,0 +1,87 @@ +#ifndef BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP +#define BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// common_oarchive.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 + +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { +namespace detail { + +// note: referred to as Curiously Recurring Template Patter (CRTP) +template +class common_oarchive : + public basic_oarchive, + public interface_oarchive +{ + friend class interface_oarchive; +private: + virtual void vsave(const version_type t){ + * this->This() << t; + } + virtual void vsave(const object_id_type t){ + * this->This() << t; + } + virtual void vsave(const object_reference_type t){ + * this->This() << t; + } + virtual void vsave(const class_id_type t){ + * this->This() << t; + } + virtual void vsave(const class_id_reference_type t){ + * this->This() << t; + } + virtual void vsave(const class_id_optional_type t){ + * this->This() << t; + } + virtual void vsave(const class_name_type & t){ + * this->This() << t; + } + virtual void vsave(const tracking_type t){ + * this->This() << t; + } +protected: + // default processing - invoke serialization library + template + void save_override(T & t, BOOST_PFTO int){ + archive::save(* this->This(), t); + } + void save_start(const char * /*name*/){} + void save_end(const char * /*name*/){} + common_oarchive(unsigned int flags = 0) : + basic_oarchive(flags), + interface_oarchive() + {} +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/decl.hpp b/3rdParty/Boost/src/boost/archive/detail/decl.hpp new file mode 100644 index 0000000..9695001 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/decl.hpp @@ -0,0 +1,79 @@ +#ifndef BOOST_ARCHIVE_DETAIL_DECL_HPP +#define BOOST_ARCHIVE_DETAIL_DECL_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2///////// 3/////////4/////////5/////////6/////////7/////////8 +// decl.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 +#include + +#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 + #endif +#endif // BOOST_HAS_DECLSPEC + +#if ! defined(BOOST_ARCHIVE_DECL) + #define BOOST_ARCHIVE_DECL(T) T +#endif +#if ! defined(BOOST_WARCHIVE_DECL) + #define BOOST_WARCHIVE_DECL(T) T +#endif +#if ! defined(BOOST_ARCHIVE_OR_WARCHIVE_DECL) + #define BOOST_ARCHIVE_OR_WARCHIVE_DECL(T) T +#endif + +#endif // BOOST_ARCHIVE_DETAIL_DECL_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/interface_iarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/interface_iarchive.hpp new file mode 100644 index 0000000..0648752 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/interface_iarchive.hpp @@ -0,0 +1,77 @@ +#ifndef BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP +#define BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// interface_iarchive.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 // NULL +#include +#include +#include +#include +#include +#include // must be the last header + +namespace boost { +namespace archive { +namespace detail { + +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; + +template +class interface_iarchive +{ +protected: + interface_iarchive(){}; +public: + ///////////////////////////////////////////////////////// + // archive public interface + typedef mpl::bool_ is_loading; + typedef mpl::bool_ is_saving; + + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + + template + const basic_pointer_iserializer * + register_type(T * = NULL){ + const basic_pointer_iserializer & bpis = + boost::serialization::singleton< + pointer_iserializer + >::get_const_instance(); + this->This()->register_basic_serializer(bpis.get_basic_serializer()); + return & bpis; + } + template + Archive & operator>>(T & t){ + this->This()->load_override(t, 0); + return * this->This(); + } + + // the & operator + template + Archive & operator&(T & t){ + return *(this->This()) >> t; + } +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/interface_oarchive.hpp b/3rdParty/Boost/src/boost/archive/detail/interface_oarchive.hpp new file mode 100644 index 0000000..e8db7a2 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/interface_oarchive.hpp @@ -0,0 +1,84 @@ +#ifndef BOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP +#define BOOST_ARCHIVE_DETAIL_INTERFACE_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// interface_oarchive.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 // NULL +#include +#include + +#include +#include +#include // must be the last header + +#include + +namespace boost { +namespace archive { +namespace detail { + +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; + +template +class interface_oarchive +{ +protected: + interface_oarchive(){}; +public: + ///////////////////////////////////////////////////////// + // archive public interface + typedef mpl::bool_ is_loading; + typedef mpl::bool_ is_saving; + + // return a pointer to the most derived class + Archive * This(){ + return static_cast(this); + } + + template + const basic_pointer_oserializer * + register_type(const T * = NULL){ + const basic_pointer_oserializer & bpos = + boost::serialization::singleton< + pointer_oserializer + >::get_const_instance(); + this->This()->register_basic_serializer(bpos.get_basic_serializer()); + return & bpos; + } + + template + Archive & operator<<(T & t){ + this->This()->save_override(t, 0); + return * this->This(); + } + + // the & operator + template + Archive & operator&(T & t){ + #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + return * this->This() << const_cast(t); + #else + return * this->This() << t; + #endif + } +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_DETAIL_INTERFACE_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/iserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/iserializer.hpp new file mode 100644 index 0000000..53765af --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/iserializer.hpp @@ -0,0 +1,632 @@ +#ifndef BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP +#define BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#pragma inline_depth(511) +#pragma inline_recursion(on) +#endif + +#if defined(__MWERKS__) +#pragma inline_depth(511) +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// iserializer.hpp: interface for serialization system. + +// (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 // for placement new +#include // for auto_ptr +#include // size_t, NULL + +#include +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include + +#include +#include +#include +#include +#include +#include + +#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO + #include +#endif +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#define DONT_USE_HAS_NEW_OPERATOR ( \ + defined(__BORLANDC__) \ + || BOOST_WORKAROUND(__IBMCPP__, < 1210) \ + || defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) \ + || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \ +) + +#if ! DONT_USE_HAS_NEW_OPERATOR +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// the following is need only for dynamic cast of polymorphic pointers +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace serialization { + class extended_type_info; +} // namespace serialization + +namespace archive { + +// an accessor to permit friend access to archives. Needed because +// some compilers don't handle friend templates completely +class load_access { +public: + template + static void load_primitive(Archive &ar, T &t){ + ar.load(t); + } +}; + +namespace detail { + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +template +class iserializer : public basic_iserializer +{ +private: + virtual void destroy(/*const*/ void *address) const { + boost::serialization::access::destroy(static_cast(address)); + } +protected: + // protected constructor since it's always created by singleton + explicit iserializer() : + basic_iserializer( + boost::serialization::singleton< + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation< T >::type + >::get_const_instance() + ) + {} +public: + virtual BOOST_DLLEXPORT void load_object_data( + basic_iarchive & ar, + void *x, + const unsigned int file_version + ) const BOOST_USED; + virtual bool class_info() const { + return boost::serialization::implementation_level< T >::value + >= boost::serialization::object_class_info; + } + virtual bool tracking(const unsigned int /* flags */) const { + return boost::serialization::tracking_level< T >::value + == boost::serialization::track_always + || ( boost::serialization::tracking_level< T >::value + == boost::serialization::track_selectively + && serialized_as_pointer()); + } + virtual version_type version() const { + return version_type(::boost::serialization::version< T >::value); + } + virtual bool is_polymorphic() const { + return boost::is_polymorphic< T >::value; + } + virtual ~iserializer(){}; +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +template +BOOST_DLLEXPORT void iserializer::load_object_data( + basic_iarchive & ar, + void *x, + const unsigned int file_version +) const { + // note: we now comment this out. Before we permited archive + // version # to be very large. Now we don't. To permit + // readers of these old archives, we have to suppress this + // code. Perhaps in the future we might re-enable it but + // permit its suppression with a runtime switch. + #if 0 + // trap case where the program cannot handle the current version + if(file_version > static_cast(version())) + boost::serialization::throw_exception( + archive::archive_exception( + boost::archive::archive_exception::unsupported_class_version, + get_debug_info() + ) + ); + #endif + // make sure call is routed through the higest interface that might + // be specialized by the user. + boost::serialization::serialize_adl( + boost::serialization::smart_cast_reference(ar), + * static_cast(x), + file_version + ); +} + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +template +class pointer_iserializer : + public basic_pointer_iserializer +{ +private: + virtual const basic_iserializer & get_basic_serializer() const { + return boost::serialization::singleton< + iserializer + >::get_const_instance(); + } + BOOST_DLLEXPORT virtual void load_object_ptr( + basic_iarchive & ar, + void * & x, + const unsigned int file_version + ) const BOOST_USED; +protected: + // this should alway be a singleton so make the constructor protected + pointer_iserializer(); + ~pointer_iserializer(); +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +// note trick to be sure that operator new is using class specific +// version if such exists. Due to Peter Dimov. +// note: the following fails if T has no default constructor. +// otherwise it would have been ideal +//struct heap_allocator : public T +//{ +// T * invoke(){ +// return ::new(sizeof(T)); +// } +//} + +template +struct heap_allocator +{ + // boost::has_new_operator< T > doesn't work on these compilers + #if DONT_USE_HAS_NEW_OPERATOR + // This doesn't handle operator new overload for class T + static T * invoke(){ + return static_cast(operator new(sizeof(T))); + } + #else + struct has_new_operator { + static T* invoke() { + return static_cast((T::operator new)(sizeof(T))); + } + }; + struct doesnt_have_new_operator { + static T* invoke() { + return static_cast(operator new(sizeof(T))); + } + }; + static T * invoke() { + typedef BOOST_DEDUCED_TYPENAME + mpl::eval_if< + boost::has_new_operator< T >, + mpl::identity, + mpl::identity + >::type typex; + return typex::invoke(); + } + #endif +}; + +// due to Martin Ecker +template +class auto_ptr_with_deleter +{ +public: + explicit auto_ptr_with_deleter(T* p) : + m_p(p) + {} + ~auto_ptr_with_deleter(){ + if (m_p) + boost::serialization::access::destroy(m_p); + } + T* get() const { + return m_p; + } + + T* release() { + T* p = m_p; + m_p = NULL; + return p; + } +private: + T* m_p; +}; + +// note: BOOST_DLLEXPORT is so that code for polymorphic class +// serialized only through base class won't get optimized out +template +BOOST_DLLEXPORT void pointer_iserializer::load_object_ptr( + basic_iarchive & ar, + void * & x, + const unsigned int file_version +) const +{ + Archive & ar_impl = + boost::serialization::smart_cast_reference(ar); + + auto_ptr_with_deleter< T > ap(heap_allocator< T >::invoke()); + if(NULL == ap.get()) + boost::serialization::throw_exception(std::bad_alloc()) ; + + T * t = ap.get(); + x = t; + + // catch exception during load_construct_data so that we don't + // automatically delete the t which is most likely not fully + // constructed + BOOST_TRY { + // this addresses an obscure situtation that occurs when + // load_constructor de-serializes something through a pointer. + ar.next_object_pointer(t); + boost::serialization::load_construct_data_adl( + ar_impl, + t, + file_version + ); + } + BOOST_CATCH(...){ + ap.release(); + BOOST_RETHROW; + } + BOOST_CATCH_END + + ar_impl >> boost::serialization::make_nvp(NULL, * t); + ap.release(); +} + +template +pointer_iserializer::pointer_iserializer() : + basic_pointer_iserializer( + boost::serialization::singleton< + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation< T >::type + >::get_const_instance() + ) +{ + boost::serialization::singleton< + iserializer + >::get_mutable_instance().set_bpis(this); + archive_serializer_map::insert(this); +} + +template +pointer_iserializer::~pointer_iserializer(){ + archive_serializer_map::erase(this); +} + +template +struct load_non_pointer_type { + // note this bounces the call right back to the archive + // with no runtime overhead + struct load_primitive { + template + static void invoke(Archive & ar, T & t){ + load_access::load_primitive(ar, t); + } + }; + // note this bounces the call right back to the archive + // with no runtime overhead + struct load_only { + template + static void invoke(Archive & ar, const T & t){ + // short cut to user's serializer + // make sure call is routed through the higest interface that might + // be specialized by the user. + boost::serialization::serialize_adl( + ar, + const_cast(t), + boost::serialization::version< T >::value + ); + } + }; + + // note this save class information including version + // and serialization level to the archive + struct load_standard { + template + static void invoke(Archive &ar, const T & t){ + void * x = & const_cast(t); + ar.load_object( + x, + boost::serialization::singleton< + iserializer + >::get_const_instance() + ); + } + }; + + struct load_conditional { + template + static void invoke(Archive &ar, T &t){ + //if(0 == (ar.get_flags() & no_tracking)) + load_standard::invoke(ar, t); + //else + // load_only::invoke(ar, t); + } + }; + + template + static void invoke(Archive & ar, T &t){ + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + // if its primitive + mpl::equal_to< + boost::serialization::implementation_level< T >, + mpl::int_ + >, + mpl::identity, + // else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + // class info / version + mpl::greater_equal< + boost::serialization::implementation_level< T >, + mpl::int_ + >, + // do standard load + mpl::identity, + // else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + // no tracking + mpl::equal_to< + boost::serialization::tracking_level< T >, + mpl::int_ + >, + // do a fast load + mpl::identity, + // else + // do a fast load only tracking is turned off + mpl::identity + > > >::type typex; + check_object_versioning< T >(); + check_object_level< T >(); + typex::invoke(ar, t); + } +}; + +template +struct load_pointer_type { + struct abstract + { + template + static const basic_pointer_iserializer * register_type(Archive & /* ar */){ + // it has? to be polymorphic + BOOST_STATIC_ASSERT(boost::is_polymorphic< T >::value); + return static_cast(NULL); + } + }; + + struct non_abstract + { + template + static const basic_pointer_iserializer * register_type(Archive & ar){ + return ar.register_type(static_cast(NULL)); + } + }; + + template + static const basic_pointer_iserializer * register_type(Archive &ar, const T & /*t*/){ + // there should never be any need to load an abstract polymorphic + // class pointer. Inhibiting code generation for this + // permits abstract base classes to be used - note: exception + // virtual serialize functions used for plug-ins + typedef BOOST_DEDUCED_TYPENAME + mpl::eval_if< + boost::serialization::is_abstract, + boost::mpl::identity, + boost::mpl::identity + >::type typex; + return typex::template register_type< T >(ar); + } + + template + static T * pointer_tweak( + const boost::serialization::extended_type_info & eti, + void const * const t, + const T & + ) { + // tweak the pointer back to the base class + return static_cast( + const_cast( + boost::serialization::void_upcast( + eti, + boost::serialization::singleton< + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation< T >::type + >::get_const_instance(), + t + ) + ) + ); + } + + template + static void check_load(T & /* t */){ + check_pointer_level< T >(); + check_pointer_tracking< T >(); + } + + static const basic_pointer_iserializer * + find(const boost::serialization::extended_type_info & type){ + return static_cast( + archive_serializer_map::find(type) + ); + } + + template + static void invoke(Archive & ar, Tptr & t){ + check_load(*t); + const basic_pointer_iserializer * bpis_ptr = register_type(ar, *t); + const basic_pointer_iserializer * newbpis_ptr = ar.load_pointer( + // note major hack here !!! + // I tried every way to convert Tptr &t (where Tptr might + // include const) to void * &. This is the only way + // I could make it work. RR + (void * & )t, + bpis_ptr, + find + ); + // if the pointer isn't that of the base class + if(newbpis_ptr != bpis_ptr){ + t = pointer_tweak(newbpis_ptr->get_eti(), t, *t); + } + } +}; + +template +struct load_enum_type { + template + static void invoke(Archive &ar, T &t){ + // convert integers to correct enum to load + int i; + ar >> boost::serialization::make_nvp(NULL, i); + t = static_cast< T >(i); + } +}; + +template +struct load_array_type { + template + static void invoke(Archive &ar, T &t){ + typedef BOOST_DEDUCED_TYPENAME remove_extent< T >::type value_type; + + // convert integers to correct enum to load + // determine number of elements in the array. Consider the + // fact that some machines will align elements on boundries + // other than characters. + std::size_t current_count = sizeof(t) / ( + static_cast(static_cast(&t[1])) + - static_cast(static_cast(&t[0])) + ); + boost::serialization::collection_size_type count; + ar >> BOOST_SERIALIZATION_NVP(count); + if(static_cast(count) > current_count) + boost::serialization::throw_exception( + archive::archive_exception( + boost::archive::archive_exception::array_size_too_short + ) + ); + ar >> serialization::make_array(static_cast(&t[0]),count); + } +}; + +} // detail + +template +inline void load(Archive & ar, T &t){ + // if this assertion trips. It means we're trying to load a + // const object with a compiler that doesn't have correct + // funtion template ordering. On other compilers, this is + // handled below. + detail::check_const_loading< T >(); + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity > + ,//else + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity > + ,//else + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity > + ,//else + mpl::identity > + > + > + >::type typex; + 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 +inline void load(Archive &ar, const T & t){ + load(ar, const_cast(t)); +} +#endif + +// let wrappers through. +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +template +inline void load_wrapper(Archive &ar, const T&t, mpl::true_){ + boost::archive::load(ar, const_cast(t)); +} + +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) +template +inline void load(Archive &ar, const T&t){ + load_wrapper(ar,t,serialization::is_wrapper< T >()); +} +#endif +#endif + +#endif + +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/oserializer.hpp b/3rdParty/Boost/src/boost/archive/detail/oserializer.hpp new file mode 100644 index 0000000..7d2694d --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/oserializer.hpp @@ -0,0 +1,531 @@ +#ifndef BOOST_ARCHIVE_OSERIALIZER_HPP +#define BOOST_ARCHIVE_OSERIALIZER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#pragma inline_depth(511) +#pragma inline_recursion(on) +#endif + +#if defined(__MWERKS__) +#pragma inline_depth(511) +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// oserializer.hpp: interface for serialization system. + +// (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 +#include // NULL + +#include +#include +#include + +#include +#include +#include +#include + +#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO + #include +#endif +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace serialization { + class extended_type_info; +} // namespace serialization + +namespace archive { + +// an accessor to permit friend access to archives. Needed because +// some compilers don't handle friend templates completely +class save_access { +public: + template + static void end_preamble(Archive & ar){ + ar.end_preamble(); + } + template + static void save_primitive(Archive & ar, const T & t){ + ar.end_preamble(); + ar.save(t); + } +}; + +namespace detail { + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +template +class oserializer : public basic_oserializer +{ +private: + // private constructor to inhibit any existence other than the + // static one +public: + explicit BOOST_DLLEXPORT oserializer() : + basic_oserializer( + boost::serialization::singleton< + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation< T >::type + >::get_const_instance() + ) + {} + virtual BOOST_DLLEXPORT void save_object_data( + basic_oarchive & ar, + const void *x + ) const BOOST_USED; + virtual bool class_info() const { + return boost::serialization::implementation_level< T >::value + >= boost::serialization::object_class_info; + } + virtual bool tracking(const unsigned int /* flags */) const { + return boost::serialization::tracking_level< T >::value == boost::serialization::track_always + || (boost::serialization::tracking_level< T >::value == boost::serialization::track_selectively + && serialized_as_pointer()); + } + virtual version_type version() const { + return version_type(::boost::serialization::version< T >::value); + } + virtual bool is_polymorphic() const { + return boost::is_polymorphic< T >::value; + } + virtual ~oserializer(){} +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +template +BOOST_DLLEXPORT void oserializer::save_object_data( + basic_oarchive & ar, + const void *x +) const { + // make sure call is routed through the highest interface that might + // be specialized by the user. + BOOST_STATIC_ASSERT(boost::is_const< T >::value == false); + boost::serialization::serialize_adl( + boost::serialization::smart_cast_reference(ar), + * static_cast(const_cast(x)), + version() + ); +} + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +template +class pointer_oserializer : + public basic_pointer_oserializer +{ +private: + const basic_oserializer & + get_basic_serializer() const { + return boost::serialization::singleton< + oserializer + >::get_const_instance(); + } + virtual BOOST_DLLEXPORT void save_object_ptr( + basic_oarchive & ar, + const void * x + ) const BOOST_USED; +public: + pointer_oserializer(); + ~pointer_oserializer(); +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +template +BOOST_DLLEXPORT void pointer_oserializer::save_object_ptr( + basic_oarchive & ar, + const void * x +) const { + BOOST_ASSERT(NULL != x); + // make sure call is routed through the highest interface that might + // be specialized by the user. + T * t = static_cast(const_cast(x)); + const unsigned int file_version = boost::serialization::version< T >::value; + Archive & ar_impl + = boost::serialization::smart_cast_reference(ar); + boost::serialization::save_construct_data_adl( + ar_impl, + t, + file_version + ); + ar_impl << boost::serialization::make_nvp(NULL, * t); +} + +template +pointer_oserializer::pointer_oserializer() : + basic_pointer_oserializer( + boost::serialization::singleton< + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation< T >::type + >::get_const_instance() + ) +{ + // make sure appropriate member function is instantiated + boost::serialization::singleton< + oserializer + >::get_mutable_instance().set_bpos(this); + archive_serializer_map::insert(this); +} + +template +pointer_oserializer::~pointer_oserializer(){ + archive_serializer_map::erase(this); +} + +template +struct save_non_pointer_type { + // note this bounces the call right back to the archive + // with no runtime overhead + struct save_primitive { + template + static void invoke(Archive & ar, const T & t){ + save_access::save_primitive(ar, t); + } + }; + // same as above but passes through serialization + struct save_only { + template + static void invoke(Archive & ar, const T & t){ + // make sure call is routed through the highest interface that might + // be specialized by the user. + boost::serialization::serialize_adl( + ar, + const_cast(t), + ::boost::serialization::version< T >::value + ); + } + }; + // adds class information to the archive. This includes + // serialization level and class version + struct save_standard { + template + static void invoke(Archive &ar, const T & t){ + ar.save_object( + & t, + boost::serialization::singleton< + oserializer + >::get_const_instance() + ); + } + }; + + // adds class information to the archive. This includes + // serialization level and class version + struct save_conditional { + template + static void invoke(Archive &ar, const T &t){ + //if(0 == (ar.get_flags() & no_tracking)) + save_standard::invoke(ar, t); + //else + // save_only::invoke(ar, t); + } + }; + + + template + static void invoke(Archive & ar, const T & t){ + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if< + // if its primitive + mpl::equal_to< + boost::serialization::implementation_level< T >, + mpl::int_ + >, + mpl::identity, + // else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + // class info / version + mpl::greater_equal< + boost::serialization::implementation_level< T >, + mpl::int_ + >, + // do standard save + mpl::identity, + // else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + // no tracking + mpl::equal_to< + boost::serialization::tracking_level< T >, + mpl::int_ + >, + // do a fast save + mpl::identity, + // else + // do a fast save only tracking is turned off + mpl::identity + > > >::type typex; + check_object_versioning< T >(); + typex::invoke(ar, t); + } + template + static void invoke(Archive & ar, T & t){ + check_object_level< T >(); + check_object_tracking< T >(); + invoke(ar, const_cast(t)); + } +}; + +template +struct save_pointer_type { + struct abstract + { + template + static const basic_pointer_oserializer * register_type(Archive & /* ar */){ + // it has? to be polymorphic + BOOST_STATIC_ASSERT(boost::is_polymorphic< T >::value); + return NULL; + } + }; + + struct non_abstract + { + template + static const basic_pointer_oserializer * register_type(Archive & ar){ + return ar.register_type(static_cast(NULL)); + } + }; + + template + static const basic_pointer_oserializer * register_type(Archive &ar, T & /*t*/){ + // there should never be any need to save an abstract polymorphic + // class pointer. Inhibiting code generation for this + // permits abstract base classes to be used - note: exception + // virtual serialize functions used for plug-ins + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if< + boost::serialization::is_abstract< T >, + mpl::identity, + mpl::identity + >::type typex; + return typex::template register_type< T >(ar); + } + + struct non_polymorphic + { + template + static void save( + Archive &ar, + T & t + ){ + const basic_pointer_oserializer & bpos = + boost::serialization::singleton< + pointer_oserializer + >::get_const_instance(); + // save the requested pointer type + ar.save_pointer(& t, & bpos); + } + }; + + struct polymorphic + { + template + static void save( + Archive &ar, + T & t + ){ + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation< T >::type const + & i = boost::serialization::singleton< + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation< T >::type + >::get_const_instance(); + + boost::serialization::extended_type_info const * const this_type = & i; + + // retrieve the true type of the object pointed to + // if this assertion fails its an error in this library + BOOST_ASSERT(NULL != this_type); + + const boost::serialization::extended_type_info * true_type = + i.get_derived_extended_type_info(t); + + // note:if this exception is thrown, be sure that derived pointer + // is either registered or exported. + if(NULL == true_type){ + boost::serialization::throw_exception( + archive_exception( + archive_exception::unregistered_class, + "derived class not registered or exported" + ) + ); + } + + // if its not a pointer to a more derived type + const void *vp = static_cast(&t); + if(*this_type == *true_type){ + const basic_pointer_oserializer * bpos = register_type(ar, t); + ar.save_pointer(vp, bpos); + return; + } + // convert pointer to more derived type. if this is thrown + // it means that the base/derived relationship hasn't be registered + vp = serialization::void_downcast( + *true_type, + *this_type, + static_cast(&t) + ); + if(NULL == vp){ + boost::serialization::throw_exception( + archive_exception( + archive_exception::unregistered_cast, + true_type->get_debug_info(), + this_type->get_debug_info() + ) + ); + } + + // since true_type is valid, and this only gets made if the + // pointer oserializer object has been created, this should never + // fail + const basic_pointer_oserializer * bpos + = static_cast( + boost::serialization::singleton< + archive_serializer_map + >::get_const_instance().find(*true_type) + ); + BOOST_ASSERT(NULL != bpos); + if(NULL == bpos) + boost::serialization::throw_exception( + archive_exception( + archive_exception::unregistered_class, + "derived class not registered or exported" + ) + ); + ar.save_pointer(vp, bpos); + } + }; + + template + static void save( + Archive & ar, + const T & t + ){ + check_pointer_level< T >(); + check_pointer_tracking< T >(); + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_polymorphic< T >, + mpl::identity, + mpl::identity + >::type type; + type::save(ar, const_cast(t)); + } + + template + static void invoke(Archive &ar, const TPtr t){ + register_type(ar, * t); + if(NULL == t){ + basic_oarchive & boa + = boost::serialization::smart_cast_reference(ar); + boa.save_null_pointer(); + save_access::end_preamble(ar); + return; + } + save(ar, * t); + } +}; + +template +struct save_enum_type +{ + template + static void invoke(Archive &ar, const T &t){ + // convert enum to integers on save + const int i = static_cast(t); + ar << boost::serialization::make_nvp(NULL, i); + } +}; + +template +struct save_array_type +{ + template + static void invoke(Archive &ar, const T &t){ + typedef BOOST_DEDUCED_TYPENAME boost::remove_extent< T >::type value_type; + + save_access::end_preamble(ar); + // consider alignment + std::size_t c = sizeof(t) / ( + static_cast(static_cast(&t[1])) + - static_cast(static_cast(&t[0])) + ); + boost::serialization::collection_size_type count(c); + ar << BOOST_SERIALIZATION_NVP(count); + ar << serialization::make_array(static_cast(&t[0]),count); + } +}; + +} // detail + +template +inline void save(Archive & ar, /*const*/ T &t){ + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity >, + //else + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity >, + //else + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity >, + //else + mpl::identity > + > + > + >::type typex; + typex::invoke(ar, t); +} + +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_OSERIALIZER_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/register_archive.hpp b/3rdParty/Boost/src/boost/archive/detail/register_archive.hpp new file mode 100644 index 0000000..e31ae46 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/register_archive.hpp @@ -0,0 +1,91 @@ +// Copyright David Abrahams 2006. Distributed under 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) +#ifndef BOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP +# define BOOST_ARCHIVE_DETAIL_REGISTER_ARCHIVE_DWA2006521_HPP + +namespace boost { namespace archive { namespace detail { + +// No instantiate_ptr_serialization overloads generated by +// BOOST_SERIALIZATION_REGISTER_ARCHIVE that lexically follow the call +// will be seen *unless* they are in an associated namespace of one of +// the arguments, so we pass one of these along to make sure this +// namespace is considered. See temp.dep.candidate (14.6.4.2) in the +// standard. +struct adl_tag {}; + +template +struct ptr_serialization_support; + +// We could've just used ptr_serialization_support, above, but using +// it with only a forward declaration causes vc6/7 to complain about a +// missing instantiate member, even if it has one. This is just a +// friendly layer of indirection. +template +struct _ptr_serialization_support + : ptr_serialization_support +{ + typedef int type; +}; + +#ifdef __SUNPRO_CC + +template +struct counter : counter {}; +template<> +struct counter<0> {}; + +template +void instantiate_ptr_serialization(Serializable* s, int, adl_tag) { + instantiate_ptr_serialization(s, counter<20>()); +} + +template +struct get_counter { + static const int value = sizeof(adjust_counter(counter<20>())); + typedef counter type; + typedef counter prior; + typedef char (&next)[value+1]; +}; + +char adjust_counter(counter<0>); +template +void instantiate_ptr_serialization(Serializable*, counter<0>) {} + +#define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \ +namespace boost { namespace archive { namespace detail { \ + get_counter::next adjust_counter(get_counter::type);\ + template \ + void instantiate_ptr_serialization(Serializable* s, \ + get_counter::type) { \ + ptr_serialization_support x; \ + instantiate_ptr_serialization(s, get_counter::prior()); \ + }\ +}}} + + +#else + +// This function gets called, but its only purpose is to participate +// in overload resolution with the functions declared by +// BOOST_SERIALIZATION_REGISTER_ARCHIVE, below. +template +void instantiate_ptr_serialization(Serializable*, int, adl_tag ) {} + +// The function declaration generated by this macro never actually +// gets called, but its return type gets instantiated, and that's +// enough to cause registration of serialization functions between +// Archive and any exported Serializable type. See also: +// boost/serialization/export.hpp +# define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \ +namespace boost { namespace archive { namespace detail { \ + \ +template \ +BOOST_DEDUCED_TYPENAME _ptr_serialization_support::type \ +instantiate_ptr_serialization( Serializable*, Archive*, adl_tag ); \ + \ +}}} +#endif +}}} // namespace boost::archive::detail + +#endif // BOOST_ARCHIVE_DETAIL_INSTANTIATE_SERIALIZE_DWA2006521_HPP diff --git a/3rdParty/Boost/src/boost/archive/detail/utf8_codecvt_facet.hpp b/3rdParty/Boost/src/boost/archive/detail/utf8_codecvt_facet.hpp new file mode 100644 index 0000000..bd859ff --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/detail/utf8_codecvt_facet.hpp @@ -0,0 +1,21 @@ +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). +// Distributed under 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) + +#ifndef BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP +#define BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP + +#define BOOST_UTF8_BEGIN_NAMESPACE \ + namespace boost { namespace archive { namespace detail { +#define BOOST_UTF8_DECL +#define BOOST_UTF8_END_NAMESPACE }}} + +#include + +#undef BOOST_UTF8_END_NAMESPACE +#undef BOOST_UTF8_DECL +#undef BOOST_UTF8_BEGIN_NAMESPACE + +#endif // BOOST_ARCHIVE_DETAIL_UTF8_CODECVT_FACET_HPP diff --git a/3rdParty/Boost/src/boost/archive/dinkumware.hpp b/3rdParty/Boost/src/boost/archive/dinkumware.hpp new file mode 100644 index 0000000..bfa828d --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/dinkumware.hpp @@ -0,0 +1,224 @@ +#ifndef BOOST_ARCHIVE_DINKUMWARE_HPP +#define BOOST_ARCHIVE_DINKUMWARE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// dinkumware.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. + +// this file adds a couple of things that are missing from the dinkumware +// implementation of the standard library. + +#include +#include + +#include +#include + +namespace std { + +// define i/o operators for 64 bit integers +template +basic_ostream & +operator<<(basic_ostream & os, boost::uint64_t t){ + // octal rendering of 64 bit number would be 22 octets + eos + CharType d[23]; + unsigned int radix; + + if(os.flags() & (int)std::ios_base::hex) + radix = 16; + else + if(os.flags() & (int)std::ios_base::oct) + radix = 8; + else + //if(s.flags() & (int)std::ios_base::dec) + radix = 10; + unsigned int i = 0; + do{ + unsigned int j = t % radix; + d[i++] = j + ((j < 10) ? '0' : ('a' - 10)); + t /= radix; + } + while(t > 0); + d[i--] = '\0'; + + // reverse digits + unsigned int j = 0; + while(j < i){ + CharType k = d[i]; + d[i] = d[j]; + d[j] = k; + --i;++j; + } + os << d; + return os; + +} + +template +basic_ostream & +operator<<(basic_ostream &os, boost::int64_t t){ + if(0 <= t){ + os << static_cast(t); + } + else{ + os.put('-'); + os << -t; + } + return os; +} + +template +basic_istream & +operator>>(basic_istream &is, boost::int64_t & t){ + CharType d; + do{ + d = is.get(); + } + while(::isspace(d)); + bool negative = (d == '-'); + if(negative) + d = is.get(); + unsigned int radix; + if(is.flags() & (int)std::ios_base::hex) + radix = 16; + else + if(is.flags() & (int)std::ios_base::oct) + radix = 8; + else + //if(s.flags() & (int)std::ios_base::dec) + radix = 10; + t = 0; + do{ + if('0' <= d && d <= '9') + t = t * radix + (d - '0'); + else + if('a' <= d && d <= 'f') + t = t * radix + (d - 'a' + 10); + else + break; + d = is.get(); + } + while(!is.fail()); + // restore the delimiter + is.putback(d); + is.clear(); + if(negative) + t = -t; + return is; +} + +template +basic_istream & +operator>>(basic_istream &is, boost::uint64_t & t){ + boost::int64_t it; + is >> it; + t = it; + return is; +} + +//#endif + +template<> +class back_insert_iterator > : public + iterator +{ +public: + typedef basic_string container_type; + typedef container_type::reference reference; + + explicit back_insert_iterator(container_type & s) + : container(& s) + {} // construct with container + + back_insert_iterator & operator=( + container_type::const_reference Val_ + ){ // push value into container + //container->push_back(Val_); + *container += Val_; + return (*this); + } + + back_insert_iterator & operator*(){ + return (*this); + } + + back_insert_iterator & operator++(){ + // pretend to preincrement + return (*this); + } + + back_insert_iterator operator++(int){ + // pretend to postincrement + return (*this); + } + +protected: + container_type *container; // pointer to container +}; + +template +inline back_insert_iterator > back_inserter( + basic_string & s +){ + return (std::back_insert_iterator >(s)); +} + +template<> +class back_insert_iterator > : public + iterator +{ +public: + typedef basic_string container_type; + typedef container_type::reference reference; + + explicit back_insert_iterator(container_type & s) + : container(& s) + {} // construct with container + + back_insert_iterator & operator=( + container_type::const_reference Val_ + ){ // push value into container + //container->push_back(Val_); + *container += Val_; + return (*this); + } + + back_insert_iterator & operator*(){ + return (*this); + } + + back_insert_iterator & operator++(){ + // pretend to preincrement + return (*this); + } + + back_insert_iterator operator++(int){ + // pretend to postincrement + return (*this); + } + +protected: + container_type *container; // pointer to container +}; + +template +inline back_insert_iterator > back_inserter( + basic_string & s +){ + return (std::back_insert_iterator >(s)); +} + +} // namespace std + +#endif //BOOST_ARCHIVE_DINKUMWARE_HPP diff --git a/3rdParty/Boost/src/boost/archive/impl/archive_serializer_map.ipp b/3rdParty/Boost/src/boost/archive/impl/archive_serializer_map.ipp new file mode 100644 index 0000000..c8ad96b --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/archive_serializer_map.ipp @@ -0,0 +1,71 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// archive_serializer_map.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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. + +////////////////////////////////////////////////////////////////////// +// implementation of basic_text_iprimitive overrides for the combination +// of template parameters used to implement a text_iprimitive + +#include +#include +#include +#include + +namespace boost { +namespace archive { +namespace detail { + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace extra_detail { // anon + template + class map : public basic_serializer_map + {}; +} + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(bool) +archive_serializer_map::insert(const basic_serializer * bs){ + return boost::serialization::singleton< + extra_detail::map + >::get_mutable_instance().insert(bs); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +archive_serializer_map::erase(const basic_serializer * bs){ + if(boost::serialization::singleton< + extra_detail::map + >::is_destroyed()) + return; + boost::serialization::singleton< + extra_detail::map + >::get_mutable_instance().erase(bs); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(const basic_serializer *) +archive_serializer_map::find( + const boost::serialization::extended_type_info & eti +) { + return boost::serialization::singleton< + extra_detail::map + >::get_const_instance().find(eti); +} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_binary_iarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_binary_iarchive.ipp new file mode 100644 index 0000000..8ea39f7 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_binary_iarchive.ipp @@ -0,0 +1,129 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_iarchive.ipp: + +// (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 +#include +#include +#include + +#include // for BOOST_DEDUCED_TYPENAME +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::memcpy; + using ::strlen; + using ::size_t; +} +#endif + +#include +#include + +#include + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implementation of binary_binary_archive +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_iarchive::load_override(class_name_type & t, int){ + std::string cn; + cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE); + load_override(cn, 0); + if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)) + boost::serialization::throw_exception( + archive_exception(archive_exception::invalid_class_name) + ); + std::memcpy(t, cn.data(), cn.size()); + // borland tweak + t.t[cn.size()] = '\0'; +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_iarchive::init(){ + // read signature in an archive version independent manner + std::string file_signature; + try { + std::size_t l; + this->This()->load(l); + if(l == std::strlen(BOOST_ARCHIVE_SIGNATURE())) { + // borland de-allocator fixup + #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + if(NULL != file_signature.data()) + #endif + file_signature.resize(l); + // note breaking a rule here - could be a problem on some platform + if(0 < l) + this->This()->load_binary(&(*file_signature.begin()), l); + } + } + catch(archive_exception const &) { // catch stream_error archive exceptions + // will cause invalid_signature archive exception to be thrown below + file_signature = ""; + } + if(file_signature != BOOST_ARCHIVE_SIGNATURE()) + boost::serialization::throw_exception( + archive_exception(archive_exception::invalid_signature) + ); + + // make sure the version of the reading archive library can + // support the format of the archive being read + library_version_type input_library_version; + //* this->This() >> input_library_version; + { + int v = 0; + v = this->This()->m_sb.sbumpc(); + #if defined(BOOST_LITTLE_ENDIAN) + if(v < 6){ + ; + } + else + if(v < 7){ + // version 6 - next byte should be zero + this->This()->m_sb.sbumpc(); + } + else + if(v < 8){ + int x1; + // version 7 = might be followed by zero or some other byte + x1 = this->This()->m_sb.sgetc(); + // it's =a zero, push it back + if(0 == x1) + this->This()->m_sb.sbumpc(); + } + else{ + // version 8+ followed by a zero + this->This()->m_sb.sbumpc(); + } + #elif defined(BOOST_BIG_ENDIAN) + if(v == 0) + v = this->This()->m_sb.sbumpc(); + #endif + input_library_version = static_cast(v); + } + + #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) + this->set_library_version(input_library_version); + #else + #if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200) + detail:: + #endif + basic_iarchive::set_library_version(input_library_version); + #endif + + if(BOOST_ARCHIVE_VERSION() < input_library_version) + boost::serialization::throw_exception( + archive_exception(archive_exception::unsupported_version) + ); +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_binary_iprimitive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_binary_iprimitive.ipp new file mode 100644 index 0000000..e0f5c2e --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_binary_iprimitive.ipp @@ -0,0 +1,209 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_iprimitive.ipp: + +// (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 +#include // size_t, NULL +#include // memcpy + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; + using ::memcpy; +} // namespace std +#endif + +#include // fixup for RogueWave + +#include +#include + +#include +#include +#include + +namespace boost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// implementation of basic_binary_iprimitive + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_iprimitive::init() +{ + // Detect attempts to pass native binary archives across + // incompatible platforms. This is not fool proof but its + // better than nothing. + unsigned char size; + this->This()->load(size); + if(sizeof(int) != size) + boost::serialization::throw_exception( + archive_exception( + archive_exception::incompatible_native_format, + "size of int" + ) + ); + this->This()->load(size); + if(sizeof(long) != size) + boost::serialization::throw_exception( + archive_exception( + archive_exception::incompatible_native_format, + "size of long" + ) + ); + this->This()->load(size); + if(sizeof(float) != size) + boost::serialization::throw_exception( + archive_exception( + archive_exception::incompatible_native_format, + "size of float" + ) + ); + this->This()->load(size); + if(sizeof(double) != size) + boost::serialization::throw_exception( + archive_exception( + archive_exception::incompatible_native_format, + "size of double" + ) + ); + + // for checking endian + int i; + this->This()->load(i); + if(1 != i) + boost::serialization::throw_exception( + archive_exception( + archive_exception::incompatible_native_format, + "endian setting" + ) + ); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_iprimitive::load(wchar_t * ws) +{ + std::size_t l; // number of wchar_t !!! + this->This()->load(l); + load_binary(ws, l * sizeof(wchar_t) / sizeof(char)); + ws[l] = L'\0'; +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_iprimitive::load(std::string & s) +{ + std::size_t l; + this->This()->load(l); + // borland de-allocator fixup + #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + if(NULL != s.data()) + #endif + s.resize(l); + // note breaking a rule here - could be a problem on some platform + if(0 < l) + load_binary(&(*s.begin()), l); +} + +#ifndef BOOST_NO_CWCHAR +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_iprimitive::load(char * s) +{ + std::size_t l; + this->This()->load(l); + load_binary(s, l); + s[l] = '\0'; +} +#endif + +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_iprimitive::load(std::wstring & ws) +{ + std::size_t l; + this->This()->load(l); + // borland de-allocator fixup + #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + if(NULL != ws.data()) + #endif + ws.resize(l); + // note breaking a rule here - is could be a problem on some platform + load_binary(const_cast(ws.data()), l * sizeof(wchar_t) / sizeof(char)); +} +#endif + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_binary_iprimitive::basic_binary_iprimitive( + std::basic_streambuf & sb, + bool no_codecvt +) : +#ifndef BOOST_NO_STD_LOCALE + m_sb(sb), + archive_locale(NULL), + locale_saver(m_sb) +{ + if(! no_codecvt){ + archive_locale.reset( + boost::archive::add_facet( + std::locale::classic(), + new codecvt_null + ) + ); + m_sb.pubimbue(* archive_locale); + } +} +#else + m_sb(sb) +{} +#endif + +// some libraries including stl and libcomo fail if the +// buffer isn't flushed before the code_cvt facet is changed. +// I think this is a bug. We explicity invoke sync to when +// we're done with the streambuf to work around this problem. +// Note that sync is a protected member of stream buff so we +// have to invoke it through a contrived derived class. +namespace detail { +// note: use "using" to get past msvc bug +using namespace std; +template +class input_streambuf_access : public std::basic_streambuf { + public: + virtual int sync(){ +#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) + return this->basic_streambuf::sync(); +#else + return this->basic_streambuf::sync(); +#endif + } +}; +} // detail + +// scoped_ptr requires that archive_locale be a complete type at time of +// destruction so define destructor here rather than in the header +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_binary_iprimitive::~basic_binary_iprimitive(){ + // push back unread characters + //destructor can't throw ! + try{ + static_cast &>(m_sb).sync(); + } + catch(...){ + } +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_binary_oarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_binary_oarchive.ipp new file mode 100644 index 0000000..dec2cd7 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_binary_oarchive.ipp @@ -0,0 +1,46 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_oarchive.ipp: + +// (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 +#include +#include +#include + +#include // for BOOST_DEDUCED_TYPENAME +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::memcpy; +} +#endif + +#include + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implementation of binary_binary_oarchive + +template +#if !defined(__BORLANDC__) +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +#else +void +#endif +basic_binary_oarchive::init(){ + // write signature in an archive version independent manner + const std::string file_signature(BOOST_ARCHIVE_SIGNATURE()); + * this->This() << file_signature; + // write library version + const library_version_type v(BOOST_ARCHIVE_VERSION()); + * this->This() << v; +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_binary_oprimitive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_binary_oprimitive.ipp new file mode 100644 index 0000000..02b5ffa --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_binary_oprimitive.ipp @@ -0,0 +1,160 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_binary_oprimitive.ipp: + +// (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 +#include // NULL +#include + +#include + +#if defined(BOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__) +namespace std{ + using ::strlen; +} // namespace std +#endif + +#ifndef BOOST_NO_CWCHAR +#include +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std{ using ::wcslen; } +#endif +#endif + +#include + +#include +#include + +namespace boost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// implementation of basic_binary_oprimitive + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_oprimitive::init() +{ + // record native sizes of fundamental types + // this is to permit detection of attempts to pass + // native binary archives accross incompatible machines. + // This is not foolproof but its better than nothing. + this->This()->save(static_cast(sizeof(int))); + this->This()->save(static_cast(sizeof(long))); + this->This()->save(static_cast(sizeof(float))); + this->This()->save(static_cast(sizeof(double))); + // for checking endianness + this->This()->save(int(1)); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_oprimitive::save(const char * s) +{ + std::size_t l = std::strlen(s); + this->This()->save(l); + save_binary(s, l); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_oprimitive::save(const std::string &s) +{ + std::size_t l = static_cast(s.size()); + this->This()->save(l); + save_binary(s.data(), l); +} + +#ifndef BOOST_NO_CWCHAR +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_oprimitive::save(const wchar_t * ws) +{ + std::size_t l = std::wcslen(ws); + this->This()->save(l); + save_binary(ws, l * sizeof(wchar_t) / sizeof(char)); +} +#endif + +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_binary_oprimitive::save(const std::wstring &ws) +{ + std::size_t l = ws.size(); + this->This()->save(l); + save_binary(ws.data(), l * sizeof(wchar_t) / sizeof(char)); +} +#endif + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_binary_oprimitive::basic_binary_oprimitive( + std::basic_streambuf & sb, + bool no_codecvt +) : +#ifndef BOOST_NO_STD_LOCALE + m_sb(sb), + archive_locale(NULL), + locale_saver(m_sb) +{ + if(! no_codecvt){ + archive_locale.reset( + add_facet( + std::locale::classic(), + new codecvt_null + ) + ); + m_sb.pubimbue(* archive_locale); + } +} +#else + m_sb(sb) +{} +#endif + +// some libraries including stl and libcomo fail if the +// buffer isn't flushed before the code_cvt facet is changed. +// I think this is a bug. We explicity invoke sync to when +// we're done with the streambuf to work around this problem. +// Note that sync is a protected member of stream buff so we +// have to invoke it through a contrived derived class. +namespace detail { +// note: use "using" to get past msvc bug +using namespace std; +template +class output_streambuf_access : public std::basic_streambuf { + public: + virtual int sync(){ +#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) + return this->basic_streambuf::sync(); +#else + return this->basic_streambuf::sync(); +#endif + } +}; +} // detail + +// scoped_ptr requires that g be a complete type at time of +// destruction so define destructor here rather than in the header +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_binary_oprimitive::~basic_binary_oprimitive(){ + // flush buffer + //destructor can't throw + try{ + static_cast &>(m_sb).sync(); + } + catch(...){ + } +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_text_iarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_text_iarchive.ipp new file mode 100644 index 0000000..0a246b7 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_text_iarchive.ipp @@ -0,0 +1,79 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_iarchive.ipp: + +// (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 +#include +#include + +#include // for BOOST_DEDUCED_TYPENAME +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::memcpy; +} +#endif + +#include +#include +#include + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implementation of text_text_archive + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_text_iarchive::load_override(class_name_type & t, int){ + std::string cn; + cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE); + load_override(cn, 0); + if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)) + boost::serialization::throw_exception( + archive_exception(archive_exception::invalid_class_name) + ); + std::memcpy(t, cn.data(), cn.size()); + // borland tweak + t.t[cn.size()] = '\0'; +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_text_iarchive::init(void){ + // read signature in an archive version independent manner + std::string file_signature; + * this->This() >> file_signature; + if(file_signature != BOOST_ARCHIVE_SIGNATURE()) + boost::serialization::throw_exception( + archive_exception(archive_exception::invalid_signature) + ); + + // make sure the version of the reading archive library can + // support the format of the archive being read + library_version_type input_library_version; + * this->This() >> input_library_version; + + #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) + this->set_library_version(input_library_version); + #else + #if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200) + detail:: + #endif + basic_iarchive::set_library_version(input_library_version); + #endif + + // extra little .t is to get around borland quirk + if(BOOST_ARCHIVE_VERSION() < input_library_version) + boost::serialization::throw_exception( + archive_exception(archive_exception::unsupported_version) + ); +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_text_iprimitive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_text_iprimitive.ipp new file mode 100644 index 0000000..ad6a6d5 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_text_iprimitive.ipp @@ -0,0 +1,154 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_iprimitive.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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 // size_t +#include // NULL + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +namespace boost { +namespace archive { + +namespace { + template + bool is_whitespace(CharType c); + + template<> + bool is_whitespace(char t){ + return 0 != std::isspace(t); + } + + #ifndef BOOST_NO_CWCHAR + template<> + bool is_whitespace(wchar_t t){ + return 0 != std::iswspace(t); + } + #endif +} + +// translate base64 text into binary and copy into buffer +// until buffer is full. +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_text_iprimitive::load_binary( + void *address, + std::size_t count +){ + typedef BOOST_DEDUCED_TYPENAME IStream::char_type CharType; + + if(0 == count) + return; + + BOOST_ASSERT( + static_cast((std::numeric_limits::max)()) + > (count + sizeof(CharType) - 1)/sizeof(CharType) + ); + + if(is.fail()) + boost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + // convert from base64 to binary + typedef BOOST_DEDUCED_TYPENAME + iterators::transform_width< + iterators::binary_from_base64< + iterators::remove_whitespace< + iterators::istream_iterator + > + ,CharType + > + ,8 + ,6 + ,CharType + > + binary; + + binary ti_begin = binary( + BOOST_MAKE_PFTO_WRAPPER( + iterators::istream_iterator(is) + ) + ); + + char * caddr = static_cast(address); + + // take care that we don't increment anymore than necessary + while(--count > 0){ + *caddr++ = static_cast(*ti_begin); + ++ti_begin; + } + *caddr++ = static_cast(*ti_begin); + + iterators::istream_iterator i; + for(;;){ + BOOST_DEDUCED_TYPENAME IStream::int_type r; + r = is.get(); + if(is.eof()) + break; + if(is_whitespace(static_cast(r))) + break; + } +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_text_iprimitive::basic_text_iprimitive( + IStream &is_, + bool no_codecvt +) : +#ifndef BOOST_NO_STD_LOCALE + is(is_), + flags_saver(is_), + precision_saver(is_), + archive_locale(NULL), + locale_saver(* is_.rdbuf()) +{ + if(! no_codecvt){ + archive_locale.reset( + add_facet( + std::locale::classic(), + new codecvt_null + ) + ); + is.imbue(* archive_locale); + } + is >> std::noboolalpha; +} +#else + is(is_), + flags_saver(is_), + precision_saver(is_) +{} +#endif + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_text_iprimitive::~basic_text_iprimitive(){ + is.sync(); +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_text_oarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_text_oarchive.ipp new file mode 100644 index 0000000..34e6995 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_text_oarchive.ipp @@ -0,0 +1,62 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_oarchive.ipp: + +// (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 +#include +#include + +#include // for BOOST_DEDUCED_TYPENAME +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::memcpy; +} +#endif + +#include + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implementation of basic_text_oarchive + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_text_oarchive::newtoken() +{ + switch(delimiter){ + default: + BOOST_ASSERT(false); + break; + case eol: + this->This()->put('\n'); + delimiter = space; + break; + case space: + this->This()->put(' '); + break; + case none: + delimiter = space; + break; + } +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_text_oarchive::init(){ + // write signature in an archive version independent manner + const std::string file_signature(BOOST_ARCHIVE_SIGNATURE()); + * this->This() << file_signature; + // write library version + const library_version_type v(BOOST_ARCHIVE_VERSION()); + * this->This() << v; +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_text_oprimitive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_text_oprimitive.ipp new file mode 100644 index 0000000..cacab61 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_text_oprimitive.ipp @@ -0,0 +1,114 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_oprimitive.ipp: + +// (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 // NULL +#include + +#include +#include +#include + +#include +#include +#include +#include + +namespace boost { +namespace archive { + +// translate to base64 and copy in to buffer. +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_text_oprimitive::save_binary( + const void *address, + std::size_t count +){ + typedef BOOST_DEDUCED_TYPENAME OStream::char_type CharType; + + if(0 == count) + return; + + if(os.fail()) + boost::serialization::throw_exception( + archive_exception(archive_exception::output_stream_error) + ); + + os.put('\n'); + + typedef + boost::archive::iterators::insert_linebreaks< + boost::archive::iterators::base64_from_binary< + boost::archive::iterators::transform_width< + const char *, + 6, + 8 + > + > + ,72 + ,const char // cwpro8 needs this + > + base64_text; + + boost::archive::iterators::ostream_iterator oi(os); + std::copy( + base64_text(BOOST_MAKE_PFTO_WRAPPER(static_cast(address))), + base64_text( + BOOST_MAKE_PFTO_WRAPPER(static_cast(address) + count) + ), + oi + ); + + std::size_t tail = count % 3; + if(tail > 0){ + *oi++ = '='; + if(tail < 2) + *oi = '='; + } +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_text_oprimitive::basic_text_oprimitive( + OStream & os_, + bool no_codecvt +) : +#ifndef BOOST_NO_STD_LOCALE + os(os_), + flags_saver(os_), + precision_saver(os_), + archive_locale(NULL), + locale_saver(* os_.rdbuf()) +{ + if(! no_codecvt){ + archive_locale.reset( + add_facet( + std::locale::classic(), + new codecvt_null + ) + ); + os.imbue(* archive_locale); + } + os << std::noboolalpha; +} +#else + os(os_), + flags_saver(os_), + precision_saver(os_) +{} +#endif + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_text_oprimitive::~basic_text_oprimitive(){ + os << std::endl; +} + +} //namespace boost +} //namespace archive diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_xml_grammar.hpp b/3rdParty/Boost/src/boost/archive/impl/basic_xml_grammar.hpp new file mode 100644 index 0000000..807ed07 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_xml_grammar.hpp @@ -0,0 +1,178 @@ +#ifndef BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP +#define BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_grammar.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. + +// this module is derived from simplexml.cpp - an example shipped as part of +// the spirit parser. This example contains the following notice: +/*============================================================================= + simplexml.cpp + + Spirit V1.3 + URL: http://spirit.sourceforge.net/ + + Copyright (c) 2001, Daniel C. Nuffer + + This software is provided 'as-is', without any express or implied + warranty. In no event will the copyright holder be held liable for + any damages arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute + it freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation + would be appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +=============================================================================*/ +#include + +#include +#include + +// supress noise +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include + +#include +#include +#include + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// XML grammar parsing + +template +class basic_xml_grammar { +public: + // The following is not necessary according to DR45, but at least + // one compiler (Compaq C++ 6.5 in strict_ansi mode) chokes otherwise. + struct return_values; + friend struct return_values; + +private: + typedef BOOST_DEDUCED_TYPENAME std::basic_istream IStream; + typedef BOOST_DEDUCED_TYPENAME std::basic_string StringType; + typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::chset chset_t; + typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::chlit chlit_t; + typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::scanner< + BOOST_DEDUCED_TYPENAME std::basic_string::iterator + > scanner_t; + typedef BOOST_DEDUCED_TYPENAME boost::spirit::classic::rule rule_t; + // Start grammar definition + rule_t + Reference, + Eq, + STag, + ETag, + LetterOrUnderscoreOrColon, + AttValue, + CharRef1, + CharRef2, + CharRef, + AmpRef, + LTRef, + GTRef, + AposRef, + QuoteRef, + CharData, + CharDataChars, + content, + AmpName, + LTName, + GTName, + ClassNameChar, + ClassName, + Name, + XMLDecl, + XMLDeclChars, + DocTypeDecl, + DocTypeDeclChars, + ClassIDAttribute, + ObjectIDAttribute, + ClassNameAttribute, + TrackingAttribute, + VersionAttribute, + UnusedAttribute, + Attribute, + SignatureAttribute, + SerializationWrapper, + NameHead, + NameTail, + AttributeList, + S; + + // XML Character classes + chset_t + BaseChar, + Ideographic, + Char, + Letter, + Digit, + CombiningChar, + Extender, + Sch, + NameChar; + + void init_chset(); + + bool my_parse( + IStream & is, + const rule_t &rule_, + const CharType delimiter = L'>' + ) const ; +public: + struct return_values { + StringType object_name; + StringType contents; + //class_id_type class_id; + int_least16_t class_id; + //object_id_type object_id; + uint_least32_t object_id; + //version_type version; + unsigned int version; + tracking_type tracking_level; + StringType class_name; + return_values() : + version(0), + tracking_level(false) + {} + } rv; + bool parse_start_tag(IStream & is) /*const*/; + bool parse_end_tag(IStream & is) const; + bool parse_string(IStream & is, StringType & s) /*const*/; + void init(IStream & is); + void windup(IStream & is); + basic_xml_grammar(); +}; + +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_BASIC_XML_GRAMMAR_HPP diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_xml_iarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_xml_iarchive.ipp new file mode 100644 index 0000000..52dfde1 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_xml_iarchive.ipp @@ -0,0 +1,114 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_iarchive.ipp: + +// (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 +#include // NULL +#include + +#include +#include +#include +#include + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implementation of xml_text_archive + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_iarchive::load_start(const char *name){ + // if there's no name + if(NULL == name) + return; + bool result = this->This()->gimpl->parse_start_tag(this->This()->get_is()); + if(true != result){ + boost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + } + // don't check start tag at highest level + ++depth; + return; +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_iarchive::load_end(const char *name){ + // if there's no name + if(NULL == name) + return; + bool result = this->This()->gimpl->parse_end_tag(this->This()->get_is()); + if(true != result){ + boost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + } + + // don't check start tag at highest level + if(0 == --depth) + return; + + if(0 == (this->get_flags() & no_xml_tag_checking)){ + // double check that the tag matches what is expected - useful for debug + if(0 != name[this->This()->gimpl->rv.object_name.size()] + || ! std::equal( + this->This()->gimpl->rv.object_name.begin(), + this->This()->gimpl->rv.object_name.end(), + name + ) + ){ + boost::serialization::throw_exception( + xml_archive_exception( + xml_archive_exception::xml_archive_tag_mismatch, + name + ) + ); + } + } +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_iarchive::load_override(object_id_type & t, int){ + t = object_id_type(this->This()->gimpl->rv.object_id); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_iarchive::load_override(version_type & t, int){ + t = version_type(this->This()->gimpl->rv.version); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_iarchive::load_override(class_id_type & t, int){ + t = class_id_type(this->This()->gimpl->rv.class_id); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_iarchive::load_override(tracking_type & t, int){ + t = this->This()->gimpl->rv.tracking_level; +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_xml_iarchive::basic_xml_iarchive(unsigned int flags) : + detail::common_iarchive(flags), + depth(0) +{} +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_xml_iarchive::~basic_xml_iarchive(){} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/basic_xml_oarchive.ipp b/3rdParty/Boost/src/boost/archive/impl/basic_xml_oarchive.ipp new file mode 100644 index 0000000..e2cc8d4 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/basic_xml_oarchive.ipp @@ -0,0 +1,275 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_oarchive.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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 +#include // NULL +#include +#if defined(BOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__) +namespace std{ + using ::strlen; +} // namespace std +#endif + +#include +#include +#include +#include + +namespace boost { +namespace archive { + +namespace detail { +template +struct XML_name { + void operator()(CharType t) const{ + const unsigned char lookup_table[] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0, // -. + 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, // 0-9 + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // A- + 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, // -Z _ + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // a- + 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, // -z + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + }; + if((unsigned)t > 127) + return; + if(0 == lookup_table[(unsigned)t]) + boost::serialization::throw_exception( + xml_archive_exception( + xml_archive_exception::xml_archive_tag_name_error + ) + ); + } +}; + +} // namespace detail + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implemenations of functions common to both types of xml output + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::write_attribute( + const char *attribute_name, + int t, + const char *conjunction +){ + this->This()->put(' '); + this->This()->put(attribute_name); + this->This()->put(conjunction); + this->This()->save(t); + this->This()->put('"'); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::write_attribute( + const char *attribute_name, + const char *key +){ + this->This()->put(' '); + this->This()->put(attribute_name); + this->This()->put("=\""); + this->This()->save(key); + this->This()->put('"'); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::indent(){ + int i; + for(i = depth; i-- > 0;) + this->This()->put('\t'); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_start(const char *name) +{ + if(NULL == name) + return; + + // be sure name has no invalid characters + std::for_each(name, name + std::strlen(name), detail::XML_name()); + + end_preamble(); + if(depth > 0){ + this->This()->put('\n'); + indent(); + } + ++depth; + this->This()->put('<'); + this->This()->save(name); + pending_preamble = true; + indent_next = false; +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_end(const char *name) +{ + if(NULL == name) + return; + + // be sure name has no invalid characters + std::for_each(name, name + std::strlen(name), detail::XML_name()); + + end_preamble(); + --depth; + if(indent_next){ + this->This()->put('\n'); + indent(); + } + indent_next = true; + this->This()->put("This()->save(name); + this->This()->put('>'); + if(0 == depth) + this->This()->put('\n'); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::end_preamble(){ + if(pending_preamble){ + this->This()->put('>'); + pending_preamble = false; + } +} +#if 0 +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const object_id_type & t, int) +{ + int i = t.t; // extra .t is for borland + write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_"); +} +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override( + const object_reference_type & t, + int +){ + int i = t.t; // extra .t is for borland + write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_"); +} +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const version_type & t, int) +{ + int i = t.t; // extra .t is for borland + write_attribute(BOOST_ARCHIVE_XML_VERSION(), i); +} +#endif + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const object_id_type & t, int) +{ + // borland doesn't do conversion of STRONG_TYPEDEFs very well + const unsigned int i = t; + write_attribute(BOOST_ARCHIVE_XML_OBJECT_ID(), i, "=\"_"); +} +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override( + const object_reference_type & t, + int +){ + const unsigned int i = t; + write_attribute(BOOST_ARCHIVE_XML_OBJECT_REFERENCE(), i, "=\"_"); +} +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const version_type & t, int) +{ + const unsigned int i = t; + write_attribute(BOOST_ARCHIVE_XML_VERSION(), i); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const class_id_type & t, int) +{ + write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t); +} +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override( + const class_id_reference_type & t, + int +){ + write_attribute(BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(), t); +} +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override( + const class_id_optional_type & t, + int +){ + write_attribute(BOOST_ARCHIVE_XML_CLASS_ID(), t); +} +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const class_name_type & t, int) +{ + const char * key = t; + if(NULL == key) + return; + write_attribute(BOOST_ARCHIVE_XML_CLASS_NAME(), key); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::save_override(const tracking_type & t, int) +{ + write_attribute(BOOST_ARCHIVE_XML_TRACKING(), t.t); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(void) +basic_xml_oarchive::init(){ + // xml header + this->This()->put("\n"); + this->This()->put("\n"); + // xml document wrapper - outer root + this->This()->put("This()->put(">\n"); +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_xml_oarchive::basic_xml_oarchive(unsigned int flags) : + detail::common_oarchive(flags), + depth(0), + indent_next(false), + pending_preamble(false) +{ +} + +template +BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_xml_oarchive::~basic_xml_oarchive(){ + if(0 == (this->get_flags() & no_header)){ + BOOST_TRY{ + this->This()->put("\n"); + } + BOOST_CATCH(...){} + BOOST_CATCH_END + } +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/text_iarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/text_iarchive_impl.ipp new file mode 100644 index 0000000..f14c0d8 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/text_iarchive_impl.ipp @@ -0,0 +1,128 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_iarchive_impl.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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. + +////////////////////////////////////////////////////////////////////// +// implementation of basic_text_iprimitive overrides for the combination +// of template parameters used to implement a text_iprimitive + +#include // size_t, NULL +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include // RogueWave + +#include + +namespace boost { +namespace archive { + +template +BOOST_ARCHIVE_DECL(void) +text_iarchive_impl::load(char *s) +{ + std::size_t size; + * this->This() >> size; + // skip separating space + is.get(); + // Works on all tested platforms + is.read(s, size); + s[size] = '\0'; +} + +template +BOOST_ARCHIVE_DECL(void) +text_iarchive_impl::load(std::string &s) +{ + std::size_t size; + * this->This() >> size; + // skip separating space + is.get(); + // borland de-allocator fixup + #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + if(NULL != s.data()) + #endif + s.resize(size); + if(0 < size) + is.read(&(*s.begin()), size); +} + +#ifndef BOOST_NO_CWCHAR +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template +BOOST_ARCHIVE_DECL(void) +text_iarchive_impl::load(wchar_t *ws) +{ + std::size_t size; + * this->This() >> size; + // skip separating space + is.get(); + is.read((char *)ws, size * sizeof(wchar_t)/sizeof(char)); + ws[size] = L'\0'; +} +#endif // BOOST_NO_INTRINSIC_WCHAR_T + +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_ARCHIVE_DECL(void) +text_iarchive_impl::load(std::wstring &ws) +{ + std::size_t size; + * this->This() >> size; + // borland de-allocator fixup + #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + if(NULL != ws.data()) + #endif + ws.resize(size); + // skip separating space + is.get(); + is.read((char *)ws.data(), size * sizeof(wchar_t)/sizeof(char)); +} + +#endif // BOOST_NO_STD_WSTRING +#endif // BOOST_NO_CWCHAR + +template +BOOST_ARCHIVE_DECL(void) +text_iarchive_impl::load_override(class_name_type & t, int){ + basic_text_iarchive::load_override(t, 0); +} + +template +BOOST_ARCHIVE_DECL(void) +text_iarchive_impl::init(){ + basic_text_iarchive::init(); +} + +template +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +text_iarchive_impl::text_iarchive_impl( + std::istream & is, + unsigned int flags +) : + basic_text_iprimitive( + is, + 0 != (flags & no_codecvt) + ), + basic_text_iarchive(flags) +{ + if(0 == (flags & no_header)) + #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) + this->init(); + #else + this->basic_text_iarchive::init(); + #endif +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/text_oarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/text_oarchive_impl.ipp new file mode 100644 index 0000000..2df0b46 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/text_oarchive_impl.ipp @@ -0,0 +1,124 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_oarchive_impl.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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 +#include +#include +#include // size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#ifndef BOOST_NO_CWCHAR +#include +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std{ using ::wcslen; } +#endif +#endif + +#include +#include + +namespace boost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// implementation of basic_text_oprimitive overrides for the combination +// of template parameters used to create a text_oprimitive + +template +BOOST_ARCHIVE_DECL(void) +text_oarchive_impl::save(const char * s) +{ + const std::size_t len = std::ostream::traits_type::length(s); + *this->This() << len; + this->This()->newtoken(); + os << s; +} + +template +BOOST_ARCHIVE_DECL(void) +text_oarchive_impl::save(const std::string &s) +{ + const std::size_t size = s.size(); + *this->This() << size; + this->This()->newtoken(); + os << s; +} + +#ifndef BOOST_NO_CWCHAR +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template +BOOST_ARCHIVE_DECL(void) +text_oarchive_impl::save(const wchar_t * ws) +{ + const std::size_t l = std::wcslen(ws); + * this->This() << l; + this->This()->newtoken(); + os.write((const char *)ws, l * sizeof(wchar_t)/sizeof(char)); +} +#endif + +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_ARCHIVE_DECL(void) +text_oarchive_impl::save(const std::wstring &ws) +{ + const std::size_t l = ws.size(); + * this->This() << l; + this->This()->newtoken(); + os.write((const char *)(ws.data()), l * sizeof(wchar_t)/sizeof(char)); +} +#endif +#endif // BOOST_NO_CWCHAR + +template +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +text_oarchive_impl::text_oarchive_impl( + std::ostream & os, + unsigned int flags +) : + basic_text_oprimitive( + os, + 0 != (flags & no_codecvt) + ), + basic_text_oarchive(flags) +{ + if(0 == (flags & no_header)) + #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) + this->init(); + #else + this->basic_text_oarchive::init(); + #endif +} + +template +BOOST_ARCHIVE_DECL(void) +text_oarchive_impl::save_binary(const void *address, std::size_t count){ + put('\n'); + this->end_preamble(); + #if ! defined(__MWERKS__) + this->basic_text_oprimitive::save_binary( + #else + this->basic_text_oprimitive::save_binary( + #endif + address, + count + ); + this->delimiter = this->eol; +} + +} // namespace archive +} // namespace boost + diff --git a/3rdParty/Boost/src/boost/archive/impl/text_wiarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/text_wiarchive_impl.ipp new file mode 100644 index 0000000..6938c22 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/text_wiarchive_impl.ipp @@ -0,0 +1,118 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_text_wiarchive_impl.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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 // size_t, NULL + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include // fixup for RogueWave + +#ifndef BOOST_NO_STD_WSTREAMBUF +#include + +namespace boost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// implementation of wiprimtives functions +// +template +BOOST_WARCHIVE_DECL(void) +text_wiarchive_impl::load(char *s) +{ + std::size_t size; + * this->This() >> size; + // skip separating space + is.get(); + while(size-- > 0){ + *s++ = is.narrow(is.get(), '\0'); + } + *s = '\0'; +} + +template +BOOST_WARCHIVE_DECL(void) +text_wiarchive_impl::load(std::string &s) +{ + std::size_t size; + * this->This() >> size; + // skip separating space + is.get(); + #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + if(NULL != s.data()) + #endif + s.resize(0); + s.reserve(size); + while(size-- > 0){ + int x = is.narrow(is.get(), '\0'); + s += x; + } +} + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template +BOOST_WARCHIVE_DECL(void) +text_wiarchive_impl::load(wchar_t *s) +{ + std::size_t size; + * this->This() >> size; + // skip separating space + is.get(); + // Works on all tested platforms + is.read(s, size); + s[size] = L'\0'; +} +#endif + +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_WARCHIVE_DECL(void) +text_wiarchive_impl::load(std::wstring &ws) +{ + std::size_t size; + * this->This() >> size; + // skip separating space + is.get(); + // borland complains about resize + // borland de-allocator fixup + #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + if(NULL != ws.data()) + #endif + ws.resize(size); + // note breaking a rule here - is this a problem on some platform + is.read(const_cast(ws.data()), size); +} +#endif + +template +BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +text_wiarchive_impl::text_wiarchive_impl( + std::wistream & is, + unsigned int flags +) : + basic_text_iprimitive( + is, + 0 != (flags & no_codecvt) + ), + basic_text_iarchive(flags) +{ + if(0 == (flags & no_header)) + basic_text_iarchive::init(); +} + +} // archive +} // boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/3rdParty/Boost/src/boost/archive/impl/text_woarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/text_woarchive_impl.ipp new file mode 100644 index 0000000..6683f52 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/text_woarchive_impl.ipp @@ -0,0 +1,85 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_woarchive_impl.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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 +#ifndef BOOST_NO_STD_WSTREAMBUF + +#include +#include // size_t +#if defined(BOOST_NO_STDC_NAMESPACE) && ! defined(__LIBCOMO__) +namespace std{ + using ::strlen; + using ::size_t; +} // namespace std +#endif + +#include + +#include + +namespace boost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// implementation of woarchive functions +// +template +BOOST_WARCHIVE_DECL(void) +text_woarchive_impl::save(const char *s) +{ + // note: superfluous local variable fixes borland warning + const std::size_t size = std::strlen(s); + * this->This() << size; + this->This()->newtoken(); + while(*s != '\0') + os.put(os.widen(*s++)); +} + +template +BOOST_WARCHIVE_DECL(void) +text_woarchive_impl::save(const std::string &s) +{ + const std::size_t size = s.size(); + * this->This() << size; + this->This()->newtoken(); + const char * cptr = s.data(); + for(std::size_t i = size; i-- > 0;) + os.put(os.widen(*cptr++)); +} + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template +BOOST_WARCHIVE_DECL(void) +text_woarchive_impl::save(const wchar_t *ws) +{ + const std::size_t size = std::wostream::traits_type::length(ws); + * this->This() << size; + this->This()->newtoken(); + os.write(ws, size); +} +#endif + +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_WARCHIVE_DECL(void) +text_woarchive_impl::save(const std::wstring &ws) +{ + const std::size_t size = ws.length(); + * this->This() << size; + this->This()->newtoken(); + os.write(ws.data(), size); +} +#endif + +} // namespace archive +} // namespace boost + +#endif + diff --git a/3rdParty/Boost/src/boost/archive/impl/xml_iarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/xml_iarchive_impl.ipp new file mode 100644 index 0000000..c7cbc7f --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/xml_iarchive_impl.ipp @@ -0,0 +1,204 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_iarchive_impl.cpp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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 +#include // memcpy +#include // NULL +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::memcpy; +} // namespace std +#endif + +#ifndef BOOST_NO_CWCHAR +#include // mbtowc +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::mbtowc; + } // namespace std +#endif +#endif // BOOST_NO_CWCHAR + +#include // RogueWave and Dinkumware +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#include + +#include +#include +#include +#include + +#include "basic_xml_grammar.hpp" + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implemenations of functions specific to char archives + +// wide char stuff used by char archives + +#ifndef BOOST_NO_CWCHAR +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_ARCHIVE_DECL(void) +xml_iarchive_impl::load(std::wstring &ws){ + std::string s; + bool result = gimpl->parse_string(is, s); + if(! result) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + + #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + if(NULL != ws.data()) + #endif + ws.resize(0); + const char * start = s.data(); + const char * end = start + s.size(); + while(start < end){ + wchar_t wc; + int resultx = std::mbtowc(&wc, start, end - start); + if(0 < resultx){ + start += resultx; + ws += wc; + continue; + } + boost::serialization::throw_exception( + iterators::dataflow_exception( + iterators::dataflow_exception::invalid_conversion + ) + ); + } +} +#endif // BOOST_NO_STD_WSTRING + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template +BOOST_ARCHIVE_DECL(void) +xml_iarchive_impl::load(wchar_t * ws){ + std::string s; + bool result = gimpl->parse_string(is, s); + if(! result) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + + const char * start = s.data(); + const char * end = start + s.size(); + while(start < end){ + wchar_t wc; + int result = std::mbtowc(&wc, start, end - start); + if(0 < result){ + start += result; + *ws++ = wc; + continue; + } + boost::serialization::throw_exception( + iterators::dataflow_exception( + iterators::dataflow_exception::invalid_conversion + ) + ); + } + *ws = L'\0'; +} +#endif // BOOST_NO_INTRINSIC_WCHAR_T + +#endif // BOOST_NO_CWCHAR + +template +BOOST_ARCHIVE_DECL(void) +xml_iarchive_impl::load(std::string &s){ + bool result = gimpl->parse_string(is, s); + if(! result) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); +} + +template +BOOST_ARCHIVE_DECL(void) +xml_iarchive_impl::load(char * s){ + std::string tstring; + bool result = gimpl->parse_string(is, tstring); + if(! result) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + std::memcpy(s, tstring.data(), tstring.size()); + s[tstring.size()] = 0; +} + +template +BOOST_ARCHIVE_DECL(void) +xml_iarchive_impl::load_override(class_name_type & t, int){ + const std::string & s = gimpl->rv.class_name; + if(s.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1) + boost::serialization::throw_exception( + archive_exception(archive_exception::invalid_class_name) + ); + char * tptr = t; + std::memcpy(tptr, s.data(), s.size()); + tptr[s.size()] = '\0'; +} + +template +BOOST_ARCHIVE_DECL(void) +xml_iarchive_impl::init(){ + gimpl->init(is); + this->set_library_version( + library_version_type(gimpl->rv.version) + ); +} + +template +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +xml_iarchive_impl::xml_iarchive_impl( + std::istream &is_, + unsigned int flags +) : + basic_text_iprimitive( + is_, + 0 != (flags & no_codecvt) + ), + basic_xml_iarchive(flags), + gimpl(new xml_grammar()) +{ + if(0 == (flags & no_header)){ + BOOST_TRY{ + init(); + } + BOOST_CATCH(...){ + delete gimpl; + #ifndef BOOST_NO_EXCEPTIONS + throw; // re-throw + #endif + } + BOOST_CATCH_END + } +} + +template +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +xml_iarchive_impl::~xml_iarchive_impl(){ + if(0 == (this->get_flags() & no_header)){ + BOOST_TRY{ + gimpl->windup(is); + } + BOOST_CATCH(...){} + BOOST_CATCH_END + } + delete gimpl; +} +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/xml_oarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/xml_oarchive_impl.ipp new file mode 100644 index 0000000..8ab954f --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/xml_oarchive_impl.ipp @@ -0,0 +1,117 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_oarchive_impl.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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) + +#include +#include +#include +#include + +#include // strlen +#include // msvc 6.0 needs this to suppress warnings +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::strlen; +} // namespace std +#endif + +#include +#include + +#ifndef BOOST_NO_CWCHAR +#include +#include +#endif + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implemenations of functions specific to char archives + +// wide char stuff used by char archives +#ifndef BOOST_NO_CWCHAR +// copy chars to output escaping to xml and translating wide chars to mb chars +template +void save_iterator(std::ostream &os, InputIterator begin, InputIterator end){ + typedef boost::archive::iterators::mb_from_wchar< + boost::archive::iterators::xml_escape + > translator; + std::copy( + translator(BOOST_MAKE_PFTO_WRAPPER(begin)), + translator(BOOST_MAKE_PFTO_WRAPPER(end)), + boost::archive::iterators::ostream_iterator(os) + ); +} + +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_ARCHIVE_DECL(void) +xml_oarchive_impl::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 +// save_iterator(os, ws.data(), ws.data() + std::wcslen(ws.data())); + save_iterator(os, ws.data(), ws.data() + ws.size()); +} +#endif + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template +BOOST_ARCHIVE_DECL(void) +xml_oarchive_impl::save(const wchar_t * ws){ + save_iterator(os, ws, ws + std::wcslen(ws)); +} +#endif + +#endif // BOOST_NO_CWCHAR + +template +BOOST_ARCHIVE_DECL(void) +xml_oarchive_impl::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 + typedef boost::archive::iterators::xml_escape< + 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())), + boost::archive::iterators::ostream_iterator(os) + ); +} + +template +BOOST_ARCHIVE_DECL(void) +xml_oarchive_impl::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))), + boost::archive::iterators::ostream_iterator(os) + ); +} + +template +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +xml_oarchive_impl::xml_oarchive_impl( + std::ostream & os_, + unsigned int flags +) : + basic_text_oprimitive( + os_, + 0 != (flags & no_codecvt) + ), + basic_xml_oarchive(flags) +{ + if(0 == (flags & no_header)) + this->init(); +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/boost/archive/impl/xml_wiarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/xml_wiarchive_impl.ipp new file mode 100644 index 0000000..9dde66c --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/xml_wiarchive_impl.ipp @@ -0,0 +1,206 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_wiprimitive.cpp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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 // for BOOST_DEDUCED_TYPENAME + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::memcpy; +} //std +#endif + +#include // msvc 6.0 needs this to suppress warnings +#ifndef BOOST_NO_STD_WSTREAMBUF + +#include +#include + +#include // Dinkumware and RogueWave +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include "basic_xml_grammar.hpp" + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implemenations of functions specific to wide char archives + +namespace { // anonymous + +void copy_to_ptr(char * s, const std::wstring & ws){ + std::copy( + iterators::mb_from_wchar( + BOOST_MAKE_PFTO_WRAPPER(ws.begin()) + ), + iterators::mb_from_wchar( + BOOST_MAKE_PFTO_WRAPPER(ws.end()) + ), + s + ); + s[ws.size()] = 0; +} + +} // anonymous + +template +BOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load(std::string & s){ + std::wstring ws; + bool result = gimpl->parse_string(is, ws); + if(! result) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) + if(NULL != s.data()) + #endif + s.resize(0); + s.reserve(ws.size()); + std::copy( + iterators::mb_from_wchar( + BOOST_MAKE_PFTO_WRAPPER(ws.begin()) + ), + iterators::mb_from_wchar( + BOOST_MAKE_PFTO_WRAPPER(ws.end()) + ), + std::back_inserter(s) + ); +} + +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load(std::wstring & ws){ + bool result = gimpl->parse_string(is, ws); + if(! result) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); +} +#endif + +template +BOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load(char * s){ + std::wstring ws; + bool result = gimpl->parse_string(is, ws); + if(! result) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + copy_to_ptr(s, ws); +} + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template +BOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load(wchar_t * ws){ + std::wstring twstring; + bool result = gimpl->parse_string(is, twstring); + if(! result) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + std::memcpy(ws, twstring.c_str(), twstring.size()); + ws[twstring.size()] = L'\0'; +} +#endif + +template +BOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::load_override(class_name_type & t, int){ + const std::wstring & ws = gimpl->rv.class_name; + if(ws.size() > BOOST_SERIALIZATION_MAX_KEY_SIZE - 1) + boost::serialization::throw_exception( + archive_exception(archive_exception::invalid_class_name) + ); + copy_to_ptr(t, ws); +} + +template +BOOST_WARCHIVE_DECL(void) +xml_wiarchive_impl::init(){ + gimpl->init(is); + this->set_library_version( + library_version_type(gimpl->rv.version) + ); +} + +template +BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +xml_wiarchive_impl::xml_wiarchive_impl( + std::wistream &is_, + unsigned int flags +) : + basic_text_iprimitive( + is_, + true // don't change the codecvt - use the one below + ), + basic_xml_iarchive(flags), + gimpl(new xml_wgrammar()) +{ + if(0 == (flags & no_codecvt)){ + archive_locale.reset( + add_facet( + std::locale::classic(), + new boost::archive::detail::utf8_codecvt_facet + ) + ); + is.imbue(* archive_locale); + } + if(0 == (flags & no_header)){ + BOOST_TRY{ + this->init(); + } + BOOST_CATCH(...){ + delete gimpl; + #ifndef BOOST_NO_EXCEPTIONS + throw; // re-throw + #endif + } + BOOST_CATCH_END + } +} + +template +BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +xml_wiarchive_impl::~xml_wiarchive_impl(){ + if(0 == (this->get_flags() & no_header)){ + BOOST_TRY{ + gimpl->windup(is); + } + BOOST_CATCH(...){} + BOOST_CATCH_END + } + delete gimpl; +} + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/3rdParty/Boost/src/boost/archive/impl/xml_woarchive_impl.ipp b/3rdParty/Boost/src/boost/archive/impl/xml_woarchive_impl.ipp new file mode 100644 index 0000000..3bf42bd --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/impl/xml_woarchive_impl.ipp @@ -0,0 +1,160 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_woarchive_impl.ipp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Distributed under 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) + +#include +#ifndef BOOST_NO_STD_WSTREAMBUF + +#include +#include +#include +#include + +#include // msvc 6.0 needs this to suppress warnings + // for BOOST_DEDUCED_TYPENAME +#include // strlen +#include // mbtowc +#include // wcslen + +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::strlen; + #if ! defined(BOOST_NO_INTRINSIC_WCHAR_T) + using ::mbtowc; + using ::wcslen; + #endif +} // namespace std +#endif + +#include +#include + +#include +#include +#include +#include + +#include +#include + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// implemenations of functions specific to wide char archives + +// copy chars to output escaping to xml and widening characters as we go +template +void save_iterator(std::wostream &os, InputIterator begin, InputIterator end){ + typedef iterators::wchar_from_mb< + iterators::xml_escape + > xmbtows; + std::copy( + xmbtows(BOOST_MAKE_PFTO_WRAPPER(begin)), + xmbtows(BOOST_MAKE_PFTO_WRAPPER(end)), + boost::archive::iterators::ostream_iterator(os) + ); +} + +template +BOOST_WARCHIVE_DECL(void) +xml_woarchive_impl::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 + // around these values to implement the definitions. + const char * begin = s.data(); + const char * end = begin + s.size(); + save_iterator(os, begin, end); +} + +#ifndef BOOST_NO_STD_WSTRING +template +BOOST_WARCHIVE_DECL(void) +xml_woarchive_impl::save(const std::wstring & ws){ +#if 0 + typedef iterators::xml_escape xmbtows; + std::copy( + xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.begin())), + xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.end())), + boost::archive::iterators::ostream_iterator(os) + ); +#endif + typedef iterators::xml_escape xmbtows; + std::copy( + xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data())), + xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws.data() + ws.size())), + boost::archive::iterators::ostream_iterator(os) + ); +} +#endif //BOOST_NO_STD_WSTRING + +template +BOOST_WARCHIVE_DECL(void) +xml_woarchive_impl::save(const char * s){ + save_iterator(os, s, s + std::strlen(s)); +} + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template +BOOST_WARCHIVE_DECL(void) +xml_woarchive_impl::save(const wchar_t * ws){ + os << ws; + typedef iterators::xml_escape xmbtows; + std::copy( + xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws)), + xmbtows(BOOST_MAKE_PFTO_WRAPPER(ws + std::wcslen(ws))), + boost::archive::iterators::ostream_iterator(os) + ); +} +#endif + +template +BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) +xml_woarchive_impl::xml_woarchive_impl( + std::wostream & os_, + unsigned int flags +) : + basic_text_oprimitive( + os_, + true // don't change the codecvt - use the one below + ), + basic_xml_oarchive(flags) +{ + // Standard behavior is that imbue can be called + // a) before output is invoked or + // b) after flush has been called. This prevents one-to-many + // transforms (such as one to many transforms from getting + // mixed up. Unfortunately, STLPort doesn't respect b) above + // so the restoration of the original archive locale done by + // the locale_saver doesn't get processed, + // before the current one is destroyed. + // so the codecvt doesn't get replaced with the orginal + // so closing the stream invokes codecvt::do_unshift + // so it crashes because the corresponding locale that contained + // the codecvt isn't around any more. + // we can hack around this by using a static codecvt that never + // gets destroyed. + if(0 == (flags & no_codecvt)){ + boost::archive::detail::utf8_codecvt_facet *pfacet; + #if defined(__SGI_STL_PORT) + static boost::archive::detail::utf8_codecvt_facet + facet(static_cast(1)); + pfacet = & facet; + #else + pfacet = new boost::archive::detail::utf8_codecvt_facet; + #endif + archive_locale.reset(add_facet(std::locale::classic(), pfacet)); + os.imbue(* archive_locale); + } + if(0 == (flags & no_header)) + this->init(); +} + +} // namespace archive +} // namespace boost + +#endif //BOOST_NO_STD_WSTREAMBUF diff --git a/3rdParty/Boost/src/boost/archive/iterators/base64_from_binary.hpp b/3rdParty/Boost/src/boost/archive/iterators/base64_from_binary.hpp new file mode 100644 index 0000000..ecb916a --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/base64_from_binary.hpp @@ -0,0 +1,112 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP +#define BOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// base64_from_binary.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 + +#include // size_t +#include // for BOOST_DEDUCED_TYPENAME +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include + +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// convert binary integers to base64 characters + +namespace detail { + +template +struct from_6_bit { + typedef CharType result_type; + CharType operator()(CharType t) const{ + const char * lookup_table = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "+/"; + BOOST_ASSERT(t < 64); + return lookup_table[static_cast(t)]; + } +}; + +} // namespace detail + +// note: what we would like to do is +// template +// typedef transform_iterator< +// from_6_bit, +// transform_width +// > base64_from_binary; +// but C++ won't accept this. Rather than using a "type generator" and +// using a different syntax, make a derivation which should be equivalent. +// +// Another issue addressed here is that the transform_iterator doesn't have +// a templated constructor. This makes it incompatible with the dataflow +// ideal. This is also addressed here. + +//template +template< + class Base, + class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value::type +> +class base64_from_binary : + public transform_iterator< + detail::from_6_bit, + Base + > +{ + friend class boost::iterator_core_access; + typedef transform_iterator< + BOOST_DEDUCED_TYPENAME detail::from_6_bit, + Base + > super_t; + +public: + // make composible buy using templated constructor + template + base64_from_binary(BOOST_PFTO_WRAPPER(T) start) : + super_t( + Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))), + detail::from_6_bit() + ) + {} + // intel 7.1 doesn't like default copy constructor + base64_from_binary(const base64_from_binary & rhs) : + super_t( + Base(rhs.base_reference()), + detail::from_6_bit() + ) + {} +// base64_from_binary(){}; +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_BASE64_FROM_BINARY_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/binary_from_base64.hpp b/3rdParty/Boost/src/boost/archive/iterators/binary_from_base64.hpp new file mode 100644 index 0000000..60f23f3 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/binary_from_base64.hpp @@ -0,0 +1,120 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP +#define BOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_from_base64.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 + +#include // for BOOST_DEDUCED_TYPENAME +#include +#include +#include + +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// convert base64 characters to binary data + +namespace detail { + +template +struct to_6_bit { + typedef CharType result_type; + CharType operator()(CharType t) const{ + const signed char lookup_table[] = { + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, + 52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1, + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, + 15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1, + -1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, + 41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1 + }; + // metrowerks trips this assertion - how come? + #if ! defined(__MWERKS__) + BOOST_STATIC_ASSERT(128 == sizeof(lookup_table)); + #endif + signed char value = -1; + if((unsigned)t <= 127) + value = lookup_table[(unsigned)t]; + if(-1 == value) + boost::serialization::throw_exception( + dataflow_exception(dataflow_exception::invalid_base64_character) + ); + return value; + } +}; + +} // namespace detail + +// note: what we would like to do is +// template +// typedef transform_iterator< +// from_6_bit, +// transform_width +// > base64_from_binary; +// but C++ won't accept this. Rather than using a "type generator" and +// using a different syntax, make a derivation which should be equivalent. +// +// Another issue addressed here is that the transform_iterator doesn't have +// a templated constructor. This makes it incompatible with the dataflow +// ideal. This is also addressed here. + +template< + class Base, + class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value::type +> +class binary_from_base64 : public + transform_iterator< + detail::to_6_bit, + Base + > +{ + friend class boost::iterator_core_access; + typedef transform_iterator< + detail::to_6_bit, + Base + > super_t; +public: + // make composible buy using templated constructor + template + binary_from_base64(BOOST_PFTO_WRAPPER(T) start) : + super_t( + Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start))), + detail::to_6_bit() + ) + {} + // intel 7.1 doesn't like default copy constructor + binary_from_base64(const binary_from_base64 & rhs) : + super_t( + Base(rhs.base_reference()), + detail::to_6_bit() + ) + {} +// binary_from_base64(){}; +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_BINARY_FROM_BASE64_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/dataflow_exception.hpp b/3rdParty/Boost/src/boost/archive/iterators/dataflow_exception.hpp new file mode 100644 index 0000000..1d655a1 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/dataflow_exception.hpp @@ -0,0 +1,80 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP +#define BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// dataflow_exception.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 +#ifndef BOOST_NO_EXCEPTIONS +#include +#endif //BOOST_NO_EXCEPTIONS + +#include + +namespace boost { +namespace archive { +namespace iterators { + +////////////////////////////////////////////////////////////////////// +// exceptions thrown by dataflows +// +class dataflow_exception : public std::exception +{ +public: + typedef enum { + invalid_6_bitcode, + invalid_base64_character, + invalid_xml_escape_sequence, + comparison_not_permitted, + invalid_conversion, + other_exception + } exception_code; + exception_code code; + + dataflow_exception(exception_code c = other_exception) : code(c) + {} + + virtual const char *what( ) const throw( ) + { + const char *msg = "unknown exception code"; + switch(code){ + case invalid_6_bitcode: + msg = "attempt to encode a value > 6 bits"; + break; + case invalid_base64_character: + msg = "attempt to decode a value not in base64 char set"; + break; + case invalid_xml_escape_sequence: + msg = "invalid xml escape_sequence"; + break; + case comparison_not_permitted: + msg = "cannot invoke iterator comparison now"; + break; + case invalid_conversion: + msg = "invalid multbyte/wide char conversion"; + break; + default: + BOOST_ASSERT(false); + break; + } + return msg; + } +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif //BOOST_ARCHIVE_ITERATORS_DATAFLOW_EXCEPTION_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/escape.hpp b/3rdParty/Boost/src/boost/archive/iterators/escape.hpp new file mode 100644 index 0000000..bb527d4 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/escape.hpp @@ -0,0 +1,115 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_ESCAPE_HPP +#define BOOST_ARCHIVE_ITERATORS_ESCAPE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// escape.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 +#include // NULL + +#include // for BOOST_DEDUCED_TYPENAME +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// insert escapes into text + +template +class escape : + public boost::iterator_adaptor< + Derived, + Base, + BOOST_DEDUCED_TYPENAME boost::iterator_value::type, + single_pass_traversal_tag, + BOOST_DEDUCED_TYPENAME boost::iterator_value::type + > +{ + typedef BOOST_DEDUCED_TYPENAME boost::iterator_value::type base_value_type; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference::type reference_type; + friend class boost::iterator_core_access; + + typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + Derived, + Base, + base_value_type, + single_pass_traversal_tag, + base_value_type + > super_t; + + typedef escape this_t; + + void dereference_impl() { + m_current_value = static_cast(this)->fill(m_bnext, m_bend); + m_full = true; + } + + //Access the value referred to + reference_type dereference() const { + if(!m_full) + const_cast(this)->dereference_impl(); + return m_current_value; + } + + bool equal(const this_t & rhs) const { + if(m_full){ + if(! rhs.m_full) + const_cast(& rhs)->dereference_impl(); + } + else{ + if(rhs.m_full) + const_cast(this)->dereference_impl(); + } + if(m_bnext != rhs.m_bnext) + return false; + if(this->base_reference() != rhs.base_reference()) + return false; + return true; + } + + void increment(){ + if(++m_bnext < m_bend){ + m_current_value = *m_bnext; + return; + } + ++(this->base_reference()); + m_bnext = NULL; + m_bend = NULL; + m_full = false; + } + + // buffer to handle pending characters + const base_value_type *m_bnext; + const base_value_type *m_bend; + bool m_full; + base_value_type m_current_value; +public: + escape(Base base) : + super_t(base), + m_bnext(NULL), + m_bend(NULL), + m_full(false) + { + } +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_ESCAPE_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/insert_linebreaks.hpp b/3rdParty/Boost/src/boost/archive/iterators/insert_linebreaks.hpp new file mode 100644 index 0000000..5f826ca --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/insert_linebreaks.hpp @@ -0,0 +1,101 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP +#define BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// insert_linebreaks.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 + +#include // for BOOST_DEDUCED_TYPENAME +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ using ::memcpy; } +#endif + +#include + +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// insert line break every N characters +template< + class Base, + int N, + class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value::type +> +class insert_linebreaks : + public iterator_adaptor< + insert_linebreaks, + Base, + CharType, + single_pass_traversal_tag, + CharType + > +{ +private: + friend class boost::iterator_core_access; + typedef iterator_adaptor< + insert_linebreaks, + Base, + CharType, + single_pass_traversal_tag, + CharType + > super_t; + + bool equal(const insert_linebreaks & rhs) const { + return +// m_count == rhs.m_count +// && base_reference() == rhs.base_reference() + this->base_reference() == rhs.base_reference() + ; + } + + void increment() { + if(m_count == N){ + m_count = 0; + return; + } + ++m_count; + ++(this->base_reference()); + } + CharType dereference() const { + if(m_count == N) + return '\n'; + return * (this->base_reference()); + } + unsigned int m_count; +public: + // make composible buy using templated constructor + template + insert_linebreaks(BOOST_PFTO_WRAPPER(T) start) : + super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + m_count(0) + {} + // intel 7.1 doesn't like default copy constructor + insert_linebreaks(const insert_linebreaks & rhs) : + super_t(rhs.base_reference()), + m_count(rhs.m_count) + {} +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_INSERT_LINEBREAKS_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/istream_iterator.hpp b/3rdParty/Boost/src/boost/archive/iterators/istream_iterator.hpp new file mode 100644 index 0000000..1df612d --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/istream_iterator.hpp @@ -0,0 +1,95 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP +#define BOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// istream_iterator.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. + +// note: this is a custom version of the standard istream_iterator. +// This is necessary as the standard version doesn't work as expected +// for wchar_t based streams on systems for which wchar_t not a true +// type but rather a synonym for some integer type. + +#include // NULL +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +// given a type, make an input iterator based on a pointer to that type +template +class istream_iterator : + public boost::iterator_facade< + istream_iterator, + Elem, + std::input_iterator_tag, + Elem + > +{ + friend class boost::iterator_core_access; + typedef istream_iterator this_t ; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_facade< + istream_iterator, + Elem, + std::input_iterator_tag, + Elem + > super_t; + typedef BOOST_DEDUCED_TYPENAME std::basic_istream istream_type; + + //Access the value referred to + Elem dereference() const { + return m_current_value; + } + + bool equal(const this_t & rhs) const { + // note: only works for comparison against end of stream + return m_istream == rhs.m_istream; + } + + void increment(){ + if(NULL != m_istream){ + m_current_value = static_cast(m_istream->get()); + if(! m_istream->good()){ + const_cast(this)->m_istream = NULL; + } + } + } + + istream_type *m_istream; + Elem m_current_value; +public: + istream_iterator(istream_type & is) : + m_istream(& is) + { + increment(); + } + + istream_iterator() : + m_istream(NULL) + {} + + istream_iterator(const istream_iterator & rhs) : + m_istream(rhs.m_istream), + m_current_value(rhs.m_current_value) + {} + +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_ISTREAM_ITERATOR_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/mb_from_wchar.hpp b/3rdParty/Boost/src/boost/archive/iterators/mb_from_wchar.hpp new file mode 100644 index 0000000..d8f8a12 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/mb_from_wchar.hpp @@ -0,0 +1,136 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP +#define BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// mb_from_wchar.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 +#include // size_t +#include // for wctomb() + +#include // for BOOST_DEDUCED_TYPENAME +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; + using ::wctomb; +} // namespace std +#endif + +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// class used by text archives to translate wide strings and to char +// strings of the currently selected locale +template // the input iterator +class mb_from_wchar + : public boost::iterator_adaptor< + mb_from_wchar, + Base, + wchar_t, + single_pass_traversal_tag, + char + > +{ + friend class boost::iterator_core_access; + + typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + mb_from_wchar, + Base, + wchar_t, + single_pass_traversal_tag, + char + > super_t; + + typedef mb_from_wchar this_t; + + char dereference_impl() { + if(! m_full){ + fill(); + m_full = true; + } + return m_buffer[m_bnext]; + } + char dereference() const { + return (const_cast(this))->dereference_impl(); + } + + // test for iterator equality + bool equal(const mb_from_wchar & rhs) const { + // once the value is filled, the base_reference has been incremented + // so don't permit comparison anymore. + return + 0 == m_bend + && 0 == m_bnext + && this->base_reference() == rhs.base_reference() + ; + } + + void fill(){ + 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); + #else + m_bend = std::wctomb(m_buffer, value); + #endif + BOOST_ASSERT(-1 != m_bend); + BOOST_ASSERT((std::size_t)m_bend <= sizeof(m_buffer)); + BOOST_ASSERT(m_bend > 0); + m_bnext = 0; + } + + void increment(){ + if(++m_bnext < m_bend) + return; + m_bend = + m_bnext = 0; + ++(this->base_reference()); + m_full = false; + } + + // buffer to handle pending characters + int m_bend; + int m_bnext; + char m_buffer[9]; + bool m_full; + +public: + // make composible buy using templated constructor + template + mb_from_wchar(BOOST_PFTO_WRAPPER(T) start) : + super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + m_bend(0), + m_bnext(0), + m_full(false) + {} + // intel 7.1 doesn't like default copy constructor + mb_from_wchar(const mb_from_wchar & rhs) : + super_t(rhs.base_reference()), + m_bend(rhs.m_bend), + m_bnext(rhs.m_bnext), + m_full(rhs.m_full) + {} +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_MB_FROM_WCHAR_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/ostream_iterator.hpp b/3rdParty/Boost/src/boost/archive/iterators/ostream_iterator.hpp new file mode 100644 index 0000000..7c3203f --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/ostream_iterator.hpp @@ -0,0 +1,83 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP +#define BOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// ostream_iterator.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. + +// note: this is a custom version of the standard ostream_iterator. +// This is necessary as the standard version doesn't work as expected +// for wchar_t based streams on systems for which wchar_t not a true +// type but rather a synonym for some integer type. + +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +// given a type, make an input iterator based on a pointer to that type +template +class ostream_iterator : + public boost::iterator_facade< + ostream_iterator, + Elem, + std::output_iterator_tag, + ostream_iterator & + > +{ + friend class boost::iterator_core_access; + typedef ostream_iterator this_t ; + typedef Elem char_type; + typedef std::basic_ostream ostream_type; + + //emulate the behavior of std::ostream + ostream_iterator & dereference() const { + return const_cast(*this); + } + bool equal(const this_t & rhs) const { + return m_ostream == rhs.m_ostream; + } + void increment(){} +protected: + ostream_type *m_ostream; + void put_val(char_type e){ + if(NULL != m_ostream){ + m_ostream->put(e); + if(! m_ostream->good()) + m_ostream = NULL; + } + } +public: + this_t & operator=(char_type c){ + put_val(c); + return *this; + } + ostream_iterator(ostream_type & os) : + m_ostream (& os) + {} + ostream_iterator() : + m_ostream (NULL) + {} + ostream_iterator(const ostream_iterator & rhs) : + m_ostream (rhs.m_ostream) + {} +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_OSTREAM_ITERATOR_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/remove_whitespace.hpp b/3rdParty/Boost/src/boost/archive/iterators/remove_whitespace.hpp new file mode 100644 index 0000000..a01049f --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/remove_whitespace.hpp @@ -0,0 +1,176 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP +#define BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// remove_whitespace.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 + +#include // for BOOST_DEDUCED_TYPENAME + +#include + +#include +#include +#include + +//#include +//#if ! BOOST_WORKAROUND(BOOST_MSVC, <=1300) + +// here is the default standard implementation of the functor used +// by the filter iterator to remove spaces. Unfortunately usage +// of this implementation in combination with spirit trips a bug +// VC 6.5. The only way I can find to work around it is to +// implement a special non-standard version for this platform + +#ifndef BOOST_NO_CWCTYPE +#include // iswspace +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ using ::iswspace; } +#endif +#endif + +#include // isspace +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ using ::isspace; } +#endif + +#if defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) +// this is required for the RW STL on Linux and Tru64. +#undef isspace +#undef iswspace +#endif + +//#endif // BOOST_WORKAROUND + +namespace { // anonymous + +template +struct remove_whitespace_predicate; + +template<> +struct remove_whitespace_predicate +{ + bool operator()(unsigned char t){ + return ! std::isspace(t); + } +}; + +#ifndef BOOST_NO_CWCHAR +template<> +struct remove_whitespace_predicate +{ + bool operator()(wchar_t t){ + return ! std::iswspace(t); + } +}; +#endif + +} // namespace anonymous + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// convert base64 file data (including whitespace and padding) to binary + +namespace boost { +namespace archive { +namespace iterators { + +// custom version of filter iterator which doesn't look ahead further than +// necessary + +template +class filter_iterator + : public boost::iterator_adaptor< + filter_iterator, + Base, + use_default, + single_pass_traversal_tag + > +{ + friend class boost::iterator_core_access; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + filter_iterator, + Base, + use_default, + single_pass_traversal_tag + > super_t; + typedef filter_iterator this_t; + typedef BOOST_DEDUCED_TYPENAME super_t::reference reference_type; + + reference_type dereference_impl(){ + if(! m_full){ + while(! m_predicate(* this->base_reference())) + ++(this->base_reference()); + m_full = true; + } + return * this->base_reference(); + } + + reference_type dereference() const { + return const_cast(this)->dereference_impl(); + } + + Predicate m_predicate; + bool m_full; +public: + // note: this function is public only because comeau compiler complained + // I don't know if this is because the compiler is wrong or what + void increment(){ + m_full = false; + ++(this->base_reference()); + } + filter_iterator(Base start) : + super_t(start), + m_full(false) + {} + filter_iterator(){} +}; + +template +class remove_whitespace : + public filter_iterator< + remove_whitespace_predicate< + BOOST_DEDUCED_TYPENAME boost::iterator_value::type + //BOOST_DEDUCED_TYPENAME Base::value_type + >, + Base + > +{ + friend class boost::iterator_core_access; + typedef filter_iterator< + remove_whitespace_predicate< + BOOST_DEDUCED_TYPENAME boost::iterator_value::type + //BOOST_DEDUCED_TYPENAME Base::value_type + >, + Base + > super_t; +public: +// remove_whitespace(){} // why is this needed? + // make composible buy using templated constructor + template + remove_whitespace(BOOST_PFTO_WRAPPER(T) start) : + super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) + {} + // intel 7.1 doesn't like default copy constructor + remove_whitespace(const remove_whitespace & rhs) : + super_t(rhs.base_reference()) + {} +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_REMOVE_WHITESPACE_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/transform_width.hpp b/3rdParty/Boost/src/boost/archive/iterators/transform_width.hpp new file mode 100644 index 0000000..6e2c526 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/transform_width.hpp @@ -0,0 +1,170 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP +#define BOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// transform_width.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. + +// iterator which takes elements of x bits and returns elements of y bits. +// used to change streams of 8 bit characters into streams of 6 bit characters. +// and vice-versa for implementing base64 encodeing/decoding. Be very careful +// when using and end iterator. end is only reliable detected when the input +// stream length is some common multiple of x and y. E.G. Base64 6 bit +// character and 8 bit bytes. Lowest common multiple is 24 => 4 6 bit characters +// or 3 8 bit characters + +#include + +#include // for BOOST_DEDUCED_TYPENAME & PTFO +#include + +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// class used by text archives to translate char strings to wchar_t +// strings of the currently selected locale +template< + class Base, + int BitsOut, + int BitsIn, + class CharType = BOOST_DEDUCED_TYPENAME boost::iterator_value::type // output character +> +class transform_width : + public boost::iterator_adaptor< + transform_width, + Base, + CharType, + single_pass_traversal_tag, + CharType + > +{ + friend class boost::iterator_core_access; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + transform_width, + Base, + CharType, + single_pass_traversal_tag, + CharType + > super_t; + + typedef transform_width this_t; + typedef BOOST_DEDUCED_TYPENAME iterator_value::type base_value_type; + + CharType fill(); + + CharType dereference_impl(){ + if(! m_full){ + m_current_value = fill(); + m_full = true; + } + return m_current_value; + } + + CharType dereference() const { + return const_cast(this)->dereference_impl(); + } + + // test for iterator equality + bool equal(const this_t & rhs) const { + return + this->base_reference() == rhs.base_reference(); + ; + } + + void increment(){ + m_displacement += BitsOut; + + while(m_displacement >= BitsIn){ + m_displacement -= BitsIn; + if(0 == m_displacement) + m_bufferfull = false; + if(! m_bufferfull){ + // note: suspect that this is not invoked for borland + ++(this->base_reference()); + } + } + m_full = false; + } + + CharType m_current_value; + // number of bits left in current input character buffer + unsigned int m_displacement; + base_value_type m_buffer; + // flag to current output character is ready - just used to save time + bool m_full; + // flag to indicate that m_buffer has data + bool m_bufferfull; + +public: + // make composible buy using templated constructor + template + transform_width(BOOST_PFTO_WRAPPER(T) start) : + super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + m_displacement(0), + m_full(false), + m_bufferfull(false) + {} + // intel 7.1 doesn't like default copy constructor + transform_width(const transform_width & rhs) : + super_t(rhs.base_reference()), + m_current_value(rhs.m_current_value), + m_displacement(rhs.m_displacement), + m_buffer(rhs.m_buffer), + m_full(rhs.m_full), + m_bufferfull(rhs.m_bufferfull) + {} +}; + +template +CharType transform_width::fill(){ + CharType retval = 0; + unsigned int missing_bits = BitsOut; + for(;;){ + unsigned int bcount; + if(! m_bufferfull){ + m_buffer = * this->base_reference(); + m_bufferfull = true; + bcount = BitsIn; + } + else + bcount = BitsIn - m_displacement; + unsigned int i = (std::min)(bcount, missing_bits); + // shift interesting bits to least significant position + unsigned int j = m_buffer >> (bcount - i); + // strip off uninteresting bits + // (note presumption of two's complement arithmetic) + j &= ~(-(1 << i)); + // append then interesting bits to the output value + retval <<= i; + retval |= j; + missing_bits -= i; + if(0 == missing_bits) + break; + // note: suspect that this is not invoked for borland 5.51 + ++(this->base_reference()); + m_bufferfull = false; + } + return retval; +} + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_TRANSFORM_WIDTH_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/unescape.hpp b/3rdParty/Boost/src/boost/archive/iterators/unescape.hpp new file mode 100644 index 0000000..9cbd316 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/unescape.hpp @@ -0,0 +1,91 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP +#define BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// unescape.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 + +#include // for BOOST_DEDUCED_TYPENAME +#include +//#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// class used by text archives to translate char strings to wchar_t +// strings of the currently selected locale +template +class unescape + : public boost::iterator_adaptor< + unescape, + Base, + BOOST_DEDUCED_TYPENAME pointee::type, + single_pass_traversal_tag, + BOOST_DEDUCED_TYPENAME pointee::type + > +{ + friend class boost::iterator_core_access; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + unescape, + Base, + BOOST_DEDUCED_TYPENAME pointee::type, + single_pass_traversal_tag, + BOOST_DEDUCED_TYPENAME pointee::type + > super_t; + + typedef unescape this_t; +public: + typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type; + typedef BOOST_DEDUCED_TYPENAME this_t::reference reference; +private: + value_type dereference_impl() { + if(! m_full){ + m_current_value = static_cast(this)->drain(); + m_full = true; + } + return m_current_value; + } + + reference dereference() const { + return const_cast(this)->dereference_impl(); + } + + value_type m_current_value; + bool m_full; + + void increment(){ + ++(this->base_reference()); + dereference_impl(); + m_full = false; + }; + +public: + + unescape(Base base) : + super_t(base), + m_full(false) + {} + +}; + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_UNESCAPE_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/wchar_from_mb.hpp b/3rdParty/Boost/src/boost/archive/iterators/wchar_from_mb.hpp new file mode 100644 index 0000000..4da8121 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/wchar_from_mb.hpp @@ -0,0 +1,129 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP +#define BOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// wchar_from_mb.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 +#include +#include // size_t +#include // mblen + +#include // for BOOST_DEDUCED_TYPENAME +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::mblen; + using ::mbtowc; +} // namespace std +#endif + +#include +#include + +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// class used by text archives to translate char strings to wchar_t +// strings of the currently selected locale +template +class wchar_from_mb + : public boost::iterator_adaptor< + wchar_from_mb, + Base, + wchar_t, + single_pass_traversal_tag, + wchar_t + > +{ + friend class boost::iterator_core_access; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_adaptor< + wchar_from_mb, + Base, + wchar_t, + single_pass_traversal_tag, + wchar_t + > super_t; + + typedef wchar_from_mb this_t; + + wchar_t drain(); + + wchar_t dereference_impl() { + if(! m_full){ + m_current_value = drain(); + m_full = true; + } + return m_current_value; + } + + wchar_t dereference() const { + return const_cast(this)->dereference_impl(); + } + + void increment(){ + dereference_impl(); + m_full = false; + ++(this->base_reference()); + }; + + wchar_t m_current_value; + bool m_full; + +public: + // make composible buy using templated constructor + template + wchar_from_mb(BOOST_PFTO_WRAPPER(T) start) : + super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))), + m_full(false) + {} + // intel 7.1 doesn't like default copy constructor + wchar_from_mb(const wchar_from_mb & rhs) : + super_t(rhs.base_reference()), + m_full(rhs.m_full) + {} +}; + +template +wchar_t wchar_from_mb::drain(){ + char buffer[9]; + char * bptr = buffer; + char val; + for(std::size_t i = 0; i++ < (unsigned)MB_CUR_MAX;){ + val = * this->base_reference(); + *bptr++ = val; + int result = std::mblen(buffer, i); + if(-1 != result) + break; + ++(this->base_reference()); + } + wchar_t retval; + int result = std::mbtowc(& retval, buffer, MB_CUR_MAX); + if(0 >= result) + boost::serialization::throw_exception(iterators::dataflow_exception( + iterators::dataflow_exception::invalid_conversion + )); + return retval; +} + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_WCHAR_FROM_MB_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/xml_escape.hpp b/3rdParty/Boost/src/boost/archive/iterators/xml_escape.hpp new file mode 100644 index 0000000..eadb96e --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/xml_escape.hpp @@ -0,0 +1,125 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP +#define BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_escape.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 + +#include // for BOOST_DEDUCED_TYPENAME +#include + +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// insert escapes into xml text + +template +class xml_escape + : public escape, Base> +{ + friend class boost::iterator_core_access; + + typedef escape, Base> super_t; + +public: + char fill(const char * & bstart, const char * & bend); + wchar_t fill(const wchar_t * & bstart, const wchar_t * & bend); + + template + xml_escape(BOOST_PFTO_WRAPPER(T) start) : + super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) + {} + // intel 7.1 doesn't like default copy constructor + xml_escape(const xml_escape & rhs) : + super_t(rhs.base_reference()) + {} +}; + +template +char xml_escape::fill( + const char * & bstart, + const char * & bend +){ + char current_value = * this->base_reference(); + switch(current_value){ + case '<': + bstart = "<"; + bend = bstart + 4; + break; + case '>': + bstart = ">"; + bend = bstart + 4; + break; + case '&': + bstart = "&"; + bend = bstart + 5; + break; + case '"': + bstart = """; + bend = bstart + 6; + break; + case '\'': + bstart = "'"; + bend = bstart + 6; + break; + default: + return current_value; + } + return *bstart; +} + +template +wchar_t xml_escape::fill( + const wchar_t * & bstart, + const wchar_t * & bend +){ + wchar_t current_value = * this->base_reference(); + switch(current_value){ + case '<': + bstart = L"<"; + bend = bstart + 4; + break; + case '>': + bstart = L">"; + bend = bstart + 4; + break; + case '&': + bstart = L"&"; + bend = bstart + 5; + break; + case '"': + bstart = L"""; + bend = bstart + 6; + break; + case '\'': + bstart = L"'"; + bend = bstart + 6; + break; + default: + return current_value; + } + return *bstart; +} + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_XML_ESCAPE_HPP diff --git a/3rdParty/Boost/src/boost/archive/iterators/xml_unescape.hpp b/3rdParty/Boost/src/boost/archive/iterators/xml_unescape.hpp new file mode 100644 index 0000000..3295adb --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/iterators/xml_unescape.hpp @@ -0,0 +1,128 @@ +#ifndef BOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP +#define BOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_unescape.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 + +#include // for BOOST_DEDUCED_TYPENAME + +#include +#include + +#include +#include + +namespace boost { +namespace archive { +namespace iterators { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// replace &??? xml escape sequences with the corresponding characters +template +class xml_unescape + : public unescape, Base> +{ + friend class boost::iterator_core_access; + typedef xml_unescape this_t; + typedef unescape super_t; + typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference reference_type; + + reference_type dereference() const { + return unescape, Base>::dereference(); + } +public: + // workaround msvc 7.1 ICU crash + #if defined(BOOST_MSVC) + typedef int value_type; + #else + typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type; + #endif + + void drain_residue(const char *literal); + value_type drain(); + + template + xml_unescape(BOOST_PFTO_WRAPPER(T) start) : + super_t(Base(BOOST_MAKE_PFTO_WRAPPER(static_cast< T >(start)))) + {} + // intel 7.1 doesn't like default copy constructor + xml_unescape(const xml_unescape & rhs) : + super_t(rhs.base_reference()) + {} +}; + +template +void xml_unescape::drain_residue(const char * literal){ + do{ + if(* literal != * ++(this->base_reference())) + boost::serialization::throw_exception( + dataflow_exception( + dataflow_exception::invalid_xml_escape_sequence + ) + ); + } + while('\0' != * ++literal); +} + +// note key constraint on this function is that can't "look ahead" any +// more than necessary into base iterator. Doing so would alter the base +// iterator refenence which would make subsequent iterator comparisons +// incorrect and thereby break the composiblity of iterators. +template +BOOST_DEDUCED_TYPENAME xml_unescape::value_type +//int +xml_unescape::drain(){ + value_type retval = * this->base_reference(); + if('&' != retval){ + return retval; + } + retval = * ++(this->base_reference()); + switch(retval){ + case 'l': // < + drain_residue("t;"); + retval = '<'; + break; + case 'g': // > + drain_residue("t;"); + retval = '>'; + break; + case 'a': + retval = * ++(this->base_reference()); + switch(retval){ + case 'p': // ' + drain_residue("os;"); + retval = '\''; + break; + case 'm': // & + drain_residue("p;"); + retval = '&'; + break; + } + break; + case 'q': + drain_residue("uot;"); + retval = '"'; + break; + } + return retval; +} + +} // namespace iterators +} // namespace archive +} // namespace boost + +#endif // BOOST_ARCHIVE_ITERATORS_XML_UNESCAPE_HPP diff --git a/3rdParty/Boost/src/boost/archive/polymorphic_iarchive.hpp b/3rdParty/Boost/src/boost/archive/polymorphic_iarchive.hpp new file mode 100644 index 0000000..2f76cf2 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/polymorphic_iarchive.hpp @@ -0,0 +1,181 @@ +#ifndef BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP +#define BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_iarchive.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 // std::size_t +#include // ULONG_MAX +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include + +#include +#include +#include +#include +#include + +#include +#include // must be the last header + +namespace boost { +template +class shared_ptr; +namespace serialization { + class extended_type_info; +} // 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 polymorphic_iarchive; + +class polymorphic_iarchive_impl : + public detail::interface_iarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_iarchive; + friend class load_access; +#endif + // primitive types the only ones permitted by polymorphic archives + virtual void load(bool & t) = 0; + + virtual void load(char & t) = 0; + virtual void load(signed char & t) = 0; + virtual void load(unsigned char & t) = 0; + #ifndef BOOST_NO_CWCHAR + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + virtual void load(wchar_t & t) = 0; + #endif + #endif + virtual void load(short & t) = 0; + virtual void load(unsigned short & t) = 0; + virtual void load(int & t) = 0; + virtual void load(unsigned int & t) = 0; + virtual void load(long & t) = 0; + virtual void load(unsigned long & t) = 0; + + #if defined(BOOST_HAS_LONG_LONG) + virtual void load(boost::long_long_type & t) = 0; + virtual void load(boost::ulong_long_type & t) = 0; + #elif defined(BOOST_HAS_MS_INT64) + virtual void load(__int64 & t) = 0; + virtual void load(unsigned __int64 & t) = 0; + #endif + + virtual void load(float & t) = 0; + virtual void load(double & t) = 0; + + // string types are treated as primitives + virtual void load(std::string & t) = 0; + #ifndef BOOST_NO_STD_WSTRING + virtual void load(std::wstring & t) = 0; + #endif + + // used for xml and other tagged formats + 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; + + // msvc and borland won't automatically pass these to the base class so + // make it explicit here + template + void load_override(T & t, BOOST_PFTO int) + { + archive::load(* this->This(), t); + } + // special treatment for name-value pairs. + template + void load_override( + #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + const + #endif + boost::serialization::nvp< T > & t, + int + ){ + load_start(t.name()); + archive::load(* this->This(), t.value()); + load_end(t.name()); + } +protected: + virtual ~polymorphic_iarchive_impl(){}; +public: + // utility function implemented by all legal archives + virtual void set_library_version(library_version_type archive_library_version) = 0; + virtual library_version_type get_library_version() const = 0; + virtual unsigned int get_flags() const = 0; + virtual void delete_created_pointers() = 0; + virtual void reset_object_address( + const void * new_address, + const void * old_address + ) = 0; + + virtual void load_binary(void * t, std::size_t size) = 0; + + // these are used by the serialization library implementation. + virtual void load_object( + void *t, + const detail::basic_iserializer & bis + ) = 0; + virtual const detail::basic_pointer_iserializer * load_pointer( + void * & t, + const detail::basic_pointer_iserializer * bpis_ptr, + const detail::basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & type + ) + ) = 0; +}; + +} // namespace archive +} // namespace boost + +#include // pops abi_suffix.hpp pragmas + +// note special treatment of shared_ptr. This type needs a special +// structure associated with every archive. We created a "mix-in" +// class to provide this functionality. Since shared_ptr holds a +// special esteem in the boost library - we included it here by default. +#include + +namespace boost { +namespace archive { + +class polymorphic_iarchive : + public polymorphic_iarchive_impl, + public detail::shared_ptr_helper +{ +public: + virtual ~polymorphic_iarchive(){}; +}; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::polymorphic_iarchive) + +#endif // BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/polymorphic_oarchive.hpp b/3rdParty/Boost/src/boost/archive/polymorphic_oarchive.hpp new file mode 100644 index 0000000..420029b --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/polymorphic_oarchive.hpp @@ -0,0 +1,159 @@ +#ifndef BOOST_ARCHIVE_POLYMORPHIC_OARCHIVE_HPP +#define BOOST_ARCHIVE_POLYMORPHIC_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_oarchive.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 // size_t +#include // ULONG_MAX +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include // must be the last header + +namespace boost { +template +class shared_ptr; +namespace serialization { + class extended_type_info; +} // 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 polymorphic_oarchive; + +class polymorphic_oarchive_impl : + public detail::interface_oarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_oarchive; + friend class save_access; +#endif + // primitive types the only ones permitted by polymorphic archives + virtual void save(const bool t) = 0; + + virtual void save(const char t) = 0; + virtual void save(const signed char t) = 0; + virtual void save(const unsigned char t) = 0; + #ifndef BOOST_NO_CWCHAR + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + virtual void save(const wchar_t t) = 0; + #endif + #endif + virtual void save(const short t) = 0; + virtual void save(const unsigned short t) = 0; + virtual void save(const int t) = 0; + virtual void save(const unsigned int t) = 0; + virtual void save(const long t) = 0; + virtual void save(const unsigned long t) = 0; + + #if defined(BOOST_HAS_LONG_LONG) + virtual void save(const boost::long_long_type t) = 0; + virtual void save(const boost::ulong_long_type t) = 0; + #elif defined(BOOST_HAS_MS_INT64) + virtual void save(const __int64 t) = 0; + virtual void save(const unsigned __int64 t) = 0; + #endif + + virtual void save(const float t) = 0; + virtual void save(const double t) = 0; + + // string types are treated as primitives + virtual void save(const std::string & t) = 0; + #ifndef BOOST_NO_STD_WSTRING + virtual void save(const std::wstring & t) = 0; + #endif + + virtual void save_null_pointer() = 0; + // used for xml and other tagged formats + 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 void end_preamble() = 0; + + // msvc and borland won't automatically pass these to the base class so + // make it explicit here + template + void save_override(T & t, BOOST_PFTO int) + { + archive::save(* this->This(), t); + } + // special treatment for name-value pairs. + template + void save_override( + #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + const + #endif + ::boost::serialization::nvp< T > & t, int + ){ + save_start(t.name()); + archive::save(* this->This(), t.const_value()); + save_end(t.name()); + } +protected: + virtual ~polymorphic_oarchive_impl(){}; +public: + // utility functions implemented by all legal archives + virtual unsigned int get_flags() const = 0; + virtual library_version_type get_library_version() const = 0; + virtual void save_binary(const void * t, std::size_t size) = 0; + + virtual void save_object( + const void *x, + const detail::basic_oserializer & bos + ) = 0; + virtual void save_pointer( + const void * t, + const detail::basic_pointer_oserializer * bpos_ptr + ) = 0; +}; + +// note: preserve naming symmetry +class polymorphic_oarchive : + public polymorphic_oarchive_impl +{ +public: + virtual ~polymorphic_oarchive(){}; +}; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::polymorphic_oarchive) + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_POLYMORPHIC_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/shared_ptr_helper.hpp b/3rdParty/Boost/src/boost/archive/shared_ptr_helper.hpp new file mode 100644 index 0000000..39e6eb8 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/shared_ptr_helper.hpp @@ -0,0 +1,219 @@ +#ifndef BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP +#define BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// shared_ptr_helper.hpp: serialization for boost shared pointern + +// (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo +// 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 +#include +#include +#include // NULL + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include // must be the last headern + +namespace boost_132 { + template class shared_ptr; +} +namespace boost { + template class shared_ptr; + namespace serialization { + class extended_type_info; + template + inline void load( + Archive & ar, + boost::shared_ptr< T > &t, + const unsigned int file_version + ); + } +namespace archive{ +namespace detail { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// a common class for holding various types of shared pointers + +class shared_ptr_helper { + struct collection_type_compare { + bool operator()( + const shared_ptr &lhs, + const shared_ptr &rhs + )const{ + return lhs.get() < rhs.get(); + } + }; + typedef std::set< + boost::shared_ptr, + collection_type_compare + > collection_type; + typedef collection_type::const_iterator iterator_type; + // list of shared_pointers create accessable by raw pointer. This + // is used to "match up" shared pointers loaded at different + // points in the archive. Note, we delay construction until + // it is actually used since this is by default included as + // a "mix-in" even if shared_ptr isn't used. + collection_type * m_pointers; + + struct null_deleter { + void operator()(void const *) const {} + }; + + struct void_deleter { + const boost::serialization::extended_type_info * m_eti; + void_deleter(const boost::serialization::extended_type_info *eti) : + m_eti(eti) + {} + void operator()(void *vp) const { + m_eti->destroy(vp); + } + }; + +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + template + friend inline void boost::serialization::load( + Archive & ar, + boost::shared_ptr< T > &t, + const unsigned int file_version + ); +#endif + +// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP + // list of loaded pointers. This is used to be sure that the pointers + // stay around long enough to be "matched" with other pointers loaded + // by the same archive. These are created with a "null_deleter" so that + // when this list is destroyed - the underlaying raw pointers are not + // destroyed. This has to be done because the pointers are also held by + // new system which is disjoint from this set. This is implemented + // by a change in load_construct_data below. It makes this file suitable + // only for loading pointers into a 1.33 or later boost system. + std::list > * m_pointers_132; +// #endif + + // returns pointer to object and an indicator whether this is a + // new entry (true) or a previous one (false) + BOOST_ARCHIVE_DECL(shared_ptr) + get_od( + const void * od, + const boost::serialization::extended_type_info * true_type, + const boost::serialization::extended_type_info * this_type + ); + + BOOST_ARCHIVE_DECL(void) + append(const boost::shared_ptr &); + + template + struct non_polymorphic { + static const boost::serialization::extended_type_info * + get_object_identifier(T &){ + return & boost::serialization::singleton< + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation< T >::type + >::get_const_instance(); + } + }; + template + struct polymorphic { + static const boost::serialization::extended_type_info * + get_object_identifier(T & t){ + return boost::serialization::singleton< + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation< T >::type + >::get_const_instance().get_derived_extended_type_info(t); + } + }; +public: + template + void reset(shared_ptr< T > & s, T * t){ + if(NULL == t){ + s.reset(); + return; + } + const boost::serialization::extended_type_info * this_type + = & boost::serialization::type_info_implementation< T >::type + ::get_const_instance(); + + // get pointer to the most derived object. This is effectively + // the object identifern + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_polymorphic< T >, + mpl::identity >, + mpl::identity > + >::type type; + + const boost::serialization::extended_type_info * true_type + = type::get_object_identifier(*t); + + // note:if this exception is thrown, be sure that derived pointern + // is either registered or exported. + if(NULL == true_type) + boost::serialization::throw_exception( + archive_exception( + archive_exception::unregistered_class, + this_type->get_debug_info() + ) + ); + shared_ptr r = + get_od( + static_cast(t), + true_type, + this_type + ); + if(!r){ + s.reset(t); + const void * od = void_downcast( + *true_type, + *this_type, + static_cast(t) + ); + shared_ptr sp(s, od); + append(sp); + } + else{ + s = shared_ptr< T >( + r, + static_cast(r.get()) + ); + } + } + +// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP + BOOST_ARCHIVE_DECL(void) + append(const boost_132::shared_ptr & t); +// #endif +public: + BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + shared_ptr_helper(); + BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + ~shared_ptr_helper(); +}; + +} // namespace detail +} // namespace archive +} // namespace boost + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP diff --git a/3rdParty/Boost/src/boost/archive/text_iarchive.hpp b/3rdParty/Boost/src/boost/archive/text_iarchive.hpp new file mode 100644 index 0000000..298928b --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/text_iarchive.hpp @@ -0,0 +1,156 @@ +#ifndef BOOST_ARCHIVE_TEXT_IARCHIVE_HPP +#define BOOST_ARCHIVE_TEXT_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_iarchive.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 + +#include +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class text_iarchive_impl : + public basic_text_iprimitive, + public basic_text_iarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_iarchive; + friend class basic_text_iarchive; + friend class load_access; +protected: +#endif + template + void load(T & t){ + basic_text_iprimitive::load(t); + } + void load(version_type & t){ + unsigned int v; + load(v); + t = version_type(v); + } + void load(boost::serialization::item_version_type & t){ + unsigned int v; + load(v); + t = boost::serialization::item_version_type(v); + } + BOOST_ARCHIVE_DECL(void) + load(char * t); + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + BOOST_ARCHIVE_DECL(void) + load(wchar_t * t); + #endif + BOOST_ARCHIVE_DECL(void) + load(std::string &s); + #ifndef BOOST_NO_STD_WSTRING + 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 + void load_override(T & t, BOOST_PFTO int){ + basic_text_iarchive::load_override(t, 0); + } + BOOST_ARCHIVE_DECL(void) + load_override(class_name_type & t, int); + BOOST_ARCHIVE_DECL(void) + init(); + BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + 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()) + ~text_iarchive_impl(){}; +}; + +// do not derive from the classes below. If you want to extend this functionality +// via inhertance, derived from text_iarchive_impl instead. This will +// preserve correct static polymorphism. + +// same as text_iarchive below - without the shared_ptr_helper +class naked_text_iarchive : + public text_iarchive_impl +{ +public: + naked_text_iarchive(std::istream & is_, unsigned int flags = 0) : + // note: added _ to suppress useless gcc warning + text_iarchive_impl(is_, flags) + {} + ~naked_text_iarchive(){} +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +// note special treatment of shared_ptr. This type needs a special +// structure associated with every archive. We created a "mix-in" +// class to provide this functionality. Since shared_ptr holds a +// special esteem in the boost library - we included it here by default. +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +class text_iarchive : + public text_iarchive_impl, + public detail::shared_ptr_helper +{ +public: + text_iarchive(std::istream & is_, unsigned int flags = 0) : + // note: added _ to suppress useless gcc warning + text_iarchive_impl(is_, flags) + {} + ~text_iarchive(){} +}; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_iarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_ARCHIVE_TEXT_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/text_oarchive.hpp b/3rdParty/Boost/src/boost/archive/text_oarchive.hpp new file mode 100644 index 0000000..2100d53 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/text_oarchive.hpp @@ -0,0 +1,119 @@ +#ifndef BOOST_ARCHIVE_TEXT_OARCHIVE_HPP +#define BOOST_ARCHIVE_TEXT_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_oarchive.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 +#include // std::size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class text_oarchive_impl : + /* protected ? */ public basic_text_oprimitive, + public basic_text_oarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_oarchive; + friend class basic_text_oarchive; + friend class save_access; +protected: +#endif + template + void save(const T & t){ + this->newtoken(); + basic_text_oprimitive::save(t); + } + void save(const version_type & t){ + save(static_cast(t)); + } + void save(const boost::serialization::item_version_type & t){ + save(static_cast(t)); + } + BOOST_ARCHIVE_DECL(void) + save(const char * t); + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + BOOST_ARCHIVE_DECL(void) + save(const wchar_t * t); + #endif + BOOST_ARCHIVE_DECL(void) + save(const std::string &s); + #ifndef BOOST_NO_STD_WSTRING + BOOST_ARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + 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()) + ~text_oarchive_impl(){}; +public: + 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 : + public text_oarchive_impl +{ +public: + text_oarchive(std::ostream & os_, unsigned int flags = 0) : + // note: added _ to suppress useless gcc warning + text_oarchive_impl(os_, flags) + {} + ~text_oarchive(){} +}; + +typedef text_oarchive naked_text_oarchive; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_oarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_TEXT_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/text_wiarchive.hpp b/3rdParty/Boost/src/boost/archive/text_wiarchive.hpp new file mode 100644 index 0000000..7451f3a --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/text_wiarchive.hpp @@ -0,0 +1,152 @@ +#ifndef BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP +#define BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_wiarchive.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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class text_wiarchive_impl : + public basic_text_iprimitive, + public basic_text_iarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_iarchive; + friend class basic_text_iarchive; + friend class load_access; +protected: +#endif + template + void load(T & t){ + basic_text_iprimitive::load(t); + } + void load(version_type & t){ + unsigned int v; + load(v); + t = version_type(v); + } + void load(boost::serialization::item_version_type & t){ + unsigned int v; + load(v); + t = boost::serialization::item_version_type(v); + } + BOOST_WARCHIVE_DECL(void) + load(char * t); + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + BOOST_WARCHIVE_DECL(void) + load(wchar_t * t); + #endif + BOOST_WARCHIVE_DECL(void) + load(std::string &s); + #ifndef BOOST_NO_STD_WSTRING + 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 + void load_override(T & t, BOOST_PFTO int){ + basic_text_iarchive::load_override(t, 0); + } + BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + text_wiarchive_impl(std::wistream & is, unsigned int flags); + ~text_wiarchive_impl(){}; +}; + +// do not derive from the classes below. If you want to extend this functionality +// via inhertance, derived from text_iarchive_impl instead. This will +// preserve correct static polymorphism. + +// same as text_wiarchive below - without the shared_ptr_helper +class naked_text_wiarchive : + public text_wiarchive_impl +{ +public: + naked_text_wiarchive(std::wistream & is, unsigned int flags = 0) : + text_wiarchive_impl(is, flags) + {} + ~naked_text_wiarchive(){} +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +// note special treatment of shared_ptr. This type needs a special +// structure associated with every archive. We created a "mix-in" +// class to provide this functionality. Since shared_ptr holds a +// special esteem in the boost library - we included it here by default. +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +class text_wiarchive : + public text_wiarchive_impl, + public detail::shared_ptr_helper +{ +public: + text_wiarchive(std::wistream & is, unsigned int flags = 0) : + text_wiarchive_impl(is, flags) + {} + ~text_wiarchive(){} +}; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_wiarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_NO_STD_WSTREAMBUF +#endif // BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/text_woarchive.hpp b/3rdParty/Boost/src/boost/archive/text_woarchive.hpp new file mode 100644 index 0000000..7ed0c82 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/text_woarchive.hpp @@ -0,0 +1,145 @@ +#ifndef BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP +#define BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_woarchive.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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include +#include // size_t + +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class text_woarchive_impl : + public basic_text_oprimitive, + public basic_text_oarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_oarchive; + friend class basic_text_oarchive; + friend class save_access; +protected: +#endif + template + void save(const T & t){ + this->newtoken(); + basic_text_oprimitive::save(t); + } + void save(const version_type & t){ + save(static_cast(t)); + } + void save(const boost::serialization::item_version_type & t){ + save(static_cast(t)); + } + BOOST_WARCHIVE_DECL(void) + save(const char * t); + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + BOOST_WARCHIVE_DECL(void) + save(const wchar_t * t); + #endif + BOOST_WARCHIVE_DECL(void) + save(const std::string &s); + #ifndef BOOST_NO_STD_WSTRING + BOOST_WARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + text_woarchive_impl(std::wostream & os, unsigned int flags) : + basic_text_oprimitive( + os, + 0 != (flags & no_codecvt) + ), + basic_text_oarchive(flags) + { + if(0 == (flags & no_header)) + basic_text_oarchive::init(); + } +public: + void save_binary(const void *address, std::size_t count){ + put(static_cast('\n')); + this->end_preamble(); + #if ! defined(__MWERKS__) + this->basic_text_oprimitive::save_binary( + #else + this->basic_text_oprimitive::save_binary( + #endif + address, + count + ); + put(static_cast('\n')); + this->delimiter = this->none; + } + +}; + +// we use the following because we can't use +// typedef text_oarchive_impl > text_oarchive; + +// 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 : + public text_woarchive_impl +{ +public: + text_woarchive(std::wostream & os, unsigned int flags = 0) : + text_woarchive_impl(os, flags) + {} + ~text_woarchive(){} +}; + +typedef text_woarchive naked_text_woarchive; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_woarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_NO_STD_WSTREAMBUF +#endif // BOOST_ARCHIVE_TEXT_WOARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/wcslen.hpp b/3rdParty/Boost/src/boost/archive/wcslen.hpp new file mode 100644 index 0000000..5c14acf --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/wcslen.hpp @@ -0,0 +1,56 @@ +#ifndef BOOST_ARCHIVE_WCSLEN_HPP +#define BOOST_ARCHIVE_WCSLEN_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// wcslen.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 // size_t +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#ifndef BOOST_NO_CWCHAR + +// a couple of libraries which include wchar_t don't include +// wcslen + +#if defined(BOOST_DINKUMWARE_STDLIB) && BOOST_DINKUMWARE_STDLIB < 306 \ +|| defined(__LIBCOMO__) + +namespace std { +inline std::size_t wcslen(const wchar_t * ws) +{ + const wchar_t * eows = ws; + while(* eows != 0) + ++eows; + return eows - ws; +} +} // namespace std + +#else + +#include +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std{ using ::wcslen; } +#endif + +#endif // wcslen + +#endif //BOOST_NO_CWCHAR + +#endif //BOOST_ARCHIVE_WCSLEN_HPP diff --git a/3rdParty/Boost/src/boost/archive/xml_archive_exception.hpp b/3rdParty/Boost/src/boost/archive/xml_archive_exception.hpp new file mode 100644 index 0000000..48e6cb3 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/xml_archive_exception.hpp @@ -0,0 +1,56 @@ +#ifndef BOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP +#define BOOST_ARCHIVE_XML_ARCHIVE_EXCEPTION_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_archive_exception.hpp: + +// (C) Copyright 2007 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 +#include + +#include +#include +#include +#include + +#include // must be the last header + +namespace boost { +namespace archive { + +////////////////////////////////////////////////////////////////////// +// exceptions thrown by xml archives +// +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) xml_archive_exception : + public virtual boost::archive::archive_exception +{ +public: + typedef enum { + xml_archive_parsing_error, // see save_register + xml_archive_tag_mismatch, + xml_archive_tag_name_error + } exception_code; + xml_archive_exception( + exception_code c, + const char * e1 = NULL, + const char * e2 = NULL + ); +}; + +}// namespace archive +}// namespace boost + +#include // pops abi_suffix.hpp pragmas + +#endif //BOOST_XML_ARCHIVE_ARCHIVE_EXCEPTION_HPP diff --git a/3rdParty/Boost/src/boost/archive/xml_iarchive.hpp b/3rdParty/Boost/src/boost/archive/xml_iarchive.hpp new file mode 100644 index 0000000..be6cfe4 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/xml_iarchive.hpp @@ -0,0 +1,164 @@ +#ifndef BOOST_ARCHIVE_XML_IARCHIVE_HPP +#define BOOST_ARCHIVE_XML_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_iarchive.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 + +//#include +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class basic_xml_grammar; +typedef basic_xml_grammar xml_grammar; + +template +class xml_iarchive_impl : + public basic_text_iprimitive, + public basic_xml_iarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_iarchive; + friend class basic_xml_iarchive; + friend class load_access; +protected: +#endif + // instances of micro xml parser to parse start preambles + // scoped_ptr doesn't play nice with borland - so use a naked pointer + // scoped_ptr gimpl; + xml_grammar *gimpl; + + std::istream & get_is(){ + return is; + } + template + void load(T & t){ + basic_text_iprimitive::load(t); + } + void + load(version_type & t){ + unsigned int v; + load(v); + t = version_type(v); + } + void + load(boost::serialization::item_version_type & t){ + unsigned int v; + load(v); + t = boost::serialization::item_version_type(v); + } + BOOST_ARCHIVE_DECL(void) + load(char * t); + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + BOOST_ARCHIVE_DECL(void) + load(wchar_t * t); + #endif + BOOST_ARCHIVE_DECL(void) + load(std::string &s); + #ifndef BOOST_NO_STD_WSTRING + BOOST_ARCHIVE_DECL(void) + load(std::wstring &ws); + #endif + template + void load_override(T & t, BOOST_PFTO int){ + basic_xml_iarchive::load_override(t, 0); + } + BOOST_ARCHIVE_DECL(void) + load_override(class_name_type & t, int); + BOOST_ARCHIVE_DECL(void) + init(); + BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + xml_iarchive_impl(std::istream & is, unsigned int flags); + BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + ~xml_iarchive_impl(); +}; + +// do not derive from the classes below. If you want to extend this functionality +// via inhertance, derived from text_iarchive_impl instead. This will +// preserve correct static polymorphism. + +// same as xml_iarchive below - without the shared_ptr_helper +class naked_xml_iarchive : + public xml_iarchive_impl +{ +public: + naked_xml_iarchive(std::istream & is, unsigned int flags = 0) : + xml_iarchive_impl(is, flags) + {} + ~naked_xml_iarchive(){} +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +// note special treatment of shared_ptr. This type needs a special +// structure associated with every archive. We created a "mix-in" +// class to provide this functionality. Since shared_ptr holds a +// special esteem in the boost library - we included it here by default. +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +class xml_iarchive : + public xml_iarchive_impl, + public detail::shared_ptr_helper +{ +public: + xml_iarchive(std::istream & is, unsigned int flags = 0) : + xml_iarchive_impl(is, flags) + {} + ~xml_iarchive(){}; +}; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_iarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_ARCHIVE_XML_IARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/xml_oarchive.hpp b/3rdParty/Boost/src/boost/archive/xml_oarchive.hpp new file mode 100644 index 0000000..167ba09 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/xml_oarchive.hpp @@ -0,0 +1,133 @@ +#ifndef BOOST_ARCHIVE_XML_OARCHIVE_HPP +#define BOOST_ARCHIVE_XML_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_oarchive.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 + +#include // size_t +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class xml_oarchive_impl : + public basic_text_oprimitive, + public basic_xml_oarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_oarchive; + friend class basic_xml_oarchive; + friend class save_access; +protected: +#endif + //void end_preamble(){ + // basic_xml_oarchive::end_preamble(); + //} + template + void save(const T & t){ + basic_text_oprimitive::save(t); + } + void + save(const version_type & t){ + save(static_cast(t)); + } + void + save(const boost::serialization::item_version_type & t){ + save(static_cast(t)); + } + BOOST_ARCHIVE_DECL(void) + save(const char * t); + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + BOOST_ARCHIVE_DECL(void) + save(const wchar_t * t); + #endif + BOOST_ARCHIVE_DECL(void) + save(const std::string &s); + #ifndef BOOST_NO_STD_WSTRING + BOOST_ARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) + xml_oarchive_impl(std::ostream & os, unsigned int flags); + ~xml_oarchive_impl(){} +public: + void save_binary(const void *address, std::size_t count){ + this->end_preamble(); + #if ! defined(__MWERKS__) + this->basic_text_oprimitive::save_binary( + #else + this->basic_text_oprimitive::save_binary( + #endif + address, + count + ); + this->indent_next = true; + } +}; + +// we use the following because we can't use +// typedef xml_oarchive_impl > xml_oarchive; + +// 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 : + public xml_oarchive_impl +{ +public: + xml_oarchive(std::ostream & os, unsigned int flags = 0) : + xml_oarchive_impl(os, flags) + {} + ~xml_oarchive(){} +}; + +typedef xml_oarchive naked_xml_oarchive; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_oarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/xml_wiarchive.hpp b/3rdParty/Boost/src/boost/archive/xml_wiarchive.hpp new file mode 100644 index 0000000..59ebbb5 --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/xml_wiarchive.hpp @@ -0,0 +1,170 @@ +#ifndef BOOST_ARCHIVE_XML_WIARCHIVE_HPP +#define BOOST_ARCHIVE_XML_WIARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_wiarchive.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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include + +//#include +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class basic_xml_grammar; +typedef basic_xml_grammar xml_wgrammar; + +template +class xml_wiarchive_impl : + public basic_text_iprimitive, + public basic_xml_iarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_iarchive; + friend class basic_xml_iarchive; + friend class load_access; +protected: +#endif + // instances of micro xml parser to parse start preambles + // scoped_ptr doesn't play nice with borland - so use a naked pointer + // scoped_ptr gimpl; + xml_wgrammar *gimpl; + std::wistream & get_is(){ + return is; + } + template + void + load(T & t){ + basic_text_iprimitive::load(t); + } + void + load(version_type & t){ + unsigned int v; + load(v); + t = version_type(v); + } + void + load(boost::serialization::item_version_type & t){ + unsigned int v; + load(v); + t = boost::serialization::item_version_type(v); + } + BOOST_WARCHIVE_DECL(void) + load(char * t); + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + BOOST_WARCHIVE_DECL(void) + load(wchar_t * t); + #endif + BOOST_WARCHIVE_DECL(void) + load(std::string &s); + #ifndef BOOST_NO_STD_WSTRING + BOOST_WARCHIVE_DECL(void) + load(std::wstring &ws); + #endif + template + void load_override(T & t, BOOST_PFTO int){ + basic_xml_iarchive::load_override(t, 0); + } + BOOST_WARCHIVE_DECL(void) + load_override(class_name_type & t, int); + BOOST_WARCHIVE_DECL(void) + init(); + BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + xml_wiarchive_impl(std::wistream & is, unsigned int flags) ; + BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + ~xml_wiarchive_impl(); +}; + +// do not derive from the classes below. If you want to extend this functionality +// via inhertance, derived from xml_wiarchive_impl instead. This will +// preserve correct static polymorphism. + +// same as xml_wiarchive below - without the shared_ptr_helper +class naked_xml_wiarchive : + public xml_wiarchive_impl +{ +public: + naked_xml_wiarchive(std::wistream & is, unsigned int flags = 0) : + xml_wiarchive_impl(is, flags) + {} + ~naked_xml_wiarchive(){} +}; + +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +// note special treatment of shared_ptr. This type needs a special +// structure associated with every archive. We created a "mix-in" +// class to provide this functionality. Since shared_ptr holds a +// special esteem in the boost library - we included it here by default. +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +class xml_wiarchive : + public xml_wiarchive_impl, + public detail::shared_ptr_helper +{ +public: + xml_wiarchive(std::wistream & is, unsigned int flags = 0) : + xml_wiarchive_impl(is, flags) + {} + ~xml_wiarchive(){} +}; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_wiarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_NO_STD_WSTREAMBUF +#endif // BOOST_ARCHIVE_XML_WIARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/archive/xml_woarchive.hpp b/3rdParty/Boost/src/boost/archive/xml_woarchive.hpp new file mode 100644 index 0000000..08c0fdc --- /dev/null +++ b/3rdParty/Boost/src/boost/archive/xml_woarchive.hpp @@ -0,0 +1,140 @@ +#ifndef BOOST_ARCHIVE_XML_WOARCHIVE_HPP +#define BOOST_ARCHIVE_XML_WOARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_woarchive.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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include // size_t +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include + +#include +#include +#include +#include +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace archive { + +template +class xml_woarchive_impl : + public basic_text_oprimitive, + public basic_xml_oarchive +{ +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class detail::interface_oarchive; + friend class basic_xml_oarchive; + friend class save_access; +protected: +#endif + //void end_preamble(){ + // basic_xml_oarchive::end_preamble(); + //} + template + void + save(const T & t){ + basic_text_oprimitive::save(t); + } + void + save(const version_type & t){ + save(static_cast(t)); + } + void + save(const boost::serialization::item_version_type & t){ + save(static_cast(t)); + } + BOOST_WARCHIVE_DECL(void) + save(const char * t); + #ifndef BOOST_NO_INTRINSIC_WCHAR_T + BOOST_WARCHIVE_DECL(void) + save(const wchar_t * t); + #endif + BOOST_WARCHIVE_DECL(void) + save(const std::string &s); + #ifndef BOOST_NO_STD_WSTRING + BOOST_WARCHIVE_DECL(void) + save(const std::wstring &ws); + #endif + BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY()) + xml_woarchive_impl(std::wostream & os, unsigned int flags); + ~xml_woarchive_impl(){} +public: + void + save_binary(const void *address, std::size_t count){ + this->end_preamble(); + #if ! defined(__MWERKS__) + this->basic_text_oprimitive::save_binary( + #else + this->basic_text_oprimitive::save_binary( + #endif + address, + count + ); + this->indent_next = true; + } +}; + +// we use the following because we can't use +// typedef xml_woarchive_impl > xml_woarchive; + +// 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 : + public xml_woarchive_impl +{ +public: + xml_woarchive(std::wostream & os, unsigned int flags = 0) : + xml_woarchive_impl(os, flags) + {} + ~xml_woarchive(){} +}; + +typedef xml_woarchive naked_xml_woarchive; + +} // namespace archive +} // namespace boost + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_woarchive) + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_NO_STD_WSTREAMBUF +#endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP diff --git a/3rdParty/Boost/src/boost/compressed_pair.hpp b/3rdParty/Boost/src/boost/compressed_pair.hpp new file mode 100644 index 0000000..e6cd6a0 --- /dev/null +++ b/3rdParty/Boost/src/boost/compressed_pair.hpp @@ -0,0 +1,24 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Use, modification and distribution are 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/libs/utility for most recent version including documentation. + +// See boost/detail/compressed_pair.hpp and boost/detail/ob_compressed_pair.hpp +// for full copyright notices. + +#ifndef BOOST_COMPRESSED_PAIR_HPP +#define BOOST_COMPRESSED_PAIR_HPP + +#ifndef BOOST_CONFIG_HPP +#include +#endif + +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#include +#else +#include +#endif + +#endif // BOOST_COMPRESSED_PAIR_HPP diff --git a/3rdParty/Boost/src/boost/detail/compressed_pair.hpp b/3rdParty/Boost/src/boost/detail/compressed_pair.hpp new file mode 100644 index 0000000..3f32645 --- /dev/null +++ b/3rdParty/Boost/src/boost/detail/compressed_pair.hpp @@ -0,0 +1,443 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Use, modification and distribution are 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/libs/utility for most recent version including documentation. + +// compressed_pair: pair that "compresses" empty members +// (see libs/utility/compressed_pair.htm) +// +// JM changes 25 Jan 2004: +// For the case where T1 == T2 and both are empty, then first() and second() +// should return different objects. +// JM changes 25 Jan 2000: +// Removed default arguments from compressed_pair_switch to get +// C++ Builder 4 to accept them +// rewriten swap to get gcc and C++ builder to compile. +// added partial specialisations for case T1 == T2 to avoid duplicate constructor defs. + +#ifndef BOOST_DETAIL_COMPRESSED_PAIR_HPP +#define BOOST_DETAIL_COMPRESSED_PAIR_HPP + +#include + +#include +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable:4512) +#endif +namespace boost +{ + +template +class compressed_pair; + + +// compressed_pair + +namespace details +{ + // JM altered 26 Jan 2000: + template + struct compressed_pair_switch; + + template + struct compressed_pair_switch + {static const int value = 0;}; + + template + struct compressed_pair_switch + {static const int value = 3;}; + + template + struct compressed_pair_switch + {static const int value = 1;}; + + template + struct compressed_pair_switch + {static const int value = 2;}; + + template + struct compressed_pair_switch + {static const int value = 4;}; + + template + struct compressed_pair_switch + {static const int value = 5;}; + + template class compressed_pair_imp; + +#ifdef __GNUC__ + // workaround for GCC (JM): + using std::swap; +#endif + // + // can't call unqualified swap from within classname::swap + // as Koenig lookup rules will find only the classname::swap + // member function not the global declaration, so use cp_swap + // as a forwarding function (JM): + template + inline void cp_swap(T& t1, T& t2) + { +#ifndef __GNUC__ + using std::swap; +#endif + swap(t1, t2); + } + + // 0 derive from neither + + template + class compressed_pair_imp + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_(x), second_(y) {} + + compressed_pair_imp(first_param_type x) + : first_(x) {} + + compressed_pair_imp(second_param_type y) + : second_(y) {} + + first_reference first() {return first_;} + first_const_reference first() const {return first_;} + + second_reference second() {return second_;} + second_const_reference second() const {return second_;} + + void swap(::boost::compressed_pair& y) + { + cp_swap(first_, y.first()); + cp_swap(second_, y.second()); + } + private: + first_type first_; + second_type second_; + }; + + // 1 derive from T1 + + template + class compressed_pair_imp + : protected ::boost::remove_cv::type + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_type(x), second_(y) {} + + compressed_pair_imp(first_param_type x) + : first_type(x) {} + + compressed_pair_imp(second_param_type y) + : second_(y) {} + + first_reference first() {return *this;} + first_const_reference first() const {return *this;} + + second_reference second() {return second_;} + second_const_reference second() const {return second_;} + + void swap(::boost::compressed_pair& y) + { + // no need to swap empty base class: + cp_swap(second_, y.second()); + } + private: + second_type second_; + }; + + // 2 derive from T2 + + template + class compressed_pair_imp + : protected ::boost::remove_cv::type + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : second_type(y), first_(x) {} + + compressed_pair_imp(first_param_type x) + : first_(x) {} + + compressed_pair_imp(second_param_type y) + : second_type(y) {} + + first_reference first() {return first_;} + first_const_reference first() const {return first_;} + + second_reference second() {return *this;} + second_const_reference second() const {return *this;} + + void swap(::boost::compressed_pair& y) + { + // no need to swap empty base class: + cp_swap(first_, y.first()); + } + + private: + first_type first_; + }; + + // 3 derive from T1 and T2 + + template + class compressed_pair_imp + : protected ::boost::remove_cv::type, + protected ::boost::remove_cv::type + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_type(x), second_type(y) {} + + compressed_pair_imp(first_param_type x) + : first_type(x) {} + + compressed_pair_imp(second_param_type y) + : second_type(y) {} + + first_reference first() {return *this;} + first_const_reference first() const {return *this;} + + second_reference second() {return *this;} + second_const_reference second() const {return *this;} + // + // no need to swap empty bases: + void swap(::boost::compressed_pair&) {} + }; + + // JM + // 4 T1 == T2, T1 and T2 both empty + // Originally this did not store an instance of T2 at all + // but that led to problems beause it meant &x.first() == &x.second() + // which is not true for any other kind of pair, so now we store an instance + // of T2 just in case the user is relying on first() and second() returning + // different objects (albeit both empty). + template + class compressed_pair_imp + : protected ::boost::remove_cv::type + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_type(x), m_second(y) {} + + compressed_pair_imp(first_param_type x) + : first_type(x), m_second(x) {} + + first_reference first() {return *this;} + first_const_reference first() const {return *this;} + + second_reference second() {return m_second;} + second_const_reference second() const {return m_second;} + + void swap(::boost::compressed_pair&) {} + private: + T2 m_second; + }; + + // 5 T1 == T2 and are not empty: //JM + + template + class compressed_pair_imp + { + public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_imp() {} + + compressed_pair_imp(first_param_type x, second_param_type y) + : first_(x), second_(y) {} + + compressed_pair_imp(first_param_type x) + : first_(x), second_(x) {} + + first_reference first() {return first_;} + first_const_reference first() const {return first_;} + + second_reference second() {return second_;} + second_const_reference second() const {return second_;} + + void swap(::boost::compressed_pair& y) + { + cp_swap(first_, y.first()); + cp_swap(second_, y.second()); + } + private: + first_type first_; + second_type second_; + }; + +} // details + +template +class compressed_pair + : private ::boost::details::compressed_pair_imp::type, typename remove_cv::type>::value, + ::boost::is_empty::value, + ::boost::is_empty::value>::value> +{ +private: + typedef details::compressed_pair_imp::type, typename remove_cv::type>::value, + ::boost::is_empty::value, + ::boost::is_empty::value>::value> base; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair() : base() {} + compressed_pair(first_param_type x, second_param_type y) : base(x, y) {} + explicit compressed_pair(first_param_type x) : base(x) {} + explicit compressed_pair(second_param_type y) : base(y) {} + + first_reference first() {return base::first();} + first_const_reference first() const {return base::first();} + + second_reference second() {return base::second();} + second_const_reference second() const {return base::second();} + + void swap(compressed_pair& y) { base::swap(y); } +}; + +// JM +// Partial specialisation for case where T1 == T2: +// +template +class compressed_pair + : private details::compressed_pair_imp::type, typename remove_cv::type>::value, + ::boost::is_empty::value, + ::boost::is_empty::value>::value> +{ +private: + typedef details::compressed_pair_imp::type, typename remove_cv::type>::value, + ::boost::is_empty::value, + ::boost::is_empty::value>::value> base; +public: + typedef T first_type; + typedef T second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair() : base() {} + compressed_pair(first_param_type x, second_param_type y) : base(x, y) {} +#if !(defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) + explicit +#endif + compressed_pair(first_param_type x) : base(x) {} + + first_reference first() {return base::first();} + first_const_reference first() const {return base::first();} + + second_reference second() {return base::second();} + second_const_reference second() const {return base::second();} + + void swap(::boost::compressed_pair& y) { base::swap(y); } +}; + +template +inline +void +swap(compressed_pair& x, compressed_pair& y) +{ + x.swap(y); +} + +} // boost + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP + diff --git a/3rdParty/Boost/src/boost/detail/ob_compressed_pair.hpp b/3rdParty/Boost/src/boost/detail/ob_compressed_pair.hpp new file mode 100644 index 0000000..727acab --- /dev/null +++ b/3rdParty/Boost/src/boost/detail/ob_compressed_pair.hpp @@ -0,0 +1,510 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Use, modification and distribution are 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/libs/utility for most recent version including documentation. +// see libs/utility/compressed_pair.hpp +// +/* Release notes: + 20 Jan 2001: + Fixed obvious bugs (David Abrahams) + 07 Oct 2000: + Added better single argument constructor support. + 03 Oct 2000: + Added VC6 support (JM). + 23rd July 2000: + Additional comments added. (JM) + Jan 2000: + Original version: this version crippled for use with crippled compilers + - John Maddock Jan 2000. +*/ + + +#ifndef BOOST_OB_COMPRESSED_PAIR_HPP +#define BOOST_OB_COMPRESSED_PAIR_HPP + +#include +#ifndef BOOST_OBJECT_TYPE_TRAITS_HPP +#include +#endif +#ifndef BOOST_SAME_TRAITS_HPP +#include +#endif +#ifndef BOOST_CALL_TRAITS_HPP +#include +#endif + +namespace boost +{ +#ifdef BOOST_MSVC6_MEMBER_TEMPLATES +// +// use member templates to emulate +// partial specialisation. Note that due to +// problems with overload resolution with VC6 +// each of the compressed_pair versions that follow +// have one template single-argument constructor +// in place of two specific constructors: +// + +template +class compressed_pair; + +namespace detail{ + +template +struct best_conversion_traits +{ + typedef char one; + typedef char (&two)[2]; + static A a; + static one test(T1); + static two test(T2); + + enum { value = sizeof(test(a)) }; +}; + +template +struct init_one; + +template <> +struct init_one<1> +{ + template + static void init(const A& a, T1* p1, T2*) + { + *p1 = a; + } +}; + +template <> +struct init_one<2> +{ + template + static void init(const A& a, T1*, T2* p2) + { + *p2 = a; + } +}; + + +// T1 != T2, both non-empty +template +class compressed_pair_0 +{ +private: + T1 _first; + T2 _second; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_0() : _first(), _second() {} + compressed_pair_0(first_param_type x, second_param_type y) : _first(x), _second(y) {} + template + explicit compressed_pair_0(const A& val) + { + init_one::value>::init(val, &_first, &_second); + } + compressed_pair_0(const ::boost::compressed_pair& x) + : _first(x.first()), _second(x.second()) {} + +#if 0 + compressed_pair_0& operator=(const compressed_pair_0& x) { + cout << "assigning compressed pair 0" << endl; + _first = x._first; + _second = x._second; + cout << "finished assigning compressed pair 0" << endl; + return *this; + } +#endif + + first_reference first() { return _first; } + first_const_reference first() const { return _first; } + + second_reference second() { return _second; } + second_const_reference second() const { return _second; } + + void swap(compressed_pair_0& y) + { + using std::swap; + swap(_first, y._first); + swap(_second, y._second); + } +}; + +// T1 != T2, T2 empty +template +class compressed_pair_1 : T2 +{ +private: + T1 _first; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_1() : T2(), _first() {} + compressed_pair_1(first_param_type x, second_param_type y) : T2(y), _first(x) {} + + template + explicit compressed_pair_1(const A& val) + { + init_one::value>::init(val, &_first, static_cast(this)); + } + + compressed_pair_1(const ::boost::compressed_pair& x) + : T2(x.second()), _first(x.first()) {} + +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 + // Total weirdness. If the assignment to _first is moved after + // the call to the inherited operator=, then this breaks graph/test/graph.cpp + // by way of iterator_adaptor. + compressed_pair_1& operator=(const compressed_pair_1& x) { + _first = x._first; + T2::operator=(x); + return *this; + } +#endif + + first_reference first() { return _first; } + first_const_reference first() const { return _first; } + + second_reference second() { return *this; } + second_const_reference second() const { return *this; } + + void swap(compressed_pair_1& y) + { + // no need to swap empty base class: + using std::swap; + swap(_first, y._first); + } +}; + +// T1 != T2, T1 empty +template +class compressed_pair_2 : T1 +{ +private: + T2 _second; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_2() : T1(), _second() {} + compressed_pair_2(first_param_type x, second_param_type y) : T1(x), _second(y) {} + template + explicit compressed_pair_2(const A& val) + { + init_one::value>::init(val, static_cast(this), &_second); + } + compressed_pair_2(const ::boost::compressed_pair& x) + : T1(x.first()), _second(x.second()) {} + +#if 0 + compressed_pair_2& operator=(const compressed_pair_2& x) { + cout << "assigning compressed pair 2" << endl; + T1::operator=(x); + _second = x._second; + cout << "finished assigning compressed pair 2" << endl; + return *this; + } +#endif + first_reference first() { return *this; } + first_const_reference first() const { return *this; } + + second_reference second() { return _second; } + second_const_reference second() const { return _second; } + + void swap(compressed_pair_2& y) + { + // no need to swap empty base class: + using std::swap; + swap(_second, y._second); + } +}; + +// T1 != T2, both empty +template +class compressed_pair_3 : T1, T2 +{ +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_3() : T1(), T2() {} + compressed_pair_3(first_param_type x, second_param_type y) : T1(x), T2(y) {} + template + explicit compressed_pair_3(const A& val) + { + init_one::value>::init(val, static_cast(this), static_cast(this)); + } + compressed_pair_3(const ::boost::compressed_pair& x) + : T1(x.first()), T2(x.second()) {} + + first_reference first() { return *this; } + first_const_reference first() const { return *this; } + + second_reference second() { return *this; } + second_const_reference second() const { return *this; } + + void swap(compressed_pair_3& y) + { + // no need to swap empty base classes: + } +}; + +// T1 == T2, and empty +template +class compressed_pair_4 : T1 +{ +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_4() : T1() {} + compressed_pair_4(first_param_type x, second_param_type y) : T1(x), m_second(y) {} + // only one single argument constructor since T1 == T2 + explicit compressed_pair_4(first_param_type x) : T1(x), m_second(x) {} + compressed_pair_4(const ::boost::compressed_pair& x) + : T1(x.first()), m_second(x.second()) {} + + first_reference first() { return *this; } + first_const_reference first() const { return *this; } + + second_reference second() { return m_second; } + second_const_reference second() const { return m_second; } + + void swap(compressed_pair_4& y) + { + // no need to swap empty base classes: + } +private: + T2 m_second; +}; + +// T1 == T2, not empty +template +class compressed_pair_5 +{ +private: + T1 _first; + T2 _second; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair_5() : _first(), _second() {} + compressed_pair_5(first_param_type x, second_param_type y) : _first(x), _second(y) {} + // only one single argument constructor since T1 == T2 + explicit compressed_pair_5(first_param_type x) : _first(x), _second(x) {} + compressed_pair_5(const ::boost::compressed_pair& c) + : _first(c.first()), _second(c.second()) {} + + first_reference first() { return _first; } + first_const_reference first() const { return _first; } + + second_reference second() { return _second; } + second_const_reference second() const { return _second; } + + void swap(compressed_pair_5& y) + { + using std::swap; + swap(_first, y._first); + swap(_second, y._second); + } +}; + +template +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_0 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_1 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_2 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_3 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_4 type; + }; +}; + +template <> +struct compressed_pair_chooser +{ + template + struct rebind + { + typedef compressed_pair_5 type; + }; +}; + +template +struct compressed_pair_traits +{ +private: + typedef compressed_pair_chooser::value, is_empty::value, is_same::value> chooser; + typedef typename chooser::template rebind bound_type; +public: + typedef typename bound_type::type type; +}; + +} // namespace detail + +template +class compressed_pair : public detail::compressed_pair_traits::type +{ +private: + typedef typename detail::compressed_pair_traits::type base_type; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair() : base_type() {} + compressed_pair(first_param_type x, second_param_type y) : base_type(x, y) {} + template + explicit compressed_pair(const A& x) : base_type(x){} + + first_reference first() { return base_type::first(); } + first_const_reference first() const { return base_type::first(); } + + second_reference second() { return base_type::second(); } + second_const_reference second() const { return base_type::second(); } +}; + +template +inline void swap(compressed_pair& x, compressed_pair& y) +{ + x.swap(y); +} + +#else +// no partial specialisation, no member templates: + +template +class compressed_pair +{ +private: + T1 _first; + T2 _second; +public: + typedef T1 first_type; + typedef T2 second_type; + typedef typename call_traits::param_type first_param_type; + typedef typename call_traits::param_type second_param_type; + typedef typename call_traits::reference first_reference; + typedef typename call_traits::reference second_reference; + typedef typename call_traits::const_reference first_const_reference; + typedef typename call_traits::const_reference second_const_reference; + + compressed_pair() : _first(), _second() {} + compressed_pair(first_param_type x, second_param_type y) : _first(x), _second(y) {} + explicit compressed_pair(first_param_type x) : _first(x), _second() {} + // can't define this in case T1 == T2: + // explicit compressed_pair(second_param_type y) : _first(), _second(y) {} + + first_reference first() { return _first; } + first_const_reference first() const { return _first; } + + second_reference second() { return _second; } + second_const_reference second() const { return _second; } + + void swap(compressed_pair& y) + { + using std::swap; + swap(_first, y._first); + swap(_second, y._second); + } +}; + +template +inline void swap(compressed_pair& x, compressed_pair& y) +{ + x.swap(y); +} + +#endif + +} // boost + +#endif // BOOST_OB_COMPRESSED_PAIR_HPP + + + diff --git a/3rdParty/Boost/src/boost/detail/quick_allocator.hpp b/3rdParty/Boost/src/boost/detail/quick_allocator.hpp new file mode 100644 index 0000000..d54b3a7 --- /dev/null +++ b/3rdParty/Boost/src/boost/detail/quick_allocator.hpp @@ -0,0 +1,23 @@ +#ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED +#define BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// detail/quick_allocator.hpp +// +// Copyright (c) 2003 David Abrahams +// Copyright (c) 2003 Peter Dimov +// +// Distributed under 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 +// + +#include + +#endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED diff --git a/3rdParty/Boost/src/boost/iterator/filter_iterator.hpp b/3rdParty/Boost/src/boost/iterator/filter_iterator.hpp new file mode 100644 index 0000000..14d640b --- /dev/null +++ b/3rdParty/Boost/src/boost/iterator/filter_iterator.hpp @@ -0,0 +1,135 @@ +// (C) Copyright David Abrahams 2002. +// (C) Copyright Jeremy Siek 2002. +// (C) Copyright Thomas Witt 2002. +// Distributed under 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) +#ifndef BOOST_FILTER_ITERATOR_23022003THW_HPP +#define BOOST_FILTER_ITERATOR_23022003THW_HPP + +#include +#include +#include + +#include +#include + +namespace boost +{ + template + class filter_iterator; + + namespace detail + { + template + struct filter_iterator_base + { + typedef iterator_adaptor< + filter_iterator + , Iterator + , use_default + , typename mpl::if_< + is_convertible< + typename iterator_traversal::type + , random_access_traversal_tag + > + , bidirectional_traversal_tag + , use_default + >::type + > type; + }; + } + + template + class filter_iterator + : public detail::filter_iterator_base::type + { + typedef typename detail::filter_iterator_base< + Predicate, Iterator + >::type super_t; + + friend class iterator_core_access; + + public: + filter_iterator() { } + + filter_iterator(Predicate f, Iterator x, Iterator end_ = Iterator()) + : super_t(x), m_predicate(f), m_end(end_) + { + satisfy_predicate(); + } + + filter_iterator(Iterator x, Iterator end_ = Iterator()) + : super_t(x), m_predicate(), m_end(end_) + { + // Pro8 is a little too aggressive about instantiating the + // body of this function. +#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + // Don't allow use of this constructor if Predicate is a + // function pointer type, since it will be 0. + BOOST_STATIC_ASSERT(is_class::value); +#endif + satisfy_predicate(); + } + + template + filter_iterator( + filter_iterator const& t + , typename enable_if_convertible::type* = 0 + ) + : super_t(t.base()), m_predicate(t.predicate()), m_end(t.end()) {} + + Predicate predicate() const { return m_predicate; } + + Iterator end() const { return m_end; } + + private: + void increment() + { + ++(this->base_reference()); + satisfy_predicate(); + } + + void decrement() + { + while(!this->m_predicate(*--(this->base_reference()))){}; + } + + void satisfy_predicate() + { + while (this->base() != this->m_end && !this->m_predicate(*this->base())) + ++(this->base_reference()); + } + + // Probably should be the initial base class so it can be + // optimized away via EBO if it is an empty class. + Predicate m_predicate; + Iterator m_end; + }; + + template + filter_iterator + make_filter_iterator(Predicate f, Iterator x, Iterator end = Iterator()) + { + return filter_iterator(f,x,end); + } + + template + filter_iterator + make_filter_iterator( + typename iterators::enable_if< + is_class + , Iterator + >::type x + , Iterator end = Iterator() +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) + , Predicate* = 0 +#endif + ) + { + return filter_iterator(x,end); + } + +} // namespace boost + +#endif // BOOST_FILTER_ITERATOR_23022003THW_HPP diff --git a/3rdParty/Boost/src/boost/preprocessor/enum_params_with_defaults.hpp b/3rdParty/Boost/src/boost/preprocessor/enum_params_with_defaults.hpp new file mode 100644 index 0000000..e58fa3e --- /dev/null +++ b/3rdParty/Boost/src/boost/preprocessor/enum_params_with_defaults.hpp @@ -0,0 +1,17 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. +# * Distributed under 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 most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS_HPP +# define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS_HPP +# +# include +# +# endif diff --git a/3rdParty/Boost/src/boost/preprocessor/repetition/enum_params_with_defaults.hpp b/3rdParty/Boost/src/boost/preprocessor/repetition/enum_params_with_defaults.hpp new file mode 100644 index 0000000..fa0106f --- /dev/null +++ b/3rdParty/Boost/src/boost/preprocessor/repetition/enum_params_with_defaults.hpp @@ -0,0 +1,24 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * Distributed under 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) +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_REPETITION_ENUM_PARAMS_WITH_DEFAULTS_HPP +# define BOOST_PREPROCESSOR_REPETITION_ENUM_PARAMS_WITH_DEFAULTS_HPP +# +# include +# include +# +# /* BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS */ +# +# define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(count, param, def) BOOST_PP_ENUM_BINARY_PARAMS(count, param, = def) +# +# endif diff --git a/3rdParty/Boost/src/boost/serialization/access.hpp b/3rdParty/Boost/src/boost/serialization/access.hpp new file mode 100644 index 0000000..40256d6 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/access.hpp @@ -0,0 +1,147 @@ +#ifndef BOOST_SERIALIZATION_ACCESS_HPP +#define BOOST_SERIALIZATION_ACCESS_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// access.hpp: interface for serialization system. + +// (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 + +#include + +namespace boost { + +namespace archive { +namespace detail { + template + class iserializer; + template + class oserializer; +} // namespace detail +} // namespace archive + +namespace serialization { + +// forward declarations +template +inline void serialize_adl(Archive &, T &, const unsigned int); +namespace detail { + template + struct member_saver; + template + struct member_loader; +} // namespace detail + +// use an "accessor class so that we can use: +// "friend class boost::serialization::access;" +// in any serialized class to permit clean, safe access to private class members +// by the serialization system + +class access { +public: + // grant access to "real" serialization defaults +#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + template + friend struct detail::member_saver; + template + friend struct detail::member_loader; + template + friend class archive::detail::iserializer; + template + friend class archive::detail::oserializer; + template + friend inline void serialize( + Archive & ar, + T & t, + const BOOST_PFTO unsigned int file_version + ); + template + friend inline void save_construct_data( + Archive & ar, + const T * t, + const BOOST_PFTO unsigned int file_version + ); + template + friend inline void load_construct_data( + Archive & ar, + T * t, + const BOOST_PFTO unsigned int file_version + ); +#endif + + // pass calls to users's class implementation + template + static void member_save( + Archive & ar, + //const T & t, + T & t, + const unsigned int file_version + ){ + t.save(ar, file_version); + } + template + static void member_load( + Archive & ar, + T & t, + const unsigned int file_version + ){ + t.load(ar, file_version); + } + template + static void serialize( + Archive & ar, + T & t, + const unsigned int file_version + ){ + // note: if you get a compile time error here with a + // message something like: + // cannot convert parameter 1 from to + // a likely possible cause is that the class T contains a + // serialize function - but that serialize function isn't + // a template and corresponds to a file type different than + // the class Archive. To resolve this, don't include an + // archive type other than that for which the serialization + // function is defined!!! + t.serialize(ar, file_version); + } + template + static void destroy( const T * t) // const appropriate here? + { + // the const business is an MSVC 6.0 hack that should be + // benign on everything else + delete const_cast(t); + } + template + static void construct(T * t){ + // default is inplace invocation of default constructor + // Note the :: before the placement new. Required if the + // class doesn't have a class-specific placement new defined. + ::new(t)T; + } + template + static T & cast_reference(U & u){ + return static_cast(u); + } + template + static T * cast_pointer(U * u){ + return static_cast(u); + } +}; + +} // namespace serialization +} // namespace boost + +#endif // BOOST_SERIALIZATION_ACCESS_HPP diff --git a/3rdParty/Boost/src/boost/serialization/array.hpp b/3rdParty/Boost/src/boost/serialization/array.hpp new file mode 100644 index 0000000..3391a96 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/array.hpp @@ -0,0 +1,153 @@ +#ifndef BOOST_SERIALIZATION_ARRAY_HPP +#define BOOST_SERIALIZATION_ARRAY_HPP + +// (C) Copyright 2005 Matthias Troyer and Dave Abrahams +// 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) + +#include +#include // std::size_t +#include +#include // msvc 6.0 needs this for warning suppression +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace serialization { + +// traits to specify whether to use an optimized array serialization + +#ifdef __BORLANDC__ +// workaround for Borland compiler +template +struct use_array_optimization { + template struct apply : boost::mpl::false_ {}; +}; + +#else +template +struct use_array_optimization : boost::mpl::always {}; +#endif + +template +class array : + public wrapper_traits > +{ +public: + typedef T value_type; + + array(value_type* t, std::size_t s) : + m_t(t), + m_element_count(s) + {} + array(const array & rhs) : + m_t(rhs.m_t), + m_element_count(rhs.m_element_count) + {} + array & operator=(const array & rhs){ + m_t = rhs.m_t; + m_element_count = rhs.m_element_count; + } + + // default implementation + template + void serialize_optimized(Archive &ar, const unsigned int, mpl::false_ ) const + { + // default implemention does the loop + std::size_t c = count(); + value_type * t = address(); + while(0 < c--) + ar & boost::serialization::make_nvp("item", *t++); + } + + // optimized implementation + template + void serialize_optimized(Archive &ar, const unsigned int version, mpl::true_ ) + { + boost::serialization::split_member(ar, *this, version); + } + + // default implementation + template + void save(Archive &ar, const unsigned int version) const + { + ar.save_array(*this,version); + } + + // default implementation + template + void load(Archive &ar, const unsigned int version) + { + ar.load_array(*this,version); + } + + // default implementation + template + void serialize(Archive &ar, const unsigned int version) + { + typedef BOOST_DEDUCED_TYPENAME + boost::serialization::use_array_optimization::template apply< + BOOST_DEDUCED_TYPENAME remove_const< T >::type + >::type use_optimized; + serialize_optimized(ar,version,use_optimized()); + } + + value_type* address() const + { + return m_t; + } + + std::size_t count() const + { + return m_element_count; + } + +private: + value_type* m_t; + std::size_t m_element_count; +}; + +template +inline +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +const +#endif +array< T > make_array( T* t, std::size_t s){ + return array< T >(t, s); +} + +template +void serialize(Archive& ar, boost::array& a, const unsigned int /* version */) +{ + ar & boost::serialization::make_nvp("elems",a.elems); +} + +} } // 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 { \ + template \ + struct apply : boost::mpl::apply1::type \ + >::type {}; \ +}; }} +#endif // __BORLANDC__ + +#endif //BOOST_SERIALIZATION_ARRAY_HPP diff --git a/3rdParty/Boost/src/boost/serialization/assume_abstract.hpp b/3rdParty/Boost/src/boost/serialization/assume_abstract.hpp new file mode 100644 index 0000000..4a8123a --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/assume_abstract.hpp @@ -0,0 +1,59 @@ +#ifndef BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP +#define BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// assume_abstract_class.hpp: + +// (C) Copyright 2008 Robert Ramey +// 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. + +// this is useful for compilers which don't support the boost::is_abstract + +#include + +#ifndef BOOST_NO_IS_ABSTRACT + +// if there is an intrinsic is_abstract defined, we don't have to do anything +#define BOOST_SERIALIZATION_ASSUME_ABSTRACT(T) + +// but forward to the "official" is_abstract +namespace boost { +namespace serialization { + template + struct is_abstract : boost::is_abstract< T > {} ; +} // namespace serialization +} // namespace boost + +#else +// we have to "make" one + +namespace boost { +namespace serialization { + template + struct is_abstract : boost::false_type {}; +} // namespace serialization +} // namespace boost + +// define a macro to make explicit designation of this more transparent +#define BOOST_SERIALIZATION_ASSUME_ABSTRACT(T) \ +namespace boost { \ +namespace serialization { \ +template<> \ +struct is_abstract< T > : boost::true_type {}; \ +template<> \ +struct is_abstract< const T > : boost::true_type {}; \ +}} \ +/**/ + +#endif // BOOST_NO_IS_ABSTRACT + +#endif //BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP diff --git a/3rdParty/Boost/src/boost/serialization/base_object.hpp b/3rdParty/Boost/src/boost/serialization/base_object.hpp new file mode 100644 index 0000000..b840d25 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/base_object.hpp @@ -0,0 +1,112 @@ +#ifndef BOOST_SERIALIZATION_BASE_OBJECT_HPP +#define BOOST_SERIALIZATION_BASE_OBJECT_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// base_object.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. + +// if no archive headers have been included this is a no op +// this is to permit BOOST_EXPORT etc to be included in a +// file declaration header + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace boost { +namespace serialization { + +namespace detail +{ + // get the base type for a given derived type + // preserving the const-ness + template + struct base_cast + { + typedef BOOST_DEDUCED_TYPENAME + mpl::if_< + is_const, + const B, + B + >::type type; + BOOST_STATIC_ASSERT(is_const::value == is_const::value); + }; + + // only register void casts if the types are polymorphic + template + struct base_register + { + struct polymorphic { + static void const * invoke(){ + Base const * const b = 0; + Derived const * const d = 0; + return & void_cast_register(d, b); + } + }; + struct non_polymorphic { + static void const * invoke(){ + return 0; + } + }; + static void const * invoke(){ + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_polymorphic, + mpl::identity, + mpl::identity + >::type type; + return type::invoke(); + } + }; + +} // namespace detail +#if defined(__BORLANDC__) && __BORLANDC__ < 0x610 +template +const Base & +base_object(const Derived & d) +{ + BOOST_STATIC_ASSERT(! is_pointer::value); + detail::base_register::invoke(); + return access::cast_reference(d); +} +#else +template +BOOST_DEDUCED_TYPENAME detail::base_cast::type & +base_object(Derived &d) +{ + BOOST_STATIC_ASSERT(( is_base_and_derived::value)); + BOOST_STATIC_ASSERT(! is_pointer::value); + typedef BOOST_DEDUCED_TYPENAME detail::base_cast::type type; + detail::base_register::invoke(); + return access::cast_reference(d); +} +#endif + +} // namespace serialization +} // namespace boost + +#endif // BOOST_SERIALIZATION_BASE_OBJECT_HPP diff --git a/3rdParty/Boost/src/boost/serialization/collection_size_type.hpp b/3rdParty/Boost/src/boost/serialization/collection_size_type.hpp new file mode 100644 index 0000000..2dd8fa7 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/collection_size_type.hpp @@ -0,0 +1,62 @@ +#ifndef BOOST_SERIALIZATION_COLLECTION_SIZE_TYPE_HPP +#define BOOST_SERIALIZATION_COLLECTION_SIZE_TYPE_HPP + +// (C) Copyright 2005 Matthias Troyer +// 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) + +#include // size_t +#include +#include +#include +#include + +namespace boost { +namespace serialization { + +//BOOST_STRONG_TYPEDEF(std::size_t, collection_size_type) + +class collection_size_type { +private: + typedef std::size_t base_type; + base_type t; +public: + collection_size_type(): t(0) {}; + explicit collection_size_type(const std::size_t & t_) : + t(t_) + {} + collection_size_type(const collection_size_type & t_) : + t(t_.t) + {} + collection_size_type & operator=(const collection_size_type & rhs){ + t = rhs.t; + return *this; + } + collection_size_type & operator=(const unsigned int & rhs){ + t = rhs; + return *this; + } + // used for text output + operator base_type () const { + return t; + } + // used for text input + operator base_type & () { + return t; + } + bool operator==(const collection_size_type & rhs) const { + return t == rhs.t; + } + bool operator<(const collection_size_type & rhs) const { + return t < rhs.t; + } +}; + + +} } // end namespace boost::serialization + +BOOST_CLASS_IMPLEMENTATION(collection_size_type, primitive_type) +BOOST_IS_BITWISE_SERIALIZABLE(collection_size_type) + +#endif //BOOST_SERIALIZATION_COLLECTION_SIZE_TYPE_HPP diff --git a/3rdParty/Boost/src/boost/serialization/collection_traits.hpp b/3rdParty/Boost/src/boost/serialization/collection_traits.hpp new file mode 100644 index 0000000..60453c7 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/collection_traits.hpp @@ -0,0 +1,79 @@ +#ifndef BOOST_SERIALIZATION_COLLECTION_TRAITS_HPP +#define BOOST_SERIALIZATION_COLLECTION_TRAITS_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// collection_traits.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. + +// This header assigns a level implemenation trait to a collection type +// for all primitives. It is needed so that archives which are meant to be +// portable don't write class information in the archive. Since, not all +// compiles recognize the same set of primitive types, the possibility +// exists for archives to be non-portable if class information for primitive +// types is included. This is addressed by the following macros. +#include +#include +#include + +#include +#include +#include // ULONG_MAX +#include + +#define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(T, C) \ +template<> \ +struct implementation_level< C < T > > { \ + typedef mpl::integral_c_tag tag; \ + typedef mpl::int_ type; \ + BOOST_STATIC_CONSTANT(int, value = object_serializable); \ +}; \ +/**/ + +#if defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_INTRINSIC_WCHAR_T) + #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) +#else + #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(wchar_t, C) \ + /**/ +#endif + +#if defined(BOOST_HAS_LONG_LONG) + #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::long_long_type, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::ulong_long_type, C) \ + /**/ +#else + #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) +#endif + +#define BOOST_SERIALIZATION_COLLECTION_TRAITS(C) \ + namespace boost { namespace serialization { \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(bool, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(char, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed char, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned char, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed int, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned int, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed long, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned long, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(float, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(double, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned short, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed short, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) \ + } } \ + /**/ + +#endif // BOOST_SERIALIZATION_COLLECTION_TRAITS diff --git a/3rdParty/Boost/src/boost/serialization/collections_load_imp.hpp b/3rdParty/Boost/src/boost/serialization/collections_load_imp.hpp new file mode 100644 index 0000000..11b00cd --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/collections_load_imp.hpp @@ -0,0 +1,166 @@ +#ifndef BOOST_SERIALIZATION_COLLECTIONS_LOAD_IMP_HPP +#define BOOST_SERIALIZATION_COLLECTIONS_LOAD_IMP_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#if defined(_MSC_VER) && (_MSC_VER <= 1020) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// collections_load_imp.hpp: serialization for loading stl collections + +// (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. + +// helper function templates for serialization of collections + +#include +#include // size_t +#include // msvc 6.0 needs this for warning suppression +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif +#include + +#include +#include +#include +#include +#include +#include + +namespace boost{ +namespace serialization { +namespace stl { + +////////////////////////////////////////////////////////////////////// +// implementation of serialization for STL containers +// + +// sequential container input +template +struct archive_input_seq +{ + inline BOOST_DEDUCED_TYPENAME Container::iterator + operator()( + Archive &ar, + Container &s, + const unsigned int v, + BOOST_DEDUCED_TYPENAME Container::iterator hint + ){ + typedef BOOST_DEDUCED_TYPENAME Container::value_type type; + detail::stack_construct 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 +struct archive_input_map +{ + inline BOOST_DEDUCED_TYPENAME Container::iterator + operator()( + Archive &ar, + Container &s, + const unsigned int v, + BOOST_DEDUCED_TYPENAME Container::iterator hint + ){ + typedef BOOST_DEDUCED_TYPENAME Container::value_type type; + detail::stack_construct t(ar, v); + // borland fails silently w/o full namespace + ar >> boost::serialization::make_nvp("item", t.reference()); + BOOST_DEDUCED_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 +struct archive_input_set +{ + inline BOOST_DEDUCED_TYPENAME Container::iterator + operator()( + Archive &ar, + Container &s, + const unsigned int v, + BOOST_DEDUCED_TYPENAME Container::iterator hint + ){ + typedef BOOST_DEDUCED_TYPENAME Container::value_type type; + detail::stack_construct t(ar, v); + // borland fails silently w/o full namespace + ar >> boost::serialization::make_nvp("item", t.reference()); + BOOST_DEDUCED_TYPENAME Container::iterator result = + s.insert(hint, t.reference()); + ar.reset_object_address(& (* result), & t.reference()); + return result; + } +}; + +template +class reserve_imp +{ +public: + void operator()(Container &s, std::size_t count) const { + s.reserve(count); + } +}; + +template +class no_reserve_imp +{ +public: + void operator()(Container & /* s */, std::size_t /* count */) const{} +}; + +template +inline void load_collection(Archive & ar, Container &s) +{ + s.clear(); + collection_size_type count; + const boost::archive::library_version_type library_version( + ar.get_library_version() + ); + // retrieve number of elements + item_version_type item_version(0); + 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; + BOOST_DEDUCED_TYPENAME Container::iterator hint; + hint = s.begin(); + while(count-- > 0){ + hint = ifunc(ar, s, item_version, hint); + } +} + +} // namespace stl +} // namespace serialization +} // namespace boost + +#endif //BOOST_SERIALIZATION_COLLECTIONS_LOAD_IMP_HPP diff --git a/3rdParty/Boost/src/boost/serialization/collections_save_imp.hpp b/3rdParty/Boost/src/boost/serialization/collections_save_imp.hpp new file mode 100644 index 0000000..5151c4b --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/collections_save_imp.hpp @@ -0,0 +1,72 @@ +#ifndef BOOST_SERIALIZATION_COLLECTIONS_SAVE_IMP_HPP +#define BOOST_SERIALIZATION_COLLECTIONS_SAVE_IMP_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// collections_save_imp.hpp: serialization for stl collections + +// (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. + +// helper function templates for serialization of collections + +#include +#include +#include +#include +#include +#include + +namespace boost{ +namespace serialization { +namespace stl { + +////////////////////////////////////////////////////////////////////// +// implementation of serialization for STL containers +// + +template +inline void save_collection(Archive & ar, const Container &s) +{ + // record number of elements + collection_size_type count(s.size()); + const item_version_type item_version( + version::value + ); + ar << BOOST_SERIALIZATION_NVP(count); + #if 0 + boost::archive::library_version_type library_version( + ar.get_library_version() + ); + if(boost::archive::library_version_type(3) < library_version){ + ar << BOOST_SERIALIZATION_NVP(item_version); + } + #else + ar << BOOST_SERIALIZATION_NVP(item_version); + #endif + + BOOST_DEDUCED_TYPENAME Container::const_iterator it = s.begin(); + while(count-- > 0){ + // note borland emits a no-op without the explicit namespace + boost::serialization::save_construct_data_adl( + ar, + &(*it), + item_version + ); + ar << boost::serialization::make_nvp("item", *it++); + } +} + +} // namespace stl +} // namespace serialization +} // namespace boost + +#endif //BOOST_SERIALIZATION_COLLECTIONS_SAVE_IMP_HPP diff --git a/3rdParty/Boost/src/boost/serialization/config.hpp b/3rdParty/Boost/src/boost/serialization/config.hpp new file mode 100644 index 0000000..ce586a7 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/config.hpp @@ -0,0 +1,85 @@ +#ifndef BOOST_SERIALIZATION_CONFIG_HPP +#define BOOST_SERIALIZATION_CONFIG_HPP + +// 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 +#include +#include + +// note: this version incorporates the related code into the the +// the same library as BOOST_ARCHIVE. This could change some day in the +// future + +// if BOOST_SERIALIZATION_DECL is defined undefine it now: +#ifdef BOOST_SERIALIZATION_DECL + #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 +// if they want just this one to be dynamically liked: +#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK) + #if !defined(BOOST_DYN_LINK) + #define BOOST_DYN_LINK + #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 + #else + #if defined(__BORLANDC__) + #define BOOST_SERIALIZATION_DECL(T) T __import + #else + #define BOOST_SERIALIZATION_DECL(T) __declspec(dllimport) T + #endif + #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 +#endif + +// enable automatic library variant selection ------------------------------// + +#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SERIALIZATION_NO_LIB) \ +&& !defined(BOOST_ARCHIVE_SOURCE) && !defined(BOOST_WARCHIVE_SOURCE) \ +&& !defined(BOOST_SERIALIZATION_SOURCE) + // + // Set the name of our library, this will get undef'ed by auto_link.hpp + // once it's done with it: + // + #define BOOST_LIB_NAME boost_serialization + // + // If we're importing code from a dll, then tell auto_link.hpp about it: + // + #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK) + # define BOOST_DYN_LINK + #endif + // + // And include the header that does the work: + // + #include + +#endif + +#endif // BOOST_SERIALIZATION_CONFIG_HPP diff --git a/3rdParty/Boost/src/boost/serialization/detail/get_data.hpp b/3rdParty/Boost/src/boost/serialization/detail/get_data.hpp new file mode 100644 index 0000000..3cbcb4a --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/detail/get_data.hpp @@ -0,0 +1,61 @@ +// (C) Copyright 2005 Matthias Troyer +// 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. + +#ifndef BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP +#define BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +#define STD _STLP_STD +#else +#define STD std +#endif + +#include +#include + +namespace boost { +namespace serialization { +namespace detail { + +template +T* get_data(STD::vector& v) +{ + return v.empty() ? 0 : &(v[0]); +} + +template +T* get_data(STD::vector const & v) +{ + return get_data(const_cast&>(v)); +} + +template +T* get_data(STD::valarray& v) +{ + return v.size()==0 ? 0 : &(v[0]); +} + +template +const T* get_data(STD::valarray const& v) +{ + return get_data(const_cast&>(v)); +} + +} // detail +} // serialization +} // boost + +#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +#undef STD +#endif + +#endif // BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP diff --git a/3rdParty/Boost/src/boost/serialization/detail/shared_count_132.hpp b/3rdParty/Boost/src/boost/serialization/detail/shared_count_132.hpp new file mode 100644 index 0000000..c42355b --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/detail/shared_count_132.hpp @@ -0,0 +1,569 @@ +#ifndef BOOST_DETAIL_SHARED_COUNT_132_HPP_INCLUDED +#define BOOST_DETAIL_SHARED_COUNT_132_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// +// detail/shared_count.hpp +// +// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. +// +// Distributed under 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) +// + +#include + +#if defined(BOOST_SP_USE_STD_ALLOCATOR) && defined(BOOST_SP_USE_QUICK_ALLOCATOR) +# error BOOST_SP_USE_STD_ALLOCATOR and BOOST_SP_USE_QUICK_ALLOCATOR are incompatible. +#endif + +#include +#include +#include + +#if defined(BOOST_SP_USE_QUICK_ALLOCATOR) +#include +#endif + +#include // std::auto_ptr, std::allocator +#include // std::less +#include // std::exception +#include // std::bad_alloc +#include // std::type_info in get_deleter +#include // std::size_t + +#include // msvc 6.0 needs this for warning suppression +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // 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 + +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + +void sp_scalar_constructor_hook(void * px, std::size_t size, void * pn); +void sp_array_constructor_hook(void * px); +void sp_scalar_destructor_hook(void * px, std::size_t size, void * pn); +void sp_array_destructor_hook(void * px); + +#endif + + +// The standard library that comes with Borland C++ 5.5.1 +// defines std::exception and its members as having C calling +// convention (-pc). When the definition of bad_weak_ptr +// is compiled with -ps, the compiler issues an error. +// 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: + + virtual char const * what() const throw() + { + return "boost::bad_weak_ptr"; + } +}; + +#if defined(__BORLANDC__) && __BORLANDC__ == 0x551 +# pragma option pop +#endif + +namespace detail{ + +class sp_counted_base +{ +//private: + + typedef boost::detail::lightweight_mutex mutex_type; + +public: + + sp_counted_base(): use_count_(1), weak_count_(1) + { + } + + virtual ~sp_counted_base() // nothrow + { + } + + // dispose() is called when use_count_ drops to zero, to release + // the resources managed by *this. + + virtual void dispose() = 0; // nothrow + + // destruct() is called when weak_count_ drops to zero. + + virtual void destruct() // nothrow + { + delete this; + } + + virtual void * get_deleter(std::type_info const & ti) = 0; + + void add_ref_copy() + { +#if defined(BOOST_HAS_THREADS) + mutex_type::scoped_lock lock(mtx_); +#endif + ++use_count_; + } + + void add_ref_lock() + { +#if defined(BOOST_HAS_THREADS) + mutex_type::scoped_lock lock(mtx_); +#endif + if(use_count_ == 0) boost::serialization::throw_exception(bad_weak_ptr()); + ++use_count_; + } + + void release() // nothrow + { + { +#if defined(BOOST_HAS_THREADS) + mutex_type::scoped_lock lock(mtx_); +#endif + long new_use_count = --use_count_; + + if(new_use_count != 0) return; + } + + dispose(); + weak_release(); + } + + void weak_add_ref() // nothrow + { +#if defined(BOOST_HAS_THREADS) + mutex_type::scoped_lock lock(mtx_); +#endif + ++weak_count_; + } + + void weak_release() // nothrow + { + long new_weak_count; + + { +#if defined(BOOST_HAS_THREADS) + mutex_type::scoped_lock lock(mtx_); +#endif + new_weak_count = --weak_count_; + } + + if(new_weak_count == 0) + { + destruct(); + } + } + + long use_count() const // nothrow + { +#if defined(BOOST_HAS_THREADS) + mutex_type::scoped_lock lock(mtx_); +#endif + return use_count_; + } + +//private: +public: + sp_counted_base(sp_counted_base const &); + sp_counted_base & operator= (sp_counted_base const &); + + long use_count_; // #shared + long weak_count_; // #weak + (#shared != 0) + +#if defined(BOOST_HAS_THREADS) || defined(BOOST_LWM_WIN32) + mutable mutex_type mtx_; +#endif +}; + +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + +template void cbi_call_constructor_hook(sp_counted_base * pn, T * px, checked_deleter< T > const &, int) +{ + boost::sp_scalar_constructor_hook(px, sizeof(T), pn); +} + +template void cbi_call_constructor_hook(sp_counted_base *, T * px, checked_array_deleter< T > const &, int) +{ + boost::sp_array_constructor_hook(px); +} + +template void cbi_call_constructor_hook(sp_counted_base *, P const &, D const &, long) +{ +} + +template void cbi_call_destructor_hook(sp_counted_base * pn, T * px, checked_deleter< T > const &, int) +{ + boost::sp_scalar_destructor_hook(px, sizeof(T), pn); +} + +template void cbi_call_destructor_hook(sp_counted_base *, T * px, checked_array_deleter< T > const &, int) +{ + boost::sp_array_destructor_hook(px); +} + +template void cbi_call_destructor_hook(sp_counted_base *, P const &, D const &, long) +{ +} + +#endif + +// +// Borland's Codeguard trips up over the -Vx- option here: +// +#ifdef __CODEGUARD__ +# pragma option push -Vx- +#endif + +template class sp_counted_base_impl: public sp_counted_base +{ +//private: +public: + P ptr; // copy constructor must not throw + D del; // copy constructor must not throw + + sp_counted_base_impl(sp_counted_base_impl const &); + sp_counted_base_impl & operator= (sp_counted_base_impl const &); + + typedef sp_counted_base_impl this_type; + +public: + + // pre: initial_use_count <= initial_weak_count, d(p) must not throw + + sp_counted_base_impl(P p, D d): ptr(p), del(d) + { +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + detail::cbi_call_constructor_hook(this, p, d, 0); +#endif + } + + virtual void dispose() // nothrow + { +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + detail::cbi_call_destructor_hook(this, ptr, del, 0); +#endif + del(ptr); + } + + virtual void * get_deleter(std::type_info const & ti) + { + return ti == typeid(D)? &del: 0; + } + +#if defined(BOOST_SP_USE_STD_ALLOCATOR) + + void * operator new(std::size_t) + { + return std::allocator().allocate(1, static_cast(0)); + } + + void operator delete(void * p) + { + std::allocator().deallocate(static_cast(p), 1); + } + +#endif + +#if defined(BOOST_SP_USE_QUICK_ALLOCATOR) + + void * operator new(std::size_t) + { + return boost::detail::quick_allocator::alloc(); + } + + void operator delete(void * p) + { + boost::detail::quick_allocator::dealloc(p); + } + +#endif +}; + +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + +int const shared_count_id = 0x2C35F101; +int const weak_count_id = 0x298C38A4; + +#endif + +class weak_count; + +class shared_count +{ +//private: +public: + sp_counted_base * pi_; + +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + int id_; +#endif + + friend class weak_count; + +public: + + shared_count(): pi_(0) // nothrow +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(shared_count_id) +#endif + { + } + + template shared_count(P p, D d): pi_(0) +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(shared_count_id) +#endif + { +#ifndef BOOST_NO_EXCEPTIONS + + try + { + pi_ = new sp_counted_base_impl(p, d); + } + catch(...) + { + d(p); // delete p + throw; + } + +#else + + pi_ = new sp_counted_base_impl(p, d); + + if(pi_ == 0) + { + d(p); // delete p + boost::serialization::throw_exception(std::bad_alloc()); + } + +#endif + } + +#ifndef BOOST_NO_AUTO_PTR + + // auto_ptr is special cased to provide the strong guarantee + + template + explicit shared_count(std::auto_ptr & r): pi_( + new sp_counted_base_impl< + Y *, + boost::checked_deleter + >(r.get(), boost::checked_deleter())) +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(shared_count_id) +#endif + { + r.release(); + } + +#endif + + ~shared_count() // nothrow + { + if(pi_ != 0) pi_->release(); +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + id_ = 0; +#endif + } + + shared_count(shared_count const & r): pi_(r.pi_) // nothrow +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(shared_count_id) +#endif + { + if(pi_ != 0) pi_->add_ref_copy(); + } + + explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0 + + shared_count & operator= (shared_count const & r) // nothrow + { + sp_counted_base * tmp = r.pi_; + + if(tmp != pi_) + { + if(tmp != 0) tmp->add_ref_copy(); + if(pi_ != 0) pi_->release(); + pi_ = tmp; + } + + return *this; + } + + void swap(shared_count & r) // nothrow + { + sp_counted_base * tmp = r.pi_; + r.pi_ = pi_; + pi_ = tmp; + } + + long use_count() const // nothrow + { + return pi_ != 0? pi_->use_count(): 0; + } + + bool unique() const // nothrow + { + return use_count() == 1; + } + + friend inline bool operator==(shared_count const & a, shared_count const & b) + { + return a.pi_ == b.pi_; + } + + friend inline bool operator<(shared_count const & a, shared_count const & b) + { + return std::less()(a.pi_, b.pi_); + } + + void * get_deleter(std::type_info const & ti) const + { + return pi_? pi_->get_deleter(ti): 0; + } +}; + +#ifdef __CODEGUARD__ +# pragma option pop +#endif + + +class weak_count +{ +private: + + sp_counted_base * pi_; + +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + int id_; +#endif + + friend class shared_count; + +public: + + weak_count(): pi_(0) // nothrow +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(weak_count_id) +#endif + { + } + + weak_count(shared_count const & r): pi_(r.pi_) // nothrow +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(shared_count_id) +#endif + { + if(pi_ != 0) pi_->weak_add_ref(); + } + + weak_count(weak_count const & r): pi_(r.pi_) // nothrow +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(shared_count_id) +#endif + { + if(pi_ != 0) pi_->weak_add_ref(); + } + + ~weak_count() // nothrow + { + if(pi_ != 0) pi_->weak_release(); +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + id_ = 0; +#endif + } + + weak_count & operator= (shared_count const & r) // nothrow + { + sp_counted_base * tmp = r.pi_; + if(tmp != 0) tmp->weak_add_ref(); + if(pi_ != 0) pi_->weak_release(); + pi_ = tmp; + + return *this; + } + + weak_count & operator= (weak_count const & r) // nothrow + { + sp_counted_base * tmp = r.pi_; + if(tmp != 0) tmp->weak_add_ref(); + if(pi_ != 0) pi_->weak_release(); + pi_ = tmp; + + return *this; + } + + void swap(weak_count & r) // nothrow + { + sp_counted_base * tmp = r.pi_; + r.pi_ = pi_; + pi_ = tmp; + } + + long use_count() const // nothrow + { + return pi_ != 0? pi_->use_count(): 0; + } + + friend inline bool operator==(weak_count const & a, weak_count const & b) + { + return a.pi_ == b.pi_; + } + + friend inline bool operator<(weak_count const & a, weak_count const & b) + { + return std::less()(a.pi_, b.pi_); + } +}; + +inline shared_count::shared_count(weak_count const & r): pi_(r.pi_) +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(shared_count_id) +#endif +{ + if(pi_ != 0) + { + pi_->add_ref_lock(); + } + else + { + boost::serialization::throw_exception(bad_weak_ptr()); + } +} + +} // namespace detail + +} // namespace boost + +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 diff --git a/3rdParty/Boost/src/boost/serialization/detail/shared_ptr_132.hpp b/3rdParty/Boost/src/boost/serialization/detail/shared_ptr_132.hpp new file mode 100644 index 0000000..b5f2b21 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/detail/shared_ptr_132.hpp @@ -0,0 +1,478 @@ +#ifndef BOOST_SHARED_PTR_132_HPP_INCLUDED +#define BOOST_SHARED_PTR_132_HPP_INCLUDED + +// +// shared_ptr.hpp +// +// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. +// Copyright (c) 2001, 2002, 2003 Peter Dimov +// +// Distributed under 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/libs/smart_ptr/shared_ptr.htm for documentation. +// + +#include // for broken compiler workarounds + +#if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) +#include +#else + +#include +#include +#include +#include + +#include +#include + +#include // for std::auto_ptr +#include // for std::swap +#include // for std::less +#include // for std::bad_cast +#include // for std::basic_ostream + +#ifdef BOOST_MSVC // moved here to work around VC++ compiler crash +# pragma warning(push) +# pragma warning(disable:4284) // odd return type for operator-> +#endif + +namespace boost_132 { + +template class weak_ptr; +template class enable_shared_from_this; + +namespace detail +{ + +struct static_cast_tag {}; +struct const_cast_tag {}; +struct dynamic_cast_tag {}; +struct polymorphic_cast_tag {}; + +template struct shared_ptr_traits +{ + typedef T & reference; +}; + +template<> struct shared_ptr_traits +{ + typedef void reference; +}; + +#if !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS) + +template<> struct shared_ptr_traits +{ + typedef void reference; +}; + +template<> struct shared_ptr_traits +{ + typedef void reference; +}; + +template<> struct shared_ptr_traits +{ + typedef void reference; +}; + +#endif + +// enable_shared_from_this support + +template void sp_enable_shared_from_this( shared_count const & pn, enable_shared_from_this< T > const * pe, Y const * px ) +{ + if(pe != 0) pe->_internal_weak_this._internal_assign(const_cast(px), pn); +} + +inline void sp_enable_shared_from_this( shared_count const & /*pn*/, ... ) +{ +} + +} // namespace detail + + +// +// shared_ptr +// +// An enhanced relative of scoped_ptr with reference counted copy semantics. +// The object pointed to is deleted when the last shared_ptr pointing to it +// is destroyed or reset. +// + +template class shared_ptr +{ +private: + // Borland 5.5.1 specific workaround + typedef shared_ptr< T > this_type; + +public: + + typedef T element_type; + typedef T value_type; + typedef T * pointer; + typedef BOOST_DEDUCED_TYPENAME detail::shared_ptr_traits< T >::reference reference; + + shared_ptr(): px(0), pn() // never throws in 1.30+ + { + } + +#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x564) ) + template + explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter()) // Y must be complete +#else + template + explicit shared_ptr(Y * p): px(p), pn(p, boost::checked_deleter()) // Y must be complete +#endif + { + detail::sp_enable_shared_from_this( pn, p, p ); + } + + // + // Requirements: D's copy constructor must not throw + // + // shared_ptr will release p by calling d(p) + // + + template shared_ptr(Y * p, D d): px(p), pn(p, d) + { + detail::sp_enable_shared_from_this( pn, p, p ); + } + +// generated copy constructor, assignment, destructor are fine... + +// except that Borland C++ has a bug, and g++ with -Wsynth warns +#if defined(__BORLANDC__) || 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 + explicit shared_ptr(weak_ptr const & r): pn(r.pn) // may throw + { + // it is now safe to copy r.px, as pn(r.pn) did not throw + px = r.px; + } + + template + shared_ptr(shared_ptr const & r): px(r.px), pn(r.pn) // never throws + { + } + + template + shared_ptr(shared_ptr const & r, detail::static_cast_tag): px(static_cast(r.px)), pn(r.pn) + { + } + + template + shared_ptr(shared_ptr const & r, detail::const_cast_tag): px(const_cast(r.px)), pn(r.pn) + { + } + + template + shared_ptr(shared_ptr const & r, detail::dynamic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) + { + if(px == 0) // need to allocate new counter -- the cast failed + { + pn = detail::shared_count(); + } + } + + template + shared_ptr(shared_ptr const & r, detail::polymorphic_cast_tag): px(dynamic_cast(r.px)), pn(r.pn) + { + if(px == 0) + { + boost::serialization::throw_exception(std::bad_cast()); + } + } + +#ifndef BOOST_NO_AUTO_PTR + + template + explicit shared_ptr(std::auto_ptr & r): px(r.get()), pn() + { + Y * tmp = r.get(); + pn = detail::shared_count(r); + detail::sp_enable_shared_from_this( pn, tmp, tmp ); + } + +#endif + +#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200) + + template + shared_ptr & operator=(shared_ptr const & r) // never throws + { + px = r.px; + pn = r.pn; // shared_count::op= doesn't throw + return *this; + } + +#endif + +#ifndef BOOST_NO_AUTO_PTR + + template + shared_ptr & operator=(std::auto_ptr & r) + { + this_type(r).swap(*this); + return *this; + } + +#endif + + void reset() // never throws in 1.30+ + { + this_type().swap(*this); + } + + template void reset(Y * p) // Y must be complete + { + BOOST_ASSERT(p == 0 || p != px); // catch self-reset errors + this_type(p).swap(*this); + } + + template void reset(Y * p, D d) + { + this_type(p, d).swap(*this); + } + + reference operator* () const // never throws + { + BOOST_ASSERT(px != 0); + return *px; + } + + T * operator-> () const // never throws + { + BOOST_ASSERT(px != 0); + return px; + } + + T * get() const // never throws + { + return px; + } + + // implicit conversion to "bool" + +#if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530) + + operator bool () const + { + return px != 0; + } + +#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + typedef T * (this_type::*unspecified_bool_type)() const; + + operator unspecified_bool_type() const // never throws + { + return px == 0? 0: &this_type::get; + } + +#else + + typedef T * this_type::*unspecified_bool_type; + + operator unspecified_bool_type() const // never throws + { + return px == 0? 0: &this_type::px; + } + +#endif + + // operator! is redundant, but some compilers need it + + bool operator! () const // never throws + { + return px == 0; + } + + bool unique() const // never throws + { + return pn.unique(); + } + + long use_count() const // never throws + { + return pn.use_count(); + } + + void swap(shared_ptr< T > & other) // never throws + { + std::swap(px, other.px); + pn.swap(other.pn); + } + + template bool _internal_less(shared_ptr const & rhs) const + { + return pn < rhs.pn; + } + + void * _internal_get_deleter(std::type_info const & ti) const + { + return pn.get_deleter(ti); + } + +// Tasteless as this may seem, making all members public allows member templates +// to work in the absence of member template friends. (Matthew Langston) + +#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS + +private: + + template friend class shared_ptr; + template friend class weak_ptr; + + +#endif +public: // for serialization + T * px; // contained pointer + detail::shared_count pn; // reference counter + +}; // shared_ptr + +template inline bool operator==(shared_ptr< T > const & a, shared_ptr const & b) +{ + return a.get() == b.get(); +} + +template inline bool operator!=(shared_ptr< T > const & a, shared_ptr const & b) +{ + return a.get() != b.get(); +} + +#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 + +// Resolve the ambiguity between our op!= and the one in rel_ops + +template inline bool operator!=(shared_ptr< T > const & a, shared_ptr< T > const & b) +{ + return a.get() != b.get(); +} + +#endif + +template inline bool operator<(shared_ptr< T > const & a, shared_ptr const & b) +{ + return a._internal_less(b); +} + +template inline void swap(shared_ptr< T > & a, shared_ptr< T > & b) +{ + a.swap(b); +} + +template shared_ptr< T > static_pointer_cast(shared_ptr const & r) +{ + return shared_ptr< T >(r, detail::static_cast_tag()); +} + +template shared_ptr< T > const_pointer_cast(shared_ptr const & r) +{ + return shared_ptr< T >(r, detail::const_cast_tag()); +} + +template shared_ptr< T > dynamic_pointer_cast(shared_ptr const & r) +{ + return shared_ptr< T >(r, detail::dynamic_cast_tag()); +} + +// shared_*_cast names are deprecated. Use *_pointer_cast instead. + +template shared_ptr< T > shared_static_cast(shared_ptr const & r) +{ + return shared_ptr< T >(r, detail::static_cast_tag()); +} + +template shared_ptr< T > shared_dynamic_cast(shared_ptr const & r) +{ + return shared_ptr< T >(r, detail::dynamic_cast_tag()); +} + +template shared_ptr< T > shared_polymorphic_cast(shared_ptr const & r) +{ + return shared_ptr< T >(r, detail::polymorphic_cast_tag()); +} + +template shared_ptr< T > shared_polymorphic_downcast(shared_ptr const & r) +{ + BOOST_ASSERT(dynamic_cast(r.get()) == r.get()); + return shared_static_cast< T >(r); +} + +// get_pointer() enables boost::mem_fn to recognize shared_ptr + +template inline T * get_pointer(shared_ptr< T > const & p) +{ + return p.get(); +} + +// operator<< + +#if defined(__GNUC__) && (__GNUC__ < 3) + +template std::ostream & operator<< (std::ostream & os, shared_ptr const & p) +{ + os << p.get(); + return os; +} + +#else + +# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT) +// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL +using std::basic_ostream; +template basic_ostream & operator<< (basic_ostream & os, shared_ptr const & p) +# else +template std::basic_ostream & operator<< (std::basic_ostream & os, shared_ptr const & p) +# endif +{ + os << p.get(); + return os; +} + +#endif + +// get_deleter (experimental) + +#if (defined(__GNUC__) && (__GNUC__ < 3)) || (defined(__EDG_VERSION__) && (__EDG_VERSION__ <= 238)) + +// g++ 2.9x doesn't allow static_cast(void *) +// apparently EDG 2.38 also doesn't accept it + +template D * get_deleter(shared_ptr< T > const & p) +{ + void const * q = p._internal_get_deleter(typeid(D)); + return const_cast(static_cast(q)); +} + +#else + +template D * get_deleter(shared_ptr< T > const & p) +{ + return static_cast(p._internal_get_deleter(typeid(D))); +} + +#endif + +} // namespace boost + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) + +#endif // #ifndef BOOST_SHARED_PTR_132_HPP_INCLUDED diff --git a/3rdParty/Boost/src/boost/serialization/detail/shared_ptr_nmt_132.hpp b/3rdParty/Boost/src/boost/serialization/detail/shared_ptr_nmt_132.hpp new file mode 100644 index 0000000..490e7dd --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/detail/shared_ptr_nmt_132.hpp @@ -0,0 +1,182 @@ +#ifndef BOOST_DETAIL_SHARED_PTR_NMT_132_HPP_INCLUDED +#define BOOST_DETAIL_SHARED_PTR_NMT_132_HPP_INCLUDED + +// +// detail/shared_ptr_nmt.hpp - shared_ptr.hpp without member templates +// +// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. +// Copyright (c) 2001, 2002 Peter Dimov +// +// Distributed under 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/libs/smart_ptr/shared_ptr.htm for documentation. +// + +#include +#include +#include +#include + +#ifndef BOOST_NO_AUTO_PTR +# include // for std::auto_ptr +#endif + +#include // for std::swap +#include // for std::less +#include // for std::bad_alloc + +namespace boost +{ + +template class shared_ptr +{ +private: + + typedef detail::atomic_count count_type; + +public: + + typedef T element_type; + typedef T value_type; + + explicit shared_ptr(T * p = 0): px(p) + { +#ifndef BOOST_NO_EXCEPTIONS + + try // prevent leak if new throws + { + pn = new count_type(1); + } + catch(...) + { + boost::checked_delete(p); + throw; + } + +#else + + pn = new count_type(1); + + if(pn == 0) + { + boost::checked_delete(p); + boost::serialization::throw_exception(std::bad_alloc()); + } + +#endif + } + + ~shared_ptr() + { + if(--*pn == 0) + { + boost::checked_delete(px); + delete pn; + } + } + + shared_ptr(shared_ptr const & r): px(r.px) // never throws + { + pn = r.pn; + ++*pn; + } + + shared_ptr & operator=(shared_ptr const & r) + { + shared_ptr(r).swap(*this); + return *this; + } + +#ifndef BOOST_NO_AUTO_PTR + + explicit shared_ptr(std::auto_ptr< T > & r) + { + pn = new count_type(1); // may throw + px = r.release(); // fix: moved here to stop leak if new throws + } + + shared_ptr & operator=(std::auto_ptr< T > & r) + { + shared_ptr(r).swap(*this); + return *this; + } + +#endif + + void reset(T * p = 0) + { + BOOST_ASSERT(p == 0 || p != px); + shared_ptr(p).swap(*this); + } + + T & operator*() const // never throws + { + BOOST_ASSERT(px != 0); + return *px; + } + + T * operator->() const // never throws + { + BOOST_ASSERT(px != 0); + return px; + } + + T * get() const // never throws + { + return px; + } + + long use_count() const // never throws + { + return *pn; + } + + bool unique() const // never throws + { + return *pn == 1; + } + + void swap(shared_ptr< T > & other) // never throws + { + std::swap(px, other.px); + std::swap(pn, other.pn); + } + +private: + + T * px; // contained pointer + count_type * pn; // ptr to reference counter +}; + +template inline bool operator==(shared_ptr< T > const & a, shared_ptr const & b) +{ + return a.get() == b.get(); +} + +template inline bool operator!=(shared_ptr< T > const & a, shared_ptr const & b) +{ + return a.get() != b.get(); +} + +template inline bool operator<(shared_ptr< T > const & a, shared_ptr< T > const & b) +{ + return std::less()(a.get(), b.get()); +} + +template void swap(shared_ptr< T > & a, shared_ptr< T > & b) +{ + a.swap(b); +} + +// get_pointer() enables boost::mem_fn to recognize shared_ptr + +template inline T * get_pointer(shared_ptr< T > const & p) +{ + return p.get(); +} + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_SHARED_PTR_NMT_132_HPP_INCLUDED diff --git a/3rdParty/Boost/src/boost/serialization/detail/stack_constructor.hpp b/3rdParty/Boost/src/boost/serialization/detail/stack_constructor.hpp new file mode 100644 index 0000000..de623b0 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/detail/stack_constructor.hpp @@ -0,0 +1,73 @@ +#ifndef BOOST_SERIALIZATION_DETAIL_STACH_CONSTRUCTOR_HPP +#define BOOST_SERIALIZATION_DETAIL_STACH_CONSTRUCTOR_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#if defined(_MSC_VER) && (_MSC_VER <= 1020) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// collections_load_imp.hpp: serialization for loading stl collections + +// (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 + +namespace boost{ +namespace serialization { +namespace detail { + +// reserve space on stack for an object of type T without actually +// construction such an object +template +struct stack_allocate +{ + T * address() { + return static_cast(storage_.address()); + } + T & reference() { + return * address(); + } +private: + typedef BOOST_DEDUCED_TYPENAME boost::aligned_storage< + sizeof(T), + #if BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560)) + 8 + #else + boost::alignment_of::value + #endif + > type; + type storage_; +}; + +// construct element on the stack +template +struct stack_construct : public stack_allocate +{ + stack_construct(Archive & ar, const unsigned int version){ + // note borland emits a no-op without the explicit namespace + boost::serialization::load_construct_data_adl( + ar, + this->address(), + version + ); + } + ~stack_construct(){ + this->address()->~T(); // undo load_construct_data above + } +}; + +} // detail +} // serializaition +} // boost + +#endif // BOOST_SERIALIZATION_DETAIL_STACH_CONSTRUCTOR_HPP diff --git a/3rdParty/Boost/src/boost/serialization/extended_type_info.hpp b/3rdParty/Boost/src/boost/serialization/extended_type_info.hpp new file mode 100644 index 0000000..a4b4b69 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/extended_type_info.hpp @@ -0,0 +1,120 @@ +#ifndef BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP +#define BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// extended_type_info.hpp: interface for portable version of type_info + +// (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. + +// for now, extended type info is part of the serialization libraries +// this could change in the future. +#include +#include +#include // NULL +#include +#include +#include + +#include +#include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275) +#endif + +#define BOOST_SERIALIZATION_MAX_KEY_SIZE 128 + +namespace boost { +namespace serialization { + +namespace void_cast_detail{ + class void_caster; +} + +class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info : + private boost::noncopyable +{ +private: + friend class boost::serialization::void_cast_detail::void_caster; + + // used to uniquely identify the type of class derived from this one + // so that different derivations of this class can be simultaneously + // included in implementation of sets and maps. + const unsigned int m_type_info_key; + virtual bool is_less_than(const extended_type_info & /*rhs*/) const = 0; + virtual bool is_equal(const extended_type_info & /*rhs*/) const = 0; + const char * m_key; + +protected: + void key_unregister() const; + 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( + const unsigned int type_info_key, + const char * key + ); + // account for bogus gcc warning + #if defined(__GNUC__) + virtual + #endif + ~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; + 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 * + find(const char *key); + // for plugins + virtual void * construct(unsigned int /*count*/ = 0, ...) const = 0; + virtual void destroy(void const * const /*p*/) const = 0; +}; + +template +struct guid_defined : boost::mpl::false_ {}; + +namespace ext { + template + struct guid_impl + { + static inline const char * call() + { + return NULL; + } + }; +} + +template +inline const char * guid(){ + return ext::guid_impl::call(); +} + +} // namespace serialization +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP diff --git a/3rdParty/Boost/src/boost/serialization/extended_type_info_no_rtti.hpp b/3rdParty/Boost/src/boost/serialization/extended_type_info_no_rtti.hpp new file mode 100644 index 0000000..025b3f6 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/extended_type_info_no_rtti.hpp @@ -0,0 +1,182 @@ +#ifndef BOOST_EXTENDED_TYPE_INFO_NO_RTTI_HPP +#define BOOST_EXTENDED_TYPE_INFO_NO_RTTI_HPP + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// extended_type_info_no_rtti.hpp: implementation for version that depends +// on runtime typing (rtti - typeid) but uses a user specified string +// as the portable class identifier. + +// (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 + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +// hijack serialization access +#include + +#include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275 4511 4512) +#endif + +namespace boost { +namespace serialization { +/////////////////////////////////////////////////////////////////////// +// define a special type_info that doesn't depend on rtti which is not +// available in all situations. + +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 : + public extended_type_info +{ +protected: + extended_type_info_no_rtti_0(const char * key); + ~extended_type_info_no_rtti_0(); +public: + virtual bool + is_less_than(const boost::serialization::extended_type_info &rhs) const ; + virtual bool + is_equal(const boost::serialization::extended_type_info &rhs) const ; +}; + +} // no_rtti_system + +template +class extended_type_info_no_rtti : + public no_rtti_system::extended_type_info_no_rtti_0, + public singleton > +{ + template + struct action { + struct defined { + static const char * invoke(){ + return guid< T >(); + } + }; + struct undefined { + // if your program traps here - you failed to + // export a guid for this type. the no_rtti + // system requires export for types serialized + // as pointers. + BOOST_STATIC_ASSERT(0 == sizeof(T)); + static const char * invoke(); + }; + static const char * invoke(){ + typedef + BOOST_DEDUCED_TYPENAME boost::mpl::if_c< + tf, + defined, + undefined + >::type type; + return type::invoke(); + } + }; +public: + extended_type_info_no_rtti() : + no_rtti_system::extended_type_info_no_rtti_0(get_key()) + { + key_register(); + } + ~extended_type_info_no_rtti(){ + key_unregister(); + } + const extended_type_info * + get_derived_extended_type_info(const T & t) const { + // find the type that corresponds to the most derived type. + // this implementation doesn't depend on typeid() but assumes + // that the specified type has a function of the following signature. + // A common implemention of such a function is to define as a virtual + // function. So if the is not a polymporphic type it's likely an error + BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value); + const char * derived_key = t.get_key(); + BOOST_ASSERT(NULL != derived_key); + return boost::serialization::extended_type_info::find(derived_key); + } + const char * get_key() const{ + return action::value >::invoke(); + } + virtual const char * get_debug_info() const{ + return action::value >::invoke(); + } + virtual void * construct(unsigned int count, ...) const{ + // count up the arguments + std::va_list ap; + va_start(ap, count); + switch(count){ + case 0: + return factory::type, 0>(ap); + case 1: + return factory::type, 1>(ap); + case 2: + return factory::type, 2>(ap); + case 3: + return factory::type, 3>(ap); + case 4: + return factory::type, 4>(ap); + default: + BOOST_ASSERT(false); // too many arguments + // throw exception here? + return NULL; + } + } + virtual void destroy(void const * const p) const{ + boost::serialization::access::destroy( + static_cast(p) + ); + //delete static_cast(p) ; + } +}; + +} // namespace serialization +} // namespace boost + +/////////////////////////////////////////////////////////////////////////////// +// If no other implementation has been designated as default, +// use this one. To use this implementation as the default, specify it +// before any of the other headers. + +#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO + #define BOOST_SERIALIZATION_DEFAULT_TYPE_INFO + namespace boost { + namespace serialization { + template + struct extended_type_info_impl { + typedef BOOST_DEDUCED_TYPENAME + boost::serialization::extended_type_info_no_rtti< T > type; + }; + } // namespace serialization + } // namespace boost +#endif + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_EXTENDED_TYPE_INFO_NO_RTTI_HPP diff --git a/3rdParty/Boost/src/boost/serialization/extended_type_info_typeid.hpp b/3rdParty/Boost/src/boost/serialization/extended_type_info_typeid.hpp new file mode 100644 index 0000000..9f09587 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/extended_type_info_typeid.hpp @@ -0,0 +1,165 @@ +#ifndef BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_TYPEID_HPP +#define BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_TYPEID_HPP + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// extended_type_info_typeid.hpp: implementation for version that depends +// on runtime typing (rtti - typeid) but uses a user specified string +// as the portable class identifier. + +// (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 +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +// hijack serialization access +#include + +#include + +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275 4511 4512) +#endif + +namespace boost { +namespace serialization { +namespace typeid_system { + +class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info_typeid_0 : + public extended_type_info +{ + virtual const char * get_debug_info() const { + if(static_cast(0) == m_ti) + return static_cast(0); + return m_ti->name(); + } +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 * + get_extended_type_info(const std::type_info & ti) const; +public: + virtual bool + is_less_than(const extended_type_info &rhs) const; + virtual bool + is_equal(const extended_type_info &rhs) const; + const std::type_info & get_typeid() const { + return *m_ti; + } +}; + +} // typeid_system + +template +class extended_type_info_typeid : + public typeid_system::extended_type_info_typeid_0, + public singleton > +{ +public: + extended_type_info_typeid() : + typeid_system::extended_type_info_typeid_0(get_key()) + { + type_register(typeid(T)); + key_register(); + } + ~extended_type_info_typeid(){ + key_unregister(); + type_unregister(); + } + // get the eti record for the true type of this record + // relying upon standard type info implemenation (rtti) + const extended_type_info * + get_derived_extended_type_info(const T & t) const { + // note: this implementation - based on usage of typeid (rtti) + // only does something if the class has at least one virtual function. + BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value); + return + typeid_system::extended_type_info_typeid_0::get_extended_type_info( + typeid(t) + ); + } + const char * get_key() const { + return boost::serialization::guid< T >(); + } + virtual void * construct(unsigned int count, ...) const{ + // count up the arguments + std::va_list ap; + va_start(ap, count); + switch(count){ + case 0: + return factory::type, 0>(ap); + case 1: + return factory::type, 1>(ap); + case 2: + return factory::type, 2>(ap); + case 3: + return factory::type, 3>(ap); + case 4: + return factory::type, 4>(ap); + default: + BOOST_ASSERT(false); // too many arguments + // throw exception here? + return NULL; + } + } + virtual void destroy(void const * const p) const { + boost::serialization::access::destroy( + static_cast(p) + ); + //delete static_cast(p); + } +}; + +} // namespace serialization +} // namespace boost + +/////////////////////////////////////////////////////////////////////////////// +// If no other implementation has been designated as default, +// use this one. To use this implementation as the default, specify it +// before any of the other headers. +#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO + #define BOOST_SERIALIZATION_DEFAULT_TYPE_INFO + namespace boost { + namespace serialization { + template + struct extended_type_info_impl { + typedef BOOST_DEDUCED_TYPENAME + boost::serialization::extended_type_info_typeid< T > type; + }; + } // namespace serialization + } // namespace boost +#endif + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_TYPEID_HPP diff --git a/3rdParty/Boost/src/boost/serialization/factory.hpp b/3rdParty/Boost/src/boost/serialization/factory.hpp new file mode 100644 index 0000000..a25bf20 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/factory.hpp @@ -0,0 +1,101 @@ +#ifndef BOOST_SERIALIZATION_FACTORY_HPP +#define BOOST_SERIALIZATION_FACTORY_HPP + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// factory.hpp: create an instance from an extended_type_info instance. + +// (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 // valist +#include // NULL + +#include +#include +#include + +namespace std{ + #if defined(__LIBCOMO__) + using ::va_list; + #endif +} // namespace std + +namespace boost { +namespace serialization { + +// default implementation does nothing. +template +T * factory(std::va_list){ + BOOST_ASSERT(false); + // throw exception here? + return NULL; +} + +} // namespace serialization +} // namespace boost + +#define BOOST_SERIALIZATION_FACTORY(N, T, A0, A1, A2, A3) \ +namespace boost { \ +namespace serialization { \ + template<> \ + T * factory(std::va_list ap){ \ + BOOST_PP_IF(BOOST_PP_GREATER(N,0) \ + ,A0 a0 = va_arg(ap, A0); \ + ,BOOST_PP_IF(BOOST_PP_GREATER(N,1) \ + ,A1 a1 = va_arg(ap, A1); \ + ,BOOST_PP_IF(BOOST_PP_GREATER(N,2) \ + ,A2 a2 = va_arg(ap, A2); \ + ,BOOST_PP_IF(BOOST_PP_GREATER(N,3) \ + ,A3 a3 = va_arg(ap, A3); \ + ,BOOST_PP_EMPTY() \ + )))) \ + return new T( \ + BOOST_PP_IF(BOOST_PP_GREATER(N,0) \ + ,a0 \ + ,BOOST_PP_IF(BOOST_PP_GREATER(N,1) \ + ,a1 \ + ,BOOST_PP_IF(BOOST_PP_GREATER(N,2) \ + ,a2 \ + ,BOOST_PP_IF(BOOST_PP_GREATER(N,3) \ + ,a3 \ + ,BOOST_PP_EMPTY() \ + )))) \ + ); \ + } \ +} \ +} \ +/**/ + +#define BOOST_SERIALIZATION_FACTORY_4(T, A0, A1, A2, A3) \ + BOOST_SERIALIZATION_FACTORY(4, T, A0, A1, A2, A3) + +#define BOOST_SERIALIZATION_FACTORY_3(T, A0, A1, A2) \ + BOOST_SERIALIZATION_FACTORY(3, T, A0, A1, A2, 0) + +#define BOOST_SERIALIZATION_FACTORY_2(T, A0, A1) \ + BOOST_SERIALIZATION_FACTORY(2, T, A0, A1, 0, 0) + +#define BOOST_SERIALIZATION_FACTORY_1(T, A0) \ + BOOST_SERIALIZATION_FACTORY(1, T, A0, 0, 0, 0) + +#define BOOST_SERIALIZATION_FACTORY_0(T) \ +namespace boost { \ +namespace serialization { \ + template<> \ + T * factory(std::va_list){ \ + return new T(); \ + } \ +} \ +} \ +/**/ + +#endif // BOOST_SERIALIZATION_FACTORY_HPP diff --git a/3rdParty/Boost/src/boost/serialization/force_include.hpp b/3rdParty/Boost/src/boost/serialization/force_include.hpp new file mode 100644 index 0000000..5578ee8 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/force_include.hpp @@ -0,0 +1,59 @@ +#ifndef BOOST_SERIALIZATION_FORCE_INCLUDE_HPP +#define BOOST_SERIALIZATION_FORCE_INCLUDE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// force_include.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 + +// the following help macro is to guarentee that certain coded +// is not removed by over-eager linker optimiser. In certain cases +// we create static objects must be created but are actually never +// referenced - creation has a side-effect such as global registration +// which is important to us. We make an effort to refer these objects +// so that a smart linker won't remove them as being unreferenced. +// In microsoft compilers, inlining the code that does the referring +// means the code gets lost and the static object is not included +// in the library and hence never registered. This manifests itself +// in an ungraceful crash at runtime when (and only when) built in +// release mode. + +#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__) +# if defined(__BORLANDC__) +# define BOOST_DLLEXPORT __export +# else +# define BOOST_DLLEXPORT __declspec(dllexport) +# endif +#elif ! defined(_WIN32) && ! defined(_WIN64) +# if defined(__MWERKS__) +# define BOOST_DLLEXPORT __declspec(dllexport) +# elif defined(__GNUC__) && (__GNUC__ >= 3) +# define BOOST_USED __attribute__ ((__used__)) +# elif defined(__IBMCPP__) && (__IBMCPP__ >= 1110) +# define BOOST_USED __attribute__ ((__used__)) +# elif defined(__INTEL_COMPILER) && (BOOST_INTEL_CXX_VERSION >= 800) +# define BOOST_USED __attribute__ ((__used__)) +# endif +#endif + +#ifndef BOOST_USED +# define BOOST_USED +#endif + +#ifndef BOOST_DLLEXPORT +# define BOOST_DLLEXPORT +#endif + +#endif // BOOST_SERIALIZATION_FORCE_INCLUDE_HPP diff --git a/3rdParty/Boost/src/boost/serialization/is_bitwise_serializable.hpp b/3rdParty/Boost/src/boost/serialization/is_bitwise_serializable.hpp new file mode 100644 index 0000000..34eec40 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/is_bitwise_serializable.hpp @@ -0,0 +1,46 @@ +// (C) Copyright 2007 Matthias Troyer + +// 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) + +// Authors: Matthias Troyer + +/** @file is_bitwise_serializable.hpp + * + * This header provides a traits class for determining whether a class + * can be serialized (in a non-portable way) just by copying the bits. + */ + + +#ifndef BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP +#define BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#include +#include + +namespace boost { +namespace serialization { + template + struct is_bitwise_serializable + : public is_arithmetic< T > + {}; +} // namespace serialization +} // namespace boost + + +// define a macro to make explicit designation of this more transparent +#define BOOST_IS_BITWISE_SERIALIZABLE(T) \ +namespace boost { \ +namespace serialization { \ +template<> \ +struct is_bitwise_serializable< T > : mpl::true_ {}; \ +}} \ +/**/ + +#endif //BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP diff --git a/3rdParty/Boost/src/boost/serialization/item_version_type.hpp b/3rdParty/Boost/src/boost/serialization/item_version_type.hpp new file mode 100644 index 0000000..f3e5ada --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/item_version_type.hpp @@ -0,0 +1,68 @@ +#ifndef BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP +#define BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP + +// (C) Copyright 2010 Robert Ramey +// 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) + +#include // uint_least8_t +#include +#include +#include + +// fixes broken example build on x86_64-linux-gnu-gcc-4.6.0 +#include + +namespace boost { +namespace serialization { + +#if defined(_MSC_VER) +#pragma warning( push ) +#pragma warning( disable : 4244 4267 ) +#endif + +class item_version_type { +private: + typedef unsigned int base_type; + base_type t; +public: + // should be private - but MPI fails if it's not!!! + item_version_type(): t(0) {}; + explicit item_version_type(const unsigned int t_) : t(t_){ + BOOST_ASSERT(t_ <= boost::integer_traits::const_max); + } + item_version_type(const item_version_type & t_) : + t(t_.t) + {} + item_version_type & operator=(item_version_type rhs){ + t = rhs.t; + return *this; + } + // used for text output + operator base_type () const { + return t; + } + // used for text input + operator base_type & () { + return t; + } + bool operator==(const item_version_type & rhs) const { + return t == rhs.t; + } + bool operator<(const item_version_type & rhs) const { + return t < rhs.t; + } +}; + +#if defined(_MSC_VER) +#pragma warning( pop ) +#endif + +} } // end namespace boost::serialization + +BOOST_IS_BITWISE_SERIALIZABLE(item_version_type) + +BOOST_CLASS_IMPLEMENTATION(item_version_type, primitive_type) + +#endif //BOOST_SERIALIZATION_ITEM_VERSION_TYPE_HPP diff --git a/3rdParty/Boost/src/boost/serialization/level.hpp b/3rdParty/Boost/src/boost/serialization/level.hpp new file mode 100644 index 0000000..ce507b2 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/level.hpp @@ -0,0 +1,125 @@ +#ifndef BOOST_SERIALIZATION_LEVEL_HPP +#define BOOST_SERIALIZATION_LEVEL_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// level.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 +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +namespace boost { +namespace serialization { + +struct basic_traits; + +// default serialization implementation level +template +struct implementation_level_impl { + template + struct traits_class_level { + typedef BOOST_DEDUCED_TYPENAME U::level type; + }; + + typedef mpl::integral_c_tag tag; + // note: at least one compiler complained w/o the full qualification + // on basic traits below + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_base_and_derived, + traits_class_level< T >, + //else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_fundamental< T >, + mpl::int_, + //else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_class< T >, + mpl::int_, + //else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_array< T >, + #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) + mpl::int_, + #else + mpl::int_, + #endif + //else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_enum< T >, + //#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) + // mpl::int_, + //#else + mpl::int_, + //#endif + //else + mpl::int_ + > + > + > + > + >::type type; + // vc 7.1 doesn't like enums here + BOOST_STATIC_CONSTANT(int, value = type::value); +}; + +template +struct implementation_level : + public implementation_level_impl +{ +}; + +template +inline bool operator>=(implementation_level< T > t, enum level_type l) +{ + return t.value >= (int)l; +} + +} // namespace serialization +} // namespace boost + +// specify the level of serialization implementation for the class +// require that class info saved when versioning is used +#define BOOST_CLASS_IMPLEMENTATION(T, E) \ + namespace boost { \ + namespace serialization { \ + template <> \ + struct implementation_level_impl< const T > \ + { \ + typedef mpl::integral_c_tag tag; \ + typedef mpl::int_< E > type; \ + BOOST_STATIC_CONSTANT( \ + int, \ + value = implementation_level_impl::type::value \ + ); \ + }; \ + } \ + } + /**/ + +#endif // BOOST_SERIALIZATION_LEVEL_HPP diff --git a/3rdParty/Boost/src/boost/serialization/level_enum.hpp b/3rdParty/Boost/src/boost/serialization/level_enum.hpp new file mode 100644 index 0000000..11bd17f --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/level_enum.hpp @@ -0,0 +1,55 @@ +#ifndef BOOST_SERIALIZATION_LEVEL_ENUM_HPP +#define BOOST_SERIALIZATION_LEVEL_ENUM_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// level_enum.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. + +namespace boost { +namespace serialization { + +// for each class used in the program, specify which level +// of serialization should be implemented + +// names for each level +enum level_type +{ + // Don't serialize this type. An attempt to do so should + // invoke a compile time assertion. + not_serializable = 0, + // write/read this type directly to the archive. In this case + // serialization code won't be called. This is the default + // case for fundamental types. It presumes a member function or + // template in the archive class that can handle this type. + // there is no runtime overhead associated reading/writing + // instances of this level + primitive_type = 1, + // Serialize the objects of this type using the objects "serialize" + // function or template. This permits values to be written/read + // to/from archives but includes no class or version information. + object_serializable = 2, + /////////////////////////////////////////////////////////////////// + // once an object is serialized at one of the above levels, the + // corresponding archives cannot be read if the implementation level + // for the archive object is changed. + /////////////////////////////////////////////////////////////////// + // Add class information to the archive. Class information includes + // implementation level, class version and class name if available + object_class_info = 3 +}; + +} // namespace serialization +} // namespace boost + +#endif // BOOST_SERIALIZATION_LEVEL_ENUM_HPP diff --git a/3rdParty/Boost/src/boost/serialization/list.hpp b/3rdParty/Boost/src/boost/serialization/list.hpp new file mode 100644 index 0000000..469bb23 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/list.hpp @@ -0,0 +1,77 @@ +#ifndef BOOST_SERIALIZATION_LIST_HPP +#define BOOST_SERIALIZATION_LIST_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// list.hpp: serialization for stl list templates + +// (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 + +#include + +#include +#include +#include + +namespace boost { +namespace serialization { + +template +inline void save( + Archive & ar, + const std::list &t, + const unsigned int /* file_version */ +){ + boost::serialization::stl::save_collection< + Archive, + std::list + >(ar, t); +} + +template +inline void load( + Archive & ar, + std::list &t, + const unsigned int /* file_version */ +){ + boost::serialization::stl::load_collection< + Archive, + std::list, + boost::serialization::stl::archive_input_seq< + Archive, + std::list + >, + boost::serialization::stl::no_reserve_imp > + >(ar, t); +} + +// split non-intrusive serialization function member into separate +// non intrusive save/load member functions +template +inline void serialize( + Archive & ar, + std::list & t, + const unsigned int file_version +){ + boost::serialization::split_free(ar, t, file_version); +} + +} // serialization +} // namespace boost + +#include + +BOOST_SERIALIZATION_COLLECTION_TRAITS(std::list) + +#endif // BOOST_SERIALIZATION_LIST_HPP diff --git a/3rdParty/Boost/src/boost/serialization/nvp.hpp b/3rdParty/Boost/src/boost/serialization/nvp.hpp new file mode 100644 index 0000000..2d7f4ed --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/nvp.hpp @@ -0,0 +1,144 @@ +#ifndef BOOST_SERIALIZATION_NVP_HPP +#define BOOST_SERIALIZATION_NVP_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// nvp.hpp: interface for serialization system. + +// (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 + +#include +#include +// supress noise +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { +namespace serialization { + +template +struct nvp : + public std::pair, + public wrapper_traits > +{ + explicit nvp(const char * name_, T & t) : + // note: redundant cast works around borland issue + // note: added _ to suppress useless gcc warning + std::pair(name_, (T*)(& t)) + {} + nvp(const nvp & rhs) : + // note: redundant cast works around borland issue + std::pair(rhs.first, (T*)rhs.second) + {} + + const char * name() const { + return this->first; + } + T & value() const { + return *(this->second); + } + + const T & const_value() const { + return *(this->second); + } + + // True64 compiler complains with a warning about the use of + // the name "Archive" hiding some higher level usage. I'm sure this + // is an error but I want to accomodated as it generates a long warning + // listing and might be related to a lot of test failures. + // default treatment for name-value pairs. The name is + // just discarded and only the value is serialized. + template + void save( + Archivex & ar, + const unsigned int /* file_version */ + ) const { + // CodeWarrior 8.x can't seem to resolve the << op for a rhs of "const T *" + ar.operator<<(const_value()); + } + template + void load( + Archivex & ar, + const unsigned int /* file_version */ + ){ + // CodeWarrior 8.x can't seem to resolve the >> op for a rhs of "const T *" + ar.operator>>(value()); + } + BOOST_SERIALIZATION_SPLIT_MEMBER() +}; + +template +inline +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +const +#endif +nvp< T > make_nvp(const char * name, T & t){ + return nvp< T >(name, t); +} + +// to maintain efficiency and portability, we want to assign +// specific serialization traits to all instances of this wrappers. +// we can't strait forward method below as it depends upon +// Partial Template Specialization and doing so would mean that wrappers +// wouldn't be treated the same on different platforms. This would +// break archive portability. Leave this here as reminder not to use it !!! +#if 0 // #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +template +struct implementation_level > +{ + typedef mpl::integral_c_tag tag; + typedef mpl::int_ type; + BOOST_STATIC_CONSTANT(int, value = implementation_level::type::value); +}; + +// nvp objects are generally created on the stack and are never tracked +template +struct tracking_level > +{ + typedef mpl::integral_c_tag tag; + typedef mpl::int_ type; + BOOST_STATIC_CONSTANT(int, value = tracking_level::type::value); +}; + +#endif + +} // seralization +} // boost + +#include + +#define BOOST_SERIALIZATION_NVP(name) \ + boost::serialization::make_nvp(BOOST_PP_STRINGIZE(name), name) +/**/ + +#define BOOST_SERIALIZATION_BASE_OBJECT_NVP(name) \ + boost::serialization::make_nvp( \ + BOOST_PP_STRINGIZE(name), \ + boost::serialization::base_object(*this) \ + ) +/**/ + +#endif // BOOST_SERIALIZATION_NVP_HPP diff --git a/3rdParty/Boost/src/boost/serialization/pfto.hpp b/3rdParty/Boost/src/boost/serialization/pfto.hpp new file mode 100644 index 0000000..8d98463 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/pfto.hpp @@ -0,0 +1,78 @@ +#ifndef BOOST_SERIALIZATION_PFTO_HPP +#define BOOST_SERIALIZATION_PFTO_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// pfto.hpp: workarounds for compilers which have problems supporting +// Partial Function Template Ordering (PFTO). + +// (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/libs/serialization for updates, documentation, and revision history. +// PFTO version is used to specify the last argument of certain functions +// Function it is used to support compilers that fail to support correct Partial +// Template Ordering +#include + +// some compilers can use an exta argument and use function overloading +// to choose desired function. This extra argument is long in the default +// function implementation and int for the rest. The function is called +// with an int argument. This first attempts to match functions with an +// int argument before the default one (with a long argument). This is +// known to function with VC 6.0. On other compilers this fails (Borland) +// or causes other problems (GCC). note: this + +#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) + #define BOOST_PFTO long +#else + #define BOOST_PFTO +#endif + +// here's another approach. Rather than use a default function - make sure +// there is no default at all by requiring that all function invocations +// have a "wrapped" argument type. This solves a problem with VC 6.0 +// (and perhaps others) while implementing templated constructors. + +namespace boost { +namespace serialization { + +template +struct pfto_wrapper { + const T & t; + operator const T & (){ + return t; + } + pfto_wrapper (const T & rhs) : t(rhs) {} +}; + +template +pfto_wrapper< T > make_pfto_wrapper(const T & t, BOOST_PFTO int){ + return pfto_wrapper< T >(t); +} + +template +pfto_wrapper< T > make_pfto_wrapper(const pfto_wrapper< T > & t, int){ + return t; +} + +} // namespace serialization +} // namespace boost + +#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + #define BOOST_PFTO_WRAPPER(T) \ + boost::serialization::pfto_wrapper< T > + #define BOOST_MAKE_PFTO_WRAPPER(t) \ + boost::serialization::make_pfto_wrapper(t, 0) +#else + #define BOOST_PFTO_WRAPPER(T) T + #define BOOST_MAKE_PFTO_WRAPPER(t) t +#endif + +#endif // BOOST_SERIALIZATION_PFTO_HPP diff --git a/3rdParty/Boost/src/boost/serialization/serialization.hpp b/3rdParty/Boost/src/boost/serialization/serialization.hpp new file mode 100644 index 0000000..f17e8dd --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/serialization.hpp @@ -0,0 +1,167 @@ +#ifndef BOOST_SERIALIZATION_SERIALIZATION_HPP +#define BOOST_SERIALIZATION_SERIALIZATION_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#if defined(_MSC_VER) && (_MSC_VER >= 1310) +# pragma warning (disable : 4675) // suppress ADL warning +#endif + +#include +#include +#include + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// serialization.hpp: interface for serialization system. + +// (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. + +////////////////////////////////////////////////////////////////////// +// public interface to serialization. + +///////////////////////////////////////////////////////////////////////////// +// layer 0 - intrusive verison +// declared and implemented for each user defined class to be serialized +// +// template +// serialize(Archive &ar, const unsigned int file_version){ +// ar & base_object(*this) & member1 & member2 ... ; +// } + +///////////////////////////////////////////////////////////////////////////// +// layer 1 - layer that routes member access through the access class. +// this is what permits us to grant access to private class member functions +// by specifying friend class boost::serialization::access + +#include + +///////////////////////////////////////////////////////////////////////////// +// layer 2 - default implementation of non-intrusive serialization. +// +// note the usage of function overloading to compensate that C++ does not +// currently support Partial Template Specialization for function templates +// We have declared the version number as "const unsigned long". +// Overriding templates for specific data types should declare the version +// number as "const unsigned int". Template matching will first be applied +// to functions with the same version types - that is the overloads. +// If there is no declared function prototype that matches, the second argument +// will be converted to "const unsigned long" and a match will be made with +// one of the default template functions below. + +namespace boost { +namespace serialization { + +BOOST_STRONG_TYPEDEF(unsigned int, version_type) + +// default implementation - call the member function "serialize" +template +inline void serialize( + Archive & ar, T & t, const BOOST_PFTO unsigned int file_version +){ + access::serialize(ar, t, static_cast(file_version)); +} + +// save data required for construction +template +inline void save_construct_data( + Archive & /*ar*/, + const T * /*t*/, + const BOOST_PFTO unsigned int /*file_version */ +){ + // default is to save no data because default constructor + // requires no arguments. +} + +// load data required for construction and invoke constructor in place +template +inline void load_construct_data( + Archive & /*ar*/, + T * t, + const BOOST_PFTO unsigned int /*file_version*/ +){ + // default just uses the default constructor. going + // through access permits usage of otherwise private default + // constructor + access::construct(t); +} + +///////////////////////////////////////////////////////////////////////////// +// layer 3 - move call into serialization namespace so that ADL will function +// in the manner we desire. +// +// on compilers which don't implement ADL. only the current namespace +// i.e. boost::serialization will be searched. +// +// on compilers which DO implement ADL +// serialize overrides can be in any of the following +// +// 1) same namepace as Archive +// 2) same namespace as T +// 3) boost::serialization +// +// Due to Martin Ecker + +template +inline void serialize_adl( + Archive & ar, + T & t, + const unsigned int file_version +){ + // note usage of function overloading to delay final resolution + // until the point of instantiation. This works around the two-phase + // lookup "feature" which inhibits redefintion of a default function + // template implementation. Due to Robert Ramey + // + // Note that this trick generates problems for compiles which don't support + // PFTO, suppress it here. As far as we know, there are no compilers + // which fail to support PFTO while supporting two-phase lookup. + #if ! defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) + const version_type v(file_version); + serialize(ar, t, v); + #else + serialize(ar, t, file_version); + #endif +} + +template +inline void save_construct_data_adl( + Archive & ar, + const T * t, + const unsigned int file_version +){ + // see above + #if ! defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) + const version_type v(file_version); + save_construct_data(ar, t, v); + #else + save_construct_data(ar, t, file_version); + #endif +} + +template +inline void load_construct_data_adl( + Archive & ar, + T * t, + const unsigned int file_version +){ + // see above comment + #if ! defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) + const version_type v(file_version); + load_construct_data(ar, t, v); + #else + load_construct_data(ar, t, file_version); + #endif +} + +} // namespace serialization +} // namespace boost + +#endif //BOOST_SERIALIZATION_SERIALIZATION_HPP diff --git a/3rdParty/Boost/src/boost/serialization/shared_ptr.hpp b/3rdParty/Boost/src/boost/serialization/shared_ptr.hpp new file mode 100644 index 0000000..37f95e3 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/shared_ptr.hpp @@ -0,0 +1,177 @@ +#ifndef BOOST_SERIALIZATION_SHARED_PTR_HPP +#define BOOST_SERIALIZATION_SHARED_PTR_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// shared_ptr.hpp: serialization for boost shared pointer + +// (C) Copyright 2004 Robert Ramey and Martin Ecker +// 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 // NULL + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// shared_ptr serialization traits +// version 1 to distinguish from boost 1.32 version. Note: we can only do this +// for a template when the compiler supports partial template specialization + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + namespace boost { + namespace serialization{ + template + struct version< ::boost::shared_ptr< T > > { + typedef mpl::integral_c_tag tag; + #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) + typedef BOOST_DEDUCED_TYPENAME mpl::int_<1> type; + #else + typedef mpl::int_<1> type; + #endif + #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) + BOOST_STATIC_CONSTANT(int, value = 1); + #else + BOOST_STATIC_CONSTANT(int, value = type::value); + #endif + }; + // don't track shared pointers + template + struct tracking_level< ::boost::shared_ptr< T > > { + typedef mpl::integral_c_tag tag; + #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) + typedef BOOST_DEDUCED_TYPENAME mpl::int_< ::boost::serialization::track_never> type; + #else + typedef mpl::int_< ::boost::serialization::track_never> type; + #endif + #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) + BOOST_STATIC_CONSTANT(int, value = ::boost::serialization::track_never); + #else + BOOST_STATIC_CONSTANT(int, value = type::value); + #endif + }; + }} + #define BOOST_SERIALIZATION_SHARED_PTR(T) +#else + // define macro to let users of these compilers do this + #define BOOST_SERIALIZATION_SHARED_PTR(T) \ + BOOST_CLASS_VERSION( \ + ::boost::shared_ptr< T >, \ + 1 \ + ) \ + BOOST_CLASS_TRACKING( \ + ::boost::shared_ptr< T >, \ + ::boost::serialization::track_never \ + ) \ + /**/ +#endif + +namespace boost { +namespace serialization{ + +struct null_deleter { + void operator()(void const *) const {} +}; + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// serialization for shared_ptr + +template +inline void save( + Archive & ar, + const boost::shared_ptr< T > &t, + const unsigned int /* file_version */ +){ + // The most common cause of trapping here would be serializing + // something like shared_ptr. This occurs because int + // is never tracked by default. Wrap int in a trackable type + BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); + const T * t_ptr = t.get(); + ar << boost::serialization::make_nvp("px", t_ptr); +} + +#ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP +template +inline void load( + Archive & ar, + boost::shared_ptr< T > &t, + const unsigned int file_version +){ + // The most common cause of trapping here would be serializing + // something like shared_ptr. This occurs because int + // is never tracked by default. Wrap int in a trackable type + BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); + T* r; + if(file_version < 1){ + //ar.register_type(static_cast< + // boost_132::detail::sp_counted_base_impl > * + //>(NULL)); + ar.register_type(static_cast< + boost_132::detail::sp_counted_base_impl * + >(NULL)); + boost_132::shared_ptr< T > sp; + ar >> boost::serialization::make_nvp("px", sp.px); + ar >> boost::serialization::make_nvp("pn", sp.pn); + // got to keep the sps around so the sp.pns don't disappear + ar.append(sp); + r = sp.get(); + } + else{ + ar >> boost::serialization::make_nvp("px", r); + } + ar.reset(t,r); +} + +#else +template +inline void load( + Archive & ar, + boost::shared_ptr< T > &t, + const unsigned int /*file_version*/ +){ + // The most common cause of trapping here would be serializing + // something like shared_ptr. This occurs because int + // is never tracked by default. Wrap int in a trackable type + BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); + T* r; + ar >> boost::serialization::make_nvp("px", r); + ar.reset(t,r); +} +#endif + +template +inline void serialize( + Archive & ar, + boost::shared_ptr< T > &t, + const unsigned int file_version +){ + // correct shared_ptr serialization depends upon object tracking + // being used. + BOOST_STATIC_ASSERT( + boost::serialization::tracking_level< T >::value + != boost::serialization::track_never + ); + boost::serialization::split_free(ar, t, file_version); +} + +} // namespace serialization +} // namespace boost + +#endif // BOOST_SERIALIZATION_SHARED_PTR_HPP diff --git a/3rdParty/Boost/src/boost/serialization/shared_ptr_132.hpp b/3rdParty/Boost/src/boost/serialization/shared_ptr_132.hpp new file mode 100644 index 0000000..9bcefe0 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/shared_ptr_132.hpp @@ -0,0 +1,222 @@ +#ifndef BOOST_SERIALIZATION_SHARED_PTR_132_HPP +#define BOOST_SERIALIZATION_SHARED_PTR_132_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// shared_ptr.hpp: serialization for boost shared pointer + +// (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. + +// note: totally unadvised hack to gain access to private variables +// in shared_ptr and shared_count. Unfortunately its the only way to +// do this without changing shared_ptr and shared_count +// the best we can do is to detect a conflict here +#include + +#include +#include // NULL + +#include +#include +#include +#include +#include + +// mark base class as an (uncreatable) base class +#include + +///////////////////////////////////////////////////////////// +// Maintain a couple of lists of loaded shared pointers of the old previous +// version (1.32) + +namespace boost_132 { +namespace serialization { +namespace detail { + +struct null_deleter { + void operator()(void const *) const {} +}; + +} // namespace detail +} // namespace serialization +} // namespace boost_132 + +///////////////////////////////////////////////////////////// +// sp_counted_base_impl serialization + +namespace boost { +namespace serialization { + +template +inline void serialize( + Archive & /* ar */, + boost_132::detail::sp_counted_base_impl & /* t */, + const unsigned int /*file_version*/ +){ + // register the relationship between each derived class + // its polymorphic base + boost::serialization::void_cast_register< + boost_132::detail::sp_counted_base_impl, + boost_132::detail::sp_counted_base + >( + static_cast *>(NULL), + static_cast(NULL) + ); +} + +template +inline void save_construct_data( + Archive & ar, + const + boost_132::detail::sp_counted_base_impl *t, + const BOOST_PFTO unsigned int /* file_version */ +){ + // variables used for construction + ar << boost::serialization::make_nvp("ptr", t->ptr); +} + +template +inline void load_construct_data( + Archive & ar, + boost_132::detail::sp_counted_base_impl * t, + const unsigned int /* file_version */ +){ + P ptr_; + ar >> boost::serialization::make_nvp("ptr", ptr_); + // ::new(t)boost_132::detail::sp_counted_base_impl(ptr_, D()); + // placement + // note: the original ::new... above is replaced by the one here. This one + // creates all new objects with a null_deleter so that after the archive + // is finished loading and the shared_ptrs are destroyed - the underlying + // raw pointers are NOT deleted. This is necessary as they are used by the + // new system as well. + ::new(t)boost_132::detail::sp_counted_base_impl< + P, + boost_132::serialization::detail::null_deleter + >( + ptr_, boost_132::serialization::detail::null_deleter() + ); // placement new + // compensate for that fact that a new shared count always is + // initialized with one. the add_ref_copy below will increment it + // every time its serialized so without this adjustment + // the use and weak counts will be off by one. + t->use_count_ = 0; +} + +} // serialization +} // namespace boost + +///////////////////////////////////////////////////////////// +// shared_count serialization + +namespace boost { +namespace serialization { + +template +inline void save( + Archive & ar, + const boost_132::detail::shared_count &t, + const unsigned int /* file_version */ +){ + ar << boost::serialization::make_nvp("pi", t.pi_); +} + +template +inline void load( + Archive & ar, + boost_132::detail::shared_count &t, + const unsigned int /* file_version */ +){ + ar >> boost::serialization::make_nvp("pi", t.pi_); + if(NULL != t.pi_) + t.pi_->add_ref_copy(); +} + +} // serialization +} // namespace boost + +BOOST_SERIALIZATION_SPLIT_FREE(boost_132::detail::shared_count) + +///////////////////////////////////////////////////////////// +// implement serialization for shared_ptr< T > + +namespace boost { +namespace serialization { + +template +inline void save( + Archive & ar, + const boost_132::shared_ptr< T > &t, + const unsigned int /* file_version */ +){ + // only the raw pointer has to be saved + // the ref count is maintained automatically as shared pointers are loaded + ar.register_type(static_cast< + boost_132::detail::sp_counted_base_impl > * + >(NULL)); + ar << boost::serialization::make_nvp("px", t.px); + ar << boost::serialization::make_nvp("pn", t.pn); +} + +template +inline void load( + Archive & ar, + boost_132::shared_ptr< T > &t, + const unsigned int /* file_version */ +){ + // only the raw pointer has to be saved + // the ref count is maintained automatically as shared pointers are loaded + ar.register_type(static_cast< + boost_132::detail::sp_counted_base_impl > * + >(NULL)); + ar >> boost::serialization::make_nvp("px", t.px); + ar >> boost::serialization::make_nvp("pn", t.pn); +} + +template +inline void serialize( + Archive & ar, + boost_132::shared_ptr< T > &t, + const unsigned int file_version +){ + // correct shared_ptr serialization depends upon object tracking + // being used. + BOOST_STATIC_ASSERT( + boost::serialization::tracking_level< T >::value + != boost::serialization::track_never + ); + boost::serialization::split_free(ar, t, file_version); +} + +} // serialization +} // namespace boost + +// note: change below uses null_deleter +// This macro is used to export GUIDS for shared pointers to allow +// the serialization system to export them properly. David Tonge +#define BOOST_SHARED_POINTER_EXPORT_GUID(T, K) \ + typedef boost_132::detail::sp_counted_base_impl< \ + T *, \ + boost::checked_deleter< T > \ + > __shared_ptr_ ## T; \ + BOOST_CLASS_EXPORT_GUID(__shared_ptr_ ## T, "__shared_ptr_" K) \ + BOOST_CLASS_EXPORT_GUID(T, K) \ + /**/ + +#define BOOST_SHARED_POINTER_EXPORT(T) \ + BOOST_SHARED_POINTER_EXPORT_GUID( \ + T, \ + BOOST_PP_STRINGIZE(T) \ + ) \ + /**/ + +#endif // BOOST_SERIALIZATION_SHARED_PTR_132_HPP diff --git a/3rdParty/Boost/src/boost/serialization/singleton.hpp b/3rdParty/Boost/src/boost/serialization/singleton.hpp new file mode 100644 index 0000000..f521590 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/singleton.hpp @@ -0,0 +1,158 @@ +#ifndef BOOST_SERIALIZATION_SINGLETON_HPP +#define BOOST_SERIALIZATION_SINGLETON_HPP + +/////////1/////////2///////// 3/////////4/////////5/////////6/////////7/////////8 +// singleton.hpp +// +// Copyright David Abrahams 2006. Original version +// +// Copyright Robert Ramey 2007. Changes made to permit +// application throughout the serialization library. +// +// Distributed under 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) +// +// The intention here is to define a template which will convert +// any class into a singleton with the following features: +// +// a) initialized before first use. +// b) thread-safe for const access to the class +// c) non-locking +// +// In order to do this, +// a) Initialize dynamically when used. +// b) Require that all singletons be initialized before main +// is called or any entry point into the shared library is invoked. +// This guarentees no race condition for initialization. +// In debug mode, we assert that no non-const functions are called +// after main is invoked. +// + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#include +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace serialization { + +////////////////////////////////////////////////////////////////////// +// Provides a dynamically-initialized (singleton) instance of T in a +// way that avoids LNK1179 on vc6. See http://tinyurl.com/ljdp8 or +// http://lists.boost.org/Archives/boost/2006/05/105286.php for +// details. +// + +// singletons created by this code are guarenteed to be unique +// within the executable or shared library which creates them. +// This is sufficient and in fact ideal for the serialization library. +// The singleton is created when the module is loaded and destroyed +// when the module is unloaded. + +// This base class has two functions. + +// First it provides a module handle for each singleton indicating +// the executable or shared library in which it was created. This +// turns out to be necessary and sufficient to implement the tables +// used by serialization library. + +// Second, it provides a mechanism to detect when a non-const function +// is called after initialization. + +// make a singleton to lock/unlock all singletons for alteration. +// The intent is that all singletons created/used by this code +// are to be initialized before main is called. A test program +// can lock all the singletons when main is entereed. This any +// attempt to retieve a mutable instances while locked will +// generate a assertion if compiled for debug. + +class singleton_module : + public boost::noncopyable +{ +private: + static bool & get_lock(){ + static bool lock = false; + return lock; + } +public: +// static const void * get_module_handle(){ +// return static_cast(get_module_handle); +// } + static void lock(){ + get_lock() = true; + } + static void unlock(){ + get_lock() = false; + } + static bool is_locked() { + return get_lock(); + } +}; + +namespace detail { + +template +class singleton_wrapper : public T +{ +public: + static bool m_is_destroyed; + ~singleton_wrapper(){ + m_is_destroyed = true; + } +}; + +template +bool detail::singleton_wrapper< T >::m_is_destroyed = false; + +} // detail + +template +class singleton : public singleton_module +{ +private: + BOOST_DLLEXPORT static T & instance; + // include this to provoke instantiation at pre-execution time + static void use(T const &) {} + BOOST_DLLEXPORT static T & get_instance() { + static detail::singleton_wrapper< T > t; + // refer to instance, causing it to be instantiated (and + // initialized at startup on working compilers) + BOOST_ASSERT(! detail::singleton_wrapper< T >::m_is_destroyed); + use(instance); + return static_cast(t); + } +public: + BOOST_DLLEXPORT static T & get_mutable_instance(){ + BOOST_ASSERT(! is_locked()); + return get_instance(); + } + BOOST_DLLEXPORT static const T & get_const_instance(){ + return get_instance(); + } + BOOST_DLLEXPORT static bool is_destroyed(){ + return detail::singleton_wrapper< T >::m_is_destroyed; + } +}; + +template +BOOST_DLLEXPORT T & singleton< T >::instance = singleton< T >::get_instance(); + +} // namespace serialization +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif // BOOST_SERIALIZATION_SINGLETON_HPP diff --git a/3rdParty/Boost/src/boost/serialization/smart_cast.hpp b/3rdParty/Boost/src/boost/serialization/smart_cast.hpp new file mode 100644 index 0000000..c240a55 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/smart_cast.hpp @@ -0,0 +1,301 @@ +#ifndef BOOST_SERIALIZATION_SMART_CAST_HPP +#define BOOST_SERIALIZATION_SMART_CAST_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// smart_cast.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/libs/serialization for updates, documentation, and revision history. + +// casting of pointers and references. + +// In casting between different C++ classes, there are a number of +// rules that have to be kept in mind in deciding whether to use +// static_cast or dynamic_cast. + +// a) dynamic casting can only be applied when one of the types is polymorphic +// Otherwise static_cast must be used. +// b) only dynamic casting can do runtime error checking +// use of static_cast is generally un checked even when compiled for debug +// c) static_cast would be considered faster than dynamic_cast. + +// If casting is applied to a template parameter, there is no apriori way +// to know which of the two casting methods will be permitted or convenient. + +// smart_cast uses C++ type_traits, and program debug mode to select the +// most convenient cast to use. + +#include +#include +#include // NULL + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { +namespace serialization { +namespace smart_cast_impl { + + template + struct reference { + + struct polymorphic { + + struct linear { + template + static T cast(U & u){ + return static_cast< T >(u); + } + }; + + struct cross { + template + static T cast(U & u){ + return dynamic_cast< T >(u); + } + }; + + template + static T cast(U & u){ + // if we're in debug mode + #if ! defined(NDEBUG) \ + || defined(__BORLANDC__) && (__BORLANDC__ <= 0x560) \ + || defined(__MWERKS__) + // do a checked dynamic cast + return cross::cast(u); + #else + // borland 5.51 chokes here so we can't use it + // note: if remove_reference isn't function for these types + // cross casting will be selected this will work but will + // not be the most efficient method. This will conflict with + // the original smart_cast motivation. + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + BOOST_DEDUCED_TYPENAME mpl::and_< + mpl::not_::type, + U + > >, + mpl::not_::type + > > + >, + // borland chokes w/o full qualification here + mpl::identity, + mpl::identity + >::type typex; + // typex works around gcc 2.95 issue + return typex::cast(u); + #endif + } + }; + + struct non_polymorphic { + template + static T cast(U & u){ + return static_cast< T >(u); + } + }; + template + static T cast(U & u){ + #if defined(__BORLANDC__) + return mpl::eval_if< + boost::is_polymorphic, + mpl::identity, + mpl::identity + >::type::cast(u); + #else + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + boost::is_polymorphic, + mpl::identity, + mpl::identity + >::type typex; + return typex::cast(u); + #endif + } + }; + + template + struct pointer { + + struct polymorphic { + // unfortunately, this below fails to work for virtual base + // classes. need has_virtual_base to do this. + // Subject for further study + #if 0 + struct linear { + template + static T cast(U * u){ + return static_cast< T >(u); + } + }; + + struct cross { + template + static T cast(U * u){ + T tmp = dynamic_cast< T >(u); + #ifndef NDEBUG + if ( tmp == 0 ) throw std::bad_cast(); + #endif + return tmp; + } + }; + + template + static T cast(U * u){ + // if we're in debug mode + #if ! defined(NDEBUG) || defined(__BORLANDC__) && (__BORLANDC__ <= 0x560) + // do a checked dynamic cast + return cross::cast(u); + #else + // borland 5.51 chokes here so we can't use it + // note: if remove_pointer isn't function for these types + // cross casting will be selected this will work but will + // not be the most efficient method. This will conflict with + // the original smart_cast motivation. + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if< + BOOST_DEDUCED_TYPENAME mpl::and_< + mpl::not_::type, + U + > >, + mpl::not_::type + > > + >, + // borland chokes w/o full qualification here + mpl::identity, + mpl::identity + >::type typex; + return typex::cast(u); + #endif + } + #else + template + static T cast(U * u){ + T tmp = dynamic_cast< T >(u); + #ifndef NDEBUG + if ( tmp == 0 ) throw std::bad_cast(); + #endif + return tmp; + } + #endif + }; + + struct non_polymorphic { + template + static T cast(U * u){ + return static_cast< T >(u); + } + }; + + template + static T cast(U * u){ + #if defined(__BORLANDC__) + return mpl::eval_if< + boost::is_polymorphic, + mpl::identity, + mpl::identity + >::type::cast(u); + #else + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + boost::is_polymorphic, + mpl::identity, + mpl::identity + >::type typex; + return typex::cast(u); + #endif + } + + }; + + template + struct void_pointer { + template + static TPtr cast(UPtr uptr){ + return static_cast(uptr); + } + }; + + template + struct error { + // if we get here, its because we are using one argument in the + // cast on a system which doesn't support partial template + // specialization + template + static T cast(U u){ + BOOST_STATIC_ASSERT(sizeof(T)==0); + return * static_cast(NULL); + } + }; + +} // smart_cast_impl + +// this implements: +// smart_cast(Source * s) +// smart_cast(s) +// note that it will fail with +// smart_cast(s) +template +T smart_cast(U u) { + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if< + BOOST_DEDUCED_TYPENAME mpl::or_< + boost::is_same, + boost::is_same, + boost::is_same, + boost::is_same + >, + mpl::identity >, + // else + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity >, + // else + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity >, + // else + mpl::identity + > + > + > + >::type typex; + return typex::cast(u); +} + +// this implements: +// smart_cast_reference(Source & s) +template +T smart_cast_reference(U & u) { + return smart_cast_impl::reference< T >::cast(u); +} + +} // namespace serialization +} // namespace boost + +#endif // BOOST_SERIALIZATION_SMART_CAST_HPP diff --git a/3rdParty/Boost/src/boost/serialization/split_free.hpp b/3rdParty/Boost/src/boost/serialization/split_free.hpp new file mode 100644 index 0000000..9dbcd2f --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/split_free.hpp @@ -0,0 +1,93 @@ +#ifndef BOOST_SERIALIZATION_SPLIT_FREE_HPP +#define BOOST_SERIALIZATION_SPLIT_FREE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// split_free.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 +#include +#include +#include + +namespace boost { +namespace archive { + namespace detail { + template class interface_oarchive; + template class interface_iarchive; + } // namespace detail +} // namespace archive + +namespace serialization { + +//namespace detail { +template +struct free_saver { + static void invoke( + Archive & ar, + const T & t, + const unsigned int file_version + ){ + // use function overload (version_type) to workaround + // two-phase lookup issue + const version_type v(file_version); + save(ar, t, v); + } +}; +template +struct free_loader { + static void invoke( + Archive & ar, + T & t, + const unsigned int file_version + ){ + // use function overload (version_type) to workaround + // two-phase lookup issue + const version_type v(file_version); + load(ar, t, v); + } +}; +//} // namespace detail + +template +inline void split_free( + Archive & ar, + T & t, + const unsigned int file_version +){ + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + BOOST_DEDUCED_TYPENAME Archive::is_saving, + mpl::identity >, + mpl::identity > + >::type typex; + typex::invoke(ar, t, file_version); +} + +} // namespace serialization +} // namespace boost + +#define BOOST_SERIALIZATION_SPLIT_FREE(T) \ +namespace boost { namespace serialization { \ +template \ +inline void serialize( \ + Archive & ar, \ + T & t, \ + const unsigned int file_version \ +){ \ + split_free(ar, t, file_version); \ +} \ +}} +/**/ + +#endif // BOOST_SERIALIZATION_SPLIT_FREE_HPP diff --git a/3rdParty/Boost/src/boost/serialization/split_member.hpp b/3rdParty/Boost/src/boost/serialization/split_member.hpp new file mode 100644 index 0000000..6987945 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/split_member.hpp @@ -0,0 +1,86 @@ +#ifndef BOOST_SERIALIZATION_SPLIT_MEMBER_HPP +#define BOOST_SERIALIZATION_SPLIT_MEMBER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// split_member.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 +#include +#include + +#include + +namespace boost { +namespace archive { + namespace detail { + template class interface_oarchive; + template class interface_iarchive; + } // namespace detail +} // namespace archive + +namespace serialization { +namespace detail { + + template + struct member_saver { + static void invoke( + Archive & ar, + const T & t, + const unsigned int file_version + ){ + access::member_save(ar, t, file_version); + } + }; + + template + struct member_loader { + static void invoke( + Archive & ar, + T & t, + const unsigned int file_version + ){ + access::member_load(ar, t, file_version); + } + }; + +} // detail + +template +inline void split_member( + Archive & ar, T & t, const unsigned int file_version +){ + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + BOOST_DEDUCED_TYPENAME Archive::is_saving, + mpl::identity >, + mpl::identity > + >::type typex; + typex::invoke(ar, t, file_version); +} + +} // namespace serialization +} // namespace boost + +// split member function serialize funcition into save/load +#define BOOST_SERIALIZATION_SPLIT_MEMBER() \ +template \ +void serialize( \ + Archive &ar, \ + const unsigned int file_version \ +){ \ + boost::serialization::split_member(ar, *this, file_version); \ +} \ +/**/ + +#endif // BOOST_SERIALIZATION_SPLIT_MEMBER_HPP diff --git a/3rdParty/Boost/src/boost/serialization/state_saver.hpp b/3rdParty/Boost/src/boost/serialization/state_saver.hpp new file mode 100644 index 0000000..69cbe3e --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/state_saver.hpp @@ -0,0 +1,96 @@ +#ifndef BOOST_SERIALIZATION_STATE_SAVER_HPP +#define BOOST_SERIALIZATION_STATE_SAVER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// state_saver.hpp: + +// (C) Copyright 2003-4 Pavel Vozenilek and 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/libs/serialization for updates, documentation, and revision history. + +// Inspired by Daryle Walker's iostate_saver concept. This saves the original +// value of a variable when a state_saver is constructed and restores +// upon destruction. Useful for being sure that state is restored to +// variables upon exit from scope. + + +#include +#ifndef BOOST_NO_EXCEPTIONS + #include +#endif + +#include +#include +#include +#include + +#include +#include + +namespace boost { +namespace serialization { + +template +// T requirements: +// - POD or object semantic (cannot be reference, function, ...) +// - copy constructor +// - operator = (no-throw one preferred) +class state_saver : private boost::noncopyable +{ +private: + const T previous_value; + T & previous_ref; + + struct restore { + static void invoke(T & previous_ref, const T & previous_value){ + previous_ref = previous_value; // won't throw + } + }; + + struct restore_with_exception { + static void invoke(T & previous_ref, const T & previous_value){ + BOOST_TRY{ + previous_ref = previous_value; + } + BOOST_CATCH(::std::exception &) { + // we must ignore it - we are in destructor + } + BOOST_CATCH_END + } + }; + +public: + state_saver( + T & object + ) : + previous_value(object), + previous_ref(object) + {} + + ~state_saver() { + #ifndef BOOST_NO_EXCEPTIONS + typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< + has_nothrow_copy< T >, + mpl::identity, + mpl::identity + >::type typex; + typex::invoke(previous_ref, previous_value); + #else + previous_ref = previous_value; + #endif + } + +}; // state_saver<> + +} // serialization +} // boost + +#endif //BOOST_SERIALIZATION_STATE_SAVER_HPP diff --git a/3rdParty/Boost/src/boost/serialization/static_warning.hpp b/3rdParty/Boost/src/boost/serialization/static_warning.hpp new file mode 100644 index 0000000..b41791a --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/static_warning.hpp @@ -0,0 +1,108 @@ +#ifndef BOOST_SERIALIZATION_STATIC_WARNING_HPP +#define BOOST_SERIALIZATION_STATIC_WARNING_HPP + +// (C) Copyright Robert Ramey 2003. Jonathan Turkanis 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 +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/static_assert for documentation. + +/* + Revision history: + 15 June 2003 - Initial version. + 31 March 2004 - improved diagnostic messages and portability + (Jonathan Turkanis) + 03 April 2004 - works on VC6 at class and namespace scope + - ported to DigitalMars + - static warnings disabled by default; when enabled, + uses pragmas to enable required compiler warnings + on MSVC, Intel, Metrowerks and Borland 5.x. + (Jonathan Turkanis) + 30 May 2004 - tweaked for msvc 7.1 and gcc 3.3 + - static warnings ENabled by default; when enabled, + (Robert Ramey) +*/ + +#include + +// +// Implementation +// Makes use of the following warnings: +// 1. GCC prior to 3.3: division by zero. +// 2. BCC 6.0 preview: unreferenced local variable. +// 3. DigitalMars: returning address of local automatic variable. +// 4. VC6: class previously seen as struct (as in 'boost/mpl/print.hpp') +// 5. All others: deletion of pointer to incomplete type. +// +// The trick is to find code which produces warnings containing the name of +// a structure or variable. Details, with same numbering as above: +// 1. static_warning_impl::value is zero iff B is false, so diving an int +// by this value generates a warning iff B is false. +// 2. static_warning_impl::type has a constructor iff B is true, so an +// unreferenced variable of this type generates a warning iff B is false. +// 3. static_warning_impl::type overloads operator& to return a dynamically +// allocated int pointer only is B is true, so returning the address of an +// automatic variable of this type generates a warning iff B is fasle. +// 4. static_warning_impl::STATIC_WARNING is decalred as a struct iff B is +// false. +// 5. static_warning_impl::type is incomplete iff B is false, so deleting a +// pointer to this type generates a warning iff B is false. +// + +//------------------Enable selected warnings----------------------------------// + +// Enable the warnings relied on by BOOST_STATIC_WARNING, where possible. The +// only pragma which is absolutely necessary here is for Borland 5.x, since +// W8073 is disabled by default. If enabling selected warnings is considered +// unacceptable, this section can be replaced with: +// #if defined(__BORLANDC__) && (__BORLANDC__ <= 0x600) +// pragma warn +st +// #endif + +// 6. replaced implementation with one which depends solely on +// mpl::print<>. The previous one was found to fail for functions +// under recent versions of gcc and intel compilers - Robert Ramey + +#include +#include +#include + +namespace boost { +namespace serialization { + +template +struct BOOST_SERIALIZATION_STATIC_WARNING_LINE{}; + +template +struct static_warning_test{ + typename boost::mpl::eval_if_c< + B, + boost::mpl::true_, + typename boost::mpl::identity< + boost::mpl::print< + BOOST_SERIALIZATION_STATIC_WARNING_LINE + > + > + >::type type; +}; + +template +struct BOOST_SERIALIZATION_SS {}; + +} // serialization +} // boost + +#define BOOST_SERIALIZATION_BSW(B, L) \ + typedef boost::serialization::BOOST_SERIALIZATION_SS< \ + sizeof( boost::serialization::static_warning_test< B, L > ) \ + > BOOST_JOIN(STATIC_WARNING_LINE, L); + +#define BOOST_STATIC_WARNING(B) BOOST_SERIALIZATION_BSW(B, __LINE__) + +#endif // BOOST_SERIALIZATION_STATIC_WARNING_HPP diff --git a/3rdParty/Boost/src/boost/serialization/string.hpp b/3rdParty/Boost/src/boost/serialization/string.hpp new file mode 100644 index 0000000..36d1594 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/string.hpp @@ -0,0 +1,91 @@ +#ifndef BOOST_SERIALIZATION_STRING_HPP +#define BOOST_SERIALIZATION_STRING_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// serialization/string.hpp: +// serialization for stl string templates + +// (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 + +#include +#include + +BOOST_CLASS_IMPLEMENTATION(std::string, boost::serialization::primitive_type) +#ifndef BOOST_NO_STD_WSTRING +BOOST_CLASS_IMPLEMENTATION(std::wstring, boost::serialization::primitive_type) +#endif + +// left over from a previous incarnation - strings are now always primitive types +#if 0 +#include +#include +#include +#include + +namespace boost { +namespace serialization { + +// basic_string - general case +template +inline void save( + Archive & ar, + const std::basic_string &t, + const unsigned int file_version +){ + boost::serialization::stl::save_collection< + Archive, std::basic_string + >(ar, t); +} + +template +inline void load( + Archive & ar, + std::basic_string &t, + const unsigned int file_version +){ + boost::serialization::stl::load_collection< + Archive, + std::basic_string, + boost::serialization::stl::archive_input_seq< + Archive, + std::basic_string + >, + boost::serialization::stl::reserve_imp< + std::basic_string + > + >(ar, t); +} + +// split non-intrusive serialization function member into separate +// non intrusive save/load member functions +template +inline void serialize( + Archive & ar, + std::basic_string & t, + const unsigned int file_version +){ + boost::serialization::split_free(ar, t, file_version); +} + +} // serialization +} // namespace boost + +#include + +BOOST_SERIALIZATION_COLLECTION_TRAITS(std::vector) + +#endif + +#endif // BOOST_SERIALIZATION_STRING_HPP diff --git a/3rdParty/Boost/src/boost/serialization/strong_typedef.hpp b/3rdParty/Boost/src/boost/serialization/strong_typedef.hpp new file mode 100644 index 0000000..c6308c2 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/strong_typedef.hpp @@ -0,0 +1,66 @@ +#ifndef BOOST_SERIALIZATION_STRONG_TYPEDEF_HPP +#define BOOST_SERIALIZATION_STRONG_TYPEDEF_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// strong_typedef.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/libs/serialization for updates, documentation, and revision history. + +// macro used to implement a strong typedef. strong typedef +// guarentees that two types are distinguised even though the +// share the same underlying implementation. typedef does not create +// a new type. BOOST_STRONG_TYPEDEF(T, D) creates a new type named D +// that operates as a type T. + +#include +#include + +#if !defined(__BORLANDC__) || __BORLANDC__ >= 0x590 + #define BOOST_STRONG_TYPEDEF(T, D) \ + struct D \ + : boost::totally_ordered1< D \ + , boost::totally_ordered2< D, T \ + > > \ + { \ + T t; \ + explicit D(const T t_) : t(t_) {}; \ + D(): t() {}; \ + D(const D & t_) : t(t_.t){} \ + D & operator=(const D & rhs) { t = rhs.t; return *this;} \ + D & operator=(const T & rhs) { t = rhs; return *this;} \ + operator const T & () const {return t; } \ + operator T & () { return t; } \ + bool operator==(const D & rhs) const { return t == rhs.t; } \ + bool operator<(const D & rhs) const { return t < rhs.t; } \ + }; +#else + #define BOOST_STRONG_TYPEDEF(T, D) \ + struct D \ + : boost::totally_ordered1< D \ + , boost::totally_ordered2< D, T \ + > > \ + { \ + T t; \ + explicit D(const T t_) : t(t_) {}; \ + D() : t(){}; \ + D(const D & t_) : t(t_.t){} \ + D & operator=(const D & rhs) { t = rhs.t; return *this;} \ + D & operator=(const T & rhs) { t = rhs; return *this;} \ + /*operator const T & () const {return t; }*/ \ + operator T & () { return t; } \ + bool operator==(const D & rhs) const { return t == rhs.t; } \ + bool operator<(const D & rhs) const { return t < rhs.t; } \ + }; +#endif // !defined(__BORLANDC) || __BORLANDC__ >= 0x590 + +#endif // BOOST_SERIALIZATION_STRONG_TYPEDEF_HPP diff --git a/3rdParty/Boost/src/boost/serialization/throw_exception.hpp b/3rdParty/Boost/src/boost/serialization/throw_exception.hpp new file mode 100644 index 0000000..ed7d810 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/throw_exception.hpp @@ -0,0 +1,44 @@ +#ifndef BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED +#define BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// boost/throw_exception.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// +// Distributed under 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) + +#include + +#ifndef BOOST_NO_EXCEPTIONS +#include +#endif + +namespace boost { +namespace serialization { + +#ifdef BOOST_NO_EXCEPTIONS + +inline void throw_exception(std::exception const & e) { + ::boost::throw_exception(e); +} + +#else + +template inline void throw_exception(E const & e){ + throw e; +} + +#endif + +} // namespace serialization +} // namespace boost + +#endif // #ifndef BOOST_SERIALIZATION_THROW_EXCEPTION_HPP_INCLUDED diff --git a/3rdParty/Boost/src/boost/serialization/tracking.hpp b/3rdParty/Boost/src/boost/serialization/tracking.hpp new file mode 100644 index 0000000..fadcbd0 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/tracking.hpp @@ -0,0 +1,118 @@ +#ifndef BOOST_SERIALIZATION_TRACKING_HPP +#define BOOST_SERIALIZATION_TRACKING_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// tracking.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 +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace boost { +namespace serialization { + +struct basic_traits; + +// default tracking level +template +struct tracking_level_impl { + template + struct traits_class_tracking { + typedef BOOST_DEDUCED_TYPENAME U::tracking type; + }; + typedef mpl::integral_c_tag tag; + // note: at least one compiler complained w/o the full qualification + // on basic traits below + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_base_and_derived, + traits_class_tracking< T >, + //else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_pointer< T >, + // pointers are not tracked by default + mpl::int_, + //else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + // for primitives + BOOST_DEDUCED_TYPENAME mpl::equal_to< + implementation_level< T >, + mpl::int_ + >, + // is never + mpl::int_, + // otherwise its selective + mpl::int_ + > > >::type type; + BOOST_STATIC_CONSTANT(int, value = type::value); +}; + +template +struct tracking_level : + public tracking_level_impl +{ +}; + +template +inline bool operator>=(tracking_level< T > t, enum tracking_type l) +{ + return t.value >= (int)l; +} + +} // namespace serialization +} // namespace boost + + +// The STATIC_ASSERT is prevents one from setting tracking for a primitive type. +// This almost HAS to be an error. Doing this will effect serialization of all +// char's in your program which is almost certainly what you don't want to do. +// If you want to track all instances of a given primitive type, You'll have to +// wrap it in your own type so its not a primitive anymore. Then it will compile +// without problem. +#define BOOST_CLASS_TRACKING(T, E) \ +namespace boost { \ +namespace serialization { \ +template<> \ +struct tracking_level< T > \ +{ \ + typedef mpl::integral_c_tag tag; \ + typedef mpl::int_< E> type; \ + BOOST_STATIC_CONSTANT( \ + int, \ + value = tracking_level::type::value \ + ); \ + /* tracking for a class */ \ + BOOST_STATIC_ASSERT(( \ + mpl::greater< \ + /* that is a prmitive */ \ + implementation_level< T >, \ + mpl::int_ \ + >::value \ + )); \ +}; \ +}} + +#endif // BOOST_SERIALIZATION_TRACKING_HPP diff --git a/3rdParty/Boost/src/boost/serialization/tracking_enum.hpp b/3rdParty/Boost/src/boost/serialization/tracking_enum.hpp new file mode 100644 index 0000000..e4e4e21 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/tracking_enum.hpp @@ -0,0 +1,41 @@ +#ifndef BOOST_SERIALIZATION_TRACKING_ENUM_HPP +#define BOOST_SERIALIZATION_TRACKING_ENUM_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// tracking_enum.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. + +namespace boost { +namespace serialization { + +// addresses of serialized objects may be tracked to avoid saving/loading +// redundant copies. This header defines a class trait that can be used +// to specify when objects should be tracked + +// names for each tracking level +enum tracking_type +{ + // never track this type + track_never = 0, + // track objects of this type if the object is serialized through a + // pointer. + track_selectively = 1, + // always track this type + track_always = 2 +}; + +} // namespace serialization +} // namespace boost + +#endif // BOOST_SERIALIZATION_TRACKING_ENUM_HPP diff --git a/3rdParty/Boost/src/boost/serialization/traits.hpp b/3rdParty/Boost/src/boost/serialization/traits.hpp new file mode 100644 index 0000000..da80009 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/traits.hpp @@ -0,0 +1,65 @@ +#ifndef BOOST_SERIALIZATION_TRAITS_HPP +#define BOOST_SERIALIZATION_TRAITS_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// traits.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. + +// This header is used to apply serialization traits to templates. The +// standard system can't be used for platforms which don't support +// Partial Templlate Specialization. + +// The motivation for this is the Name-Value Pair (NVP) template. +// it has to work the same on all platforms in order for archives +// to be portable accross platforms. + +#include +#include + +#include +#include +#include +#include + +namespace boost { +namespace serialization { + +// common base class used to detect appended traits class +struct basic_traits {}; + +template +struct extended_type_info_impl; + +template< + class T, + int Level, + int Tracking, + unsigned int Version = 0, + class ETII = extended_type_info_impl< T >, + class Wrapper = mpl::false_ +> +struct traits : public basic_traits { + BOOST_STATIC_ASSERT(Version == 0 || Level >= object_class_info); + BOOST_STATIC_ASSERT(Tracking == track_never || Level >= object_serializable); + typedef BOOST_DEDUCED_TYPENAME mpl::int_ level; + typedef BOOST_DEDUCED_TYPENAME mpl::int_ tracking; + typedef BOOST_DEDUCED_TYPENAME mpl::int_ version; + typedef ETII type_info_implementation; + typedef Wrapper is_wrapper; +}; + +} // namespace serialization +} // namespace boost + +#endif // BOOST_SERIALIZATION_TRAITS_HPP diff --git a/3rdParty/Boost/src/boost/serialization/type_info_implementation.hpp b/3rdParty/Boost/src/boost/serialization/type_info_implementation.hpp new file mode 100644 index 0000000..00eb152 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/type_info_implementation.hpp @@ -0,0 +1,86 @@ +#ifndef BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP +#define BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// type_info_implementation.hpp: interface for portable version of type_info + +// (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 +#include + +#include +#include +#include +#include +#include + +namespace boost { +namespace serialization { + +// note that T and const T are folded into const T so that +// there is only one table entry per type +template +struct type_info_implementation { + template + struct traits_class_typeinfo_implementation { + typedef BOOST_DEDUCED_TYPENAME U::type_info_implementation::type type; + }; + // note: at least one compiler complained w/o the full qualification + // on basic traits below + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_base_and_derived, + traits_class_typeinfo_implementation< T >, + //else + mpl::identity< + BOOST_DEDUCED_TYPENAME extended_type_info_impl< T >::type + > + >::type type; +}; + +} // namespace serialization +} // namespace boost + +// define a macro to assign a particular derivation of extended_type_info +// to a specified a class. +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) +#define BOOST_CLASS_TYPE_INFO(T, ETI) \ +namespace boost { \ +namespace serialization { \ +template<> \ +struct type_info_implementation< T > { \ + typedef const ETI type; \ +}; \ +} \ +} \ +/**/ +#else +#define BOOST_CLASS_TYPE_INFO(T, ETI) \ +namespace boost { \ +namespace serialization { \ +template<> \ +struct type_info_implementation< T > { \ + typedef ETI type; \ +}; \ +template<> \ +struct type_info_implementation< const T > { \ + typedef ETI type; \ +}; \ +} \ +} \ +/**/ +#endif + +#endif /// BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP diff --git a/3rdParty/Boost/src/boost/serialization/vector.hpp b/3rdParty/Boost/src/boost/serialization/vector.hpp new file mode 100644 index 0000000..7520c09 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/vector.hpp @@ -0,0 +1,220 @@ +#ifndef BOOST_SERIALIZATION_VECTOR_HPP +#define BOOST_SERIALIZATION_VECTOR_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// vector.hpp: serialization for stl vector templates + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// fast array serialization (C) Copyright 2005 Matthias Troyer +// 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 + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// default is being compatible with version 1.34.1 files, not 1.35 files +#ifndef BOOST_SERIALIZATION_VECTOR_VERSIONED +#define BOOST_SERIALIZATION_VECTOR_VERSIONED(V) (V==4 || V==5) +#endif + +// function specializations must be defined in the appropriate +// namespace - boost::serialization +#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +#define STD _STLP_STD +#else +#define STD std +#endif + +namespace boost { +namespace serialization { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// vector< T > + +// the default versions + +template +inline void save( + Archive & ar, + const std::vector &t, + const unsigned int /* file_version */, + mpl::false_ +){ + boost::serialization::stl::save_collection >( + ar, t + ); +} + +template +inline void load( + Archive & ar, + std::vector &t, + const unsigned int /* file_version */, + mpl::false_ +){ + boost::serialization::stl::load_collection< + Archive, + std::vector, + boost::serialization::stl::archive_input_seq< + Archive, STD::vector + >, + boost::serialization::stl::reserve_imp > + >(ar, t); +} + +// the optimized versions + +template +inline void save( + Archive & ar, + const std::vector &t, + const unsigned int /* file_version */, + mpl::true_ +){ + const collection_size_type count(t.size()); + ar << BOOST_SERIALIZATION_NVP(count); + if (!t.empty()) + ar << make_array(detail::get_data(t),t.size()); +} + +template +inline void load( + Archive & ar, + std::vector &t, + const unsigned int /* file_version */, + mpl::true_ +){ + collection_size_type count(t.size()); + ar >> BOOST_SERIALIZATION_NVP(count); + t.resize(count); + unsigned int item_version=0; + if(BOOST_SERIALIZATION_VECTOR_VERSIONED(ar.get_library_version())) { + ar >> BOOST_SERIALIZATION_NVP(item_version); + } + if (!t.empty()) + ar >> make_array(detail::get_data(t),t.size()); + } + +// dispatch to either default or optimized versions + +template +inline void save( + Archive & ar, + const std::vector &t, + const unsigned int file_version +){ + typedef BOOST_DEDUCED_TYPENAME + boost::serialization::use_array_optimization::template apply< + BOOST_DEDUCED_TYPENAME remove_const::type + >::type use_optimized; + save(ar,t,file_version, use_optimized()); +} + +template +inline void load( + Archive & ar, + std::vector &t, + const unsigned int file_version +){ +#ifdef BOOST_SERIALIZATION_VECTOR_135_HPP + if (ar.get_library_version()==boost::archive::library_version_type(5)) + { + load(ar,t,file_version, boost::is_arithmetic()); + return; + } +#endif + typedef BOOST_DEDUCED_TYPENAME + boost::serialization::use_array_optimization::template apply< + BOOST_DEDUCED_TYPENAME remove_const::type + >::type use_optimized; + load(ar,t,file_version, use_optimized()); +} + +// split non-intrusive serialization function member into separate +// non intrusive save/load member functions +template +inline void serialize( + Archive & ar, + std::vector & t, + const unsigned int file_version +){ + boost::serialization::split_free(ar, t, file_version); +} + +#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// vector +template +inline void save( + Archive & ar, + const std::vector &t, + const unsigned int /* file_version */ +){ + // record number of elements + collection_size_type count (t.size()); + ar << BOOST_SERIALIZATION_NVP(count); + std::vector::const_iterator it = t.begin(); + while(count-- > 0){ + bool tb = *it++; + ar << boost::serialization::make_nvp("item", tb); + } +} + +template +inline void load( + Archive & ar, + std::vector &t, + const unsigned int /* file_version */ +){ + // retrieve number of elements + collection_size_type count; + ar >> BOOST_SERIALIZATION_NVP(count); + t.clear(); + while(count-- > 0){ + bool i; + ar >> boost::serialization::make_nvp("item", i); + t.push_back(i); + } +} + +// split non-intrusive serialization function member into separate +// non intrusive save/load member functions +template +inline void serialize( + Archive & ar, + std::vector & t, + const unsigned int file_version +){ + boost::serialization::split_free(ar, t, file_version); +} + +#endif // BOOST_WORKAROUND + +} // serialization +} // namespace boost + +#include + +BOOST_SERIALIZATION_COLLECTION_TRAITS(std::vector) +#undef STD + +#endif // BOOST_SERIALIZATION_VECTOR_HPP diff --git a/3rdParty/Boost/src/boost/serialization/version.hpp b/3rdParty/Boost/src/boost/serialization/version.hpp new file mode 100644 index 0000000..ef3dff2 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/version.hpp @@ -0,0 +1,107 @@ +#ifndef BOOST_SERIALIZATION_VERSION_HPP +#define BOOST_SERIALIZATION_VERSION_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// version.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 +#include +#include +#include +#include +#include + +#include + +namespace boost { +namespace serialization { + +struct basic_traits; + +// default version number is 0. Override with higher version +// when class definition changes. +template +struct version +{ + template + struct traits_class_version { + typedef BOOST_DEDUCED_TYPENAME U::version type; + }; + + typedef mpl::integral_c_tag tag; + // note: at least one compiler complained w/o the full qualification + // on basic traits below + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if< + is_base_and_derived, + traits_class_version< T >, + mpl::int_<0> + >::type type; + BOOST_STATIC_CONSTANT(int, value = version::type::value); +}; + +#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +template +const int version::value; +#endif + +} // namespace serialization +} // namespace boost + +/* note: at first it seemed that this would be a good place to trap + * as an error an attempt to set a version # for a class which doesn't + * save its class information (including version #) in the archive. + * However, this imposes a requirement that the version be set after + * the implemention level which would be pretty confusing. If this + * is to be done, do this check in the input or output operators when + * ALL the serialization traits are available. Included the implementation + * here with this comment as a reminder not to do this! + */ +//#include +//#include + +#include +#include + +// specify the current version number for the class +// version numbers limited to 8 bits !!! +#define BOOST_CLASS_VERSION(T, N) \ +namespace boost { \ +namespace serialization { \ +template<> \ +struct version \ +{ \ + typedef mpl::int_ type; \ + typedef mpl::integral_c_tag tag; \ + BOOST_STATIC_CONSTANT(int, value = version::type::value); \ + BOOST_MPL_ASSERT(( \ + boost::mpl::less< \ + boost::mpl::int_, \ + boost::mpl::int_<256> \ + > \ + )); \ + /* \ + BOOST_MPL_ASSERT(( \ + mpl::equal_to< \ + :implementation_level, \ + mpl::int_ \ + >::value \ + )); \ + */ \ +}; \ +} \ +} + +#endif // BOOST_SERIALIZATION_VERSION_HPP diff --git a/3rdParty/Boost/src/boost/serialization/void_cast.hpp b/3rdParty/Boost/src/boost/serialization/void_cast.hpp new file mode 100644 index 0000000..b5b1e85 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/void_cast.hpp @@ -0,0 +1,298 @@ +#ifndef BOOST_SERIALIZATION_VOID_CAST_HPP +#define BOOST_SERIALIZATION_VOID_CAST_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// void_cast.hpp: interface for run-time casting of void pointers. + +// (C) Copyright 2002-2009 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) +// gennadiy.rozental@tfn.com + +// See http://www.boost.org for updates, documentation, and revision history. + +#include // for ptrdiff_t +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275) +#endif + +namespace boost { +namespace serialization { + +class extended_type_info; + +// Given a void *, assume that it really points to an instance of one type +// and alter it so that it would point to an instance of a related type. +// Return the altered pointer. If there exists no sequence of casts that +// can transform from_type to to_type, return a NULL. + +BOOST_SERIALIZATION_DECL(void const *) +void_upcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const t +); + +inline void * +void_upcast( + extended_type_info const & derived, + extended_type_info const & base, + void * const t +){ + return const_cast(void_upcast( + derived, + base, + const_cast(t) + )); +} + +BOOST_SERIALIZATION_DECL(void const *) +void_downcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const t +); + +inline void * +void_downcast( + extended_type_info const & derived, + extended_type_info const & base, + void * const t +){ + return const_cast(void_downcast( + derived, + base, + const_cast(t) + )); +} + +namespace void_cast_detail { + +class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) void_caster : + private boost::noncopyable +{ + friend + BOOST_SERIALIZATION_DECL(void const *) + boost::serialization::void_upcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const + ); + friend + BOOST_SERIALIZATION_DECL(void const *) + boost::serialization::void_downcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const + ); +protected: + void recursive_register(bool includes_virtual_base = false) const; + void recursive_unregister() const; + virtual bool has_virtual_base() const = 0; +public: + // Data members + const extended_type_info * m_derived; + const extended_type_info * m_base; + /*const*/ std::ptrdiff_t m_difference; + void_caster const * const m_parent; + + // note that void_casters are keyed on value of + // member extended type info records - NOT their + // addresses. This is necessary in order for the + // void cast operations to work across dll and exe + // module boundries. + bool operator<(const void_caster & rhs) const; + + const void_caster & operator*(){ + return *this; + } + // each derived class must re-implement these; + virtual void const * upcast(void const * const t) const = 0; + virtual void const * downcast(void const * const t) const = 0; + // Constructor + void_caster( + extended_type_info const * derived, + extended_type_info const * base, + std::ptrdiff_t difference = 0, + void_caster const * const parent = 0 + ) : + m_derived(derived), + m_base(base), + m_difference(difference), + m_parent(parent) + {} + virtual ~void_caster(){} +}; + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275 4511 4512) +#endif + +template +class void_caster_primitive : + public void_caster +{ + virtual void const * downcast(void const * const t) const { + const Derived * d = + boost::serialization::smart_cast( + static_cast(t) + ); + return d; + } + virtual void const * upcast(void const * const t) const { + const Base * b = + boost::serialization::smart_cast( + static_cast(t) + ); + return b; + } + virtual bool has_virtual_base() const { + return false; + } +public: + void_caster_primitive(); + virtual ~void_caster_primitive(); +}; + +template +void_caster_primitive::void_caster_primitive() : + void_caster( + & type_info_implementation::type::get_const_instance(), + & type_info_implementation::type::get_const_instance(), + // note:I wanted to display from 0 here, but at least one compiler + // treated 0 by not shifting it at all. + reinterpret_cast( + static_cast( + reinterpret_cast(1) + ) + ) - 1 + ) +{ + recursive_register(); +} + +template +void_caster_primitive::~void_caster_primitive(){ + recursive_unregister(); +} + +template +class void_caster_virtual_base : + public void_caster +{ + virtual bool has_virtual_base() const { + return true; + } +public: + virtual void const * downcast(void const * const t) const { + const Derived * d = + dynamic_cast( + static_cast(t) + ); + return d; + } + virtual void const * upcast(void const * const t) const { + const Base * b = + dynamic_cast( + static_cast(t) + ); + return b; + } + void_caster_virtual_base(); + virtual ~void_caster_virtual_base(); +}; + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +template +void_caster_virtual_base::void_caster_virtual_base() : + void_caster( + & (type_info_implementation::type::get_const_instance()), + & (type_info_implementation::type::get_const_instance()) + ) +{ + recursive_register(true); +} + +template +void_caster_virtual_base::~void_caster_virtual_base(){ + recursive_unregister(); +} + +template +struct void_caster_base : + public void_caster +{ + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity< + void_cast_detail::void_caster_virtual_base + > + ,// else + mpl::identity< + void_cast_detail::void_caster_primitive + > + >::type type; +}; + +} // void_cast_detail + +template +BOOST_DLLEXPORT +inline const void_cast_detail::void_caster & void_cast_register( + Derived const * /* dnull = NULL */, + Base const * /* bnull = NULL */ +){ + typedef + BOOST_DEDUCED_TYPENAME mpl::eval_if, + mpl::identity< + void_cast_detail::void_caster_virtual_base + > + ,// else + mpl::identity< + void_cast_detail::void_caster_primitive + > + >::type typex; + return singleton::get_const_instance(); +} + +template +class void_caster : + public void_cast_detail::void_caster_base::type +{ +}; + +} // namespace serialization +} // namespace boost + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + +#endif // BOOST_SERIALIZATION_VOID_CAST_HPP diff --git a/3rdParty/Boost/src/boost/serialization/void_cast_fwd.hpp b/3rdParty/Boost/src/boost/serialization/void_cast_fwd.hpp new file mode 100644 index 0000000..c94adb2 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/void_cast_fwd.hpp @@ -0,0 +1,37 @@ +#ifndef BOOST_SERIALIZATION_VOID_CAST_FWD_HPP +#define BOOST_SERIALIZATION_VOID_CAST_FWD_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// void_cast_fwd.hpp: interface for run-time casting of void pointers. + +// (C) Copyright 2005 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) +// gennadiy.rozental@tfn.com + +// See http://www.boost.org for updates, documentation, and revision history. + +#include // NULL +#include + +namespace boost { +namespace serialization { +namespace void_cast_detail{ +class void_caster; +} // namespace void_cast_detail +template +BOOST_DLLEXPORT +inline const void_cast_detail::void_caster & void_cast_register( + const Derived * dnull = NULL, + const Base * bnull = NULL +) BOOST_USED; +} // namespace serialization +} // namespace boost + +#endif // BOOST_SERIALIZATION_VOID_CAST_HPP diff --git a/3rdParty/Boost/src/boost/serialization/wrapper.hpp b/3rdParty/Boost/src/boost/serialization/wrapper.hpp new file mode 100644 index 0000000..eeb4333 --- /dev/null +++ b/3rdParty/Boost/src/boost/serialization/wrapper.hpp @@ -0,0 +1,60 @@ +#ifndef BOOST_SERIALIZATION_WRAPPER_HPP +#define BOOST_SERIALIZATION_WRAPPER_HPP + +// (C) Copyright 2005-2006 Matthias Troyer +// 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) + +#include +#include +#include +#include + +namespace boost { namespace serialization { + +/// the base class for serialization wrappers +/// +/// wrappers need to be treated differently at various places in the serialization library, +/// e.g. saving of non-const wrappers has to be possible. Since partial specialization +// is not supported by all compilers, we derive all wrappers from wrapper_traits. + +template< + class T, + int Level = object_serializable, + int Tracking = track_never, + unsigned int Version = 0, + class ETII = extended_type_info_impl< T > +> +struct wrapper_traits : + public traits +{}; + +template +struct is_wrapper_impl : + boost::mpl::eval_if< + boost::is_base_and_derived, + boost::mpl::true_, + boost::mpl::false_ + >::type +{}; + +template +struct is_wrapper { + typedef BOOST_DEDUCED_TYPENAME is_wrapper_impl::type type; +}; + +} // serialization +} // boost + +// A macro to define that a class is a wrapper +#define BOOST_CLASS_IS_WRAPPER(T) \ +namespace boost { \ +namespace serialization { \ +template<> \ +struct is_wrapper_impl : boost::mpl::true_ {}; \ +} \ +} \ +/**/ + +#endif //BOOST_SERIALIZATION_WRAPPER_HPP diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/assert.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/assert.hpp new file mode 100644 index 0000000..47b1b39 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/assert.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2002-2003 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_ASSERT_HPP) +#define BOOST_SPIRIT_ASSERT_HPP + +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +// +// BOOST_SPIRIT_ASSERT is used throughout the framework. It can be +// overridden by the user. If BOOST_SPIRIT_ASSERT_EXCEPTION is defined, +// then that will be thrown, otherwise, BOOST_SPIRIT_ASSERT simply turns +// into a plain BOOST_ASSERT() +// +/////////////////////////////////////////////////////////////////////////////// +#if !defined(BOOST_SPIRIT_ASSERT) +#if defined(NDEBUG) + #define BOOST_SPIRIT_ASSERT(x) +#elif defined (BOOST_SPIRIT_ASSERT_EXCEPTION) + #define BOOST_SPIRIT_ASSERT_AUX(f, l, x) BOOST_SPIRIT_ASSERT_AUX2(f, l, x) + #define BOOST_SPIRIT_ASSERT_AUX2(f, l, x) \ + do{ if (!(x)) boost::throw_exception( \ + BOOST_SPIRIT_ASSERT_EXCEPTION(f "(" #l "): " #x)); } while(0) + #define BOOST_SPIRIT_ASSERT(x) BOOST_SPIRIT_ASSERT_AUX(__FILE__, __LINE__, x) +#else + #include + #define BOOST_SPIRIT_ASSERT(x) BOOST_ASSERT(x) +#endif +#endif // !defined(BOOST_SPIRIT_ASSERT) + +#endif // BOOST_SPIRIT_ASSERT_HPP diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/actions.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/actions.hpp new file mode 100644 index 0000000..864211f --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/actions.hpp @@ -0,0 +1,136 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_ACTIONS_HPP +#define BOOST_SPIRIT_ACTIONS_HPP + +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + + /////////////////////////////////////////////////////////////////////////// + // + // action class + // + // The action class binds a parser with a user defined semantic + // action. Instances of action are never created manually. Instead, + // action objects are typically created indirectly through + // expression templates of the form: + // + // p[f] + // + // where p is a parser and f is a function or functor. The semantic + // action may be a function or a functor. When the parser is + // successful, the actor calls the scanner's action_policy policy + // (see scanner.hpp): + // + // scan.do_action(actor, attribute, first, last); + // + // passing in these information: + // + // actor: The action's function or functor + // attribute: The match (returned by the parser) object's + // attribute (see match.hpp) + // first: Iterator pointing to the start of the matching + // portion of the input + // last: Iterator pointing to one past the end of the + // matching portion of the input + // + // It is the responsibility of the scanner's action_policy policy to + // dispatch the function or functor as it sees fit. The expected + // function or functor signature depends on the parser being + // wrapped. In general, if the attribute type of the parser being + // wrapped is a nil_t, the function or functor expect the signature: + // + // void func(Iterator first, Iterator last); // functions + // + // struct ftor // functors + // { + // void func(Iterator first, Iterator last) const; + // }; + // + // where Iterator is the type of the iterator that is being used and + // first and last are the iterators pointing to the matching portion + // of the input. + // + // If the attribute type of the parser being wrapped is not a nil_t, + // the function or functor usually expect the signature: + // + // void func(T val); // functions + // + // struct ftor // functors + // { + // void func(T val) const; + // }; + // + // where T is the attribute type and val is the attribute value + // returned by the parser being wrapped. + // + /////////////////////////////////////////////////////////////////////////// + template + class action : public unary > > + { + public: + + typedef action self_t; + typedef action_parser_category parser_category_t; + typedef unary > base_t; + typedef ActionT predicate_t; + + template + struct result + { + typedef typename parser_result::type type; + }; + + action(ParserT const& p, ActionT const& a) + : base_t(p) + , actor(a) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename ScannerT::iterator_t iterator_t; + typedef typename parser_result::type result_t; + + scan.at_end(); // allow skipper to take effect + iterator_t save = scan.first; + result_t hit = this->subject().parse(scan); + if (hit) + { + typename result_t::return_t val = hit.value(); + scan.do_action(actor, val, save, scan.first); + } + return hit; + } + + ActionT const& predicate() const { return actor; } + + private: + + ActionT actor; + }; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/alternative.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/alternative.hpp new file mode 100644 index 0000000..5e472a9 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/alternative.hpp @@ -0,0 +1,147 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_ALTERNATIVE_HPP) +#define BOOST_SPIRIT_ALTERNATIVE_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // alternative class + // + // Handles expressions of the form: + // + // a | b + // + // where a and b are parsers. The expression returns a composite + // parser that matches a or b. One (not both) of the operands may + // be a literal char, wchar_t or a primitive string char const*, + // wchar_t const*. + // + // The expression is short circuit evaluated. b is never touched + // when a is returns a successful match. + // + /////////////////////////////////////////////////////////////////////////// + struct alternative_parser_gen; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + + template + struct alternative + : public binary > > + { + typedef alternative self_t; + typedef binary_parser_category parser_category_t; + typedef alternative_parser_gen parser_generator_t; + typedef binary > base_t; + + alternative(A const& a, B const& b) + : base_t(a, b) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typedef typename ScannerT::iterator_t iterator_t; + { // scope for save + iterator_t save = scan.first; + if (result_t hit = this->left().parse(scan)) + return hit; + scan.first = save; + } + return this->right().parse(scan); + } + }; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + + struct alternative_parser_gen + { + template + struct result + { + typedef + alternative< + typename as_parser::type + , typename as_parser::type + > + type; + }; + + template + static alternative< + typename as_parser::type + , typename as_parser::type + > + generate(A const& a, B const& b) + { + return alternative::type, + BOOST_DEDUCED_TYPENAME as_parser::type> + (as_parser::convert(a), as_parser::convert(b)); + } + }; + + template + alternative + operator|(parser const& a, parser const& b); + + template + alternative > + operator|(parser const& a, char b); + + template + alternative, B> + operator|(char a, parser const& b); + + template + alternative > + operator|(parser const& a, char const* b); + + template + alternative, B> + operator|(char const* a, parser const& b); + + template + alternative > + operator|(parser const& a, wchar_t b); + + template + alternative, B> + operator|(wchar_t a, parser const& b); + + template + alternative > + operator|(parser const& a, wchar_t const* b); + + template + alternative, B> + operator|(wchar_t const* a, parser const& b); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/composite.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/composite.hpp new file mode 100644 index 0000000..b156cab --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/composite.hpp @@ -0,0 +1,151 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_COMPOSITE_HPP) +#define BOOST_SPIRIT_COMPOSITE_HPP + +/////////////////////////////////////////////////////////////////////////////// +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + + /////////////////////////////////////////////////////////////////////////// + // + // unary class. + // + // Composite class composed of a single subject. This template class + // is parameterized by the subject type S and a base class to + // inherit from, BaseT. The unary class is meant to be a base class + // to inherit from. The inheritance structure, given the BaseT + // template parameter places the unary class in the middle of a + // linear, single parent hierarchy. For instance, given a class S + // and a base class B, a class D can derive from unary: + // + // struct D : public unary {...}; + // + // The inheritance structure is thus: + // + // B + // | + // unary (has S) + // | + // D + // + // The subject can be accessed from the derived class D as: + // this->subject(); + // + // Typically, the subject S is specified as typename S::embed_t. + // embed_t specifies how the subject is embedded in the composite + // (See parser.hpp for details). + // + /////////////////////////////////////////////////////////////////////////// + template + class unary : public BaseT + { + public: + + typedef BaseT base_t; + typedef typename boost::call_traits::param_type param_t; + typedef typename boost::call_traits::const_reference return_t; + typedef S subject_t; + typedef typename S::embed_t subject_embed_t; + + unary(param_t subj_) + : base_t(), subj(subj_) {} + + unary(BaseT const& base, param_t subj_) + : base_t(base), subj(subj_) {} + + return_t + subject() const + { return subj; } + + private: + + subject_embed_t subj; + }; + + /////////////////////////////////////////////////////////////////////////// + // + // binary class. + // + // Composite class composed of a pair (left and right). This + // template class is parameterized by the left and right subject + // types A and B and a base class to inherit from, BaseT. The binary + // class is meant to be a base class to inherit from. The + // inheritance structure, given the BaseT template parameter places + // the binary class in the middle of a linear, single parent + // hierarchy. For instance, given classes X and Y and a base class + // B, a class D can derive from binary: + // + // struct D : public binary {...}; + // + // The inheritance structure is thus: + // + // B + // | + // binary (has X and Y) + // | + // D + // + // The left and right subjects can be accessed from the derived + // class D as: this->left(); and this->right(); + // + // Typically, the pairs X and Y are specified as typename X::embed_t + // and typename Y::embed_t. embed_t specifies how the subject is + // embedded in the composite (See parser.hpp for details). + // + /////////////////////////////////////////////////////////////////////////////// + template + class binary : public BaseT + { + public: + + typedef BaseT base_t; + typedef typename boost::call_traits::param_type left_param_t; + typedef typename boost::call_traits::const_reference left_return_t; + typedef typename boost::call_traits::param_type right_param_t; + typedef typename boost::call_traits::const_reference right_return_t; + typedef A left_t; + typedef typename A::embed_t left_embed_t; + typedef B right_t; + typedef typename B::embed_t right_embed_t; + + binary(left_param_t a, right_param_t b) + : base_t(), subj(a, b) {} + + left_return_t + left() const + { return subj.first(); } + + right_return_t + right() const + { return subj.second(); } + + private: + + boost::compressed_pair subj; + }; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/difference.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/difference.hpp new file mode 100644 index 0000000..7d1cb14 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/difference.hpp @@ -0,0 +1,150 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_DIFFERENCE_HPP) +#define BOOST_SPIRIT_DIFFERENCE_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // difference: a - b; Matches a but not b + // + // Handles expressions of the form: + // + // a - b + // + // where a and b are parsers. The expression returns a composite + // parser that matches a but not b. One (not both) of the operands + // may be a literal char, wchar_t or a primitive string char const*, + // wchar_t const*. + // + /////////////////////////////////////////////////////////////////////////// + struct difference_parser_gen; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + + template + struct difference + : public binary > > + { + typedef difference self_t; + typedef binary_parser_category parser_category_t; + typedef difference_parser_gen parser_generator_t; + typedef binary > base_t; + + difference(A const& a, B const& b) + : base_t(a, b) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typedef typename ScannerT::iterator_t iterator_t; + iterator_t save = scan.first; + if (result_t hl = this->left().parse(scan)) + { + std::swap(save, scan.first); + result_t hr = this->right().parse(scan); + if (!hr || (hr.length() < hl.length())) + { + scan.first = save; + return hl; + } + } + + return scan.no_match(); + } + }; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + + struct difference_parser_gen + { + template + struct result + { + typedef + difference< + typename as_parser::type + , typename as_parser::type + > + type; + }; + + template + static difference< + typename as_parser::type + , typename as_parser::type + > + generate(A const& a, B const& b) + { + return difference::type, + BOOST_DEDUCED_TYPENAME as_parser::type> + (as_parser::convert(a), as_parser::convert(b)); + } + }; + + template + difference + operator-(parser const& a, parser const& b); + + template + difference > + operator-(parser const& a, char b); + + template + difference, B> + operator-(char a, parser const& b); + + template + difference > + operator-(parser const& a, char const* b); + + template + difference, B> + operator-(char const* a, parser const& b); + + template + difference > + operator-(parser const& a, wchar_t b); + + template + difference, B> + operator-(wchar_t a, parser const& b); + + template + difference > + operator-(parser const& a, wchar_t const* b); + + template + difference, B> + operator-(wchar_t const* a, parser const& b); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/directives.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/directives.hpp new file mode 100644 index 0000000..a66efa2 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/directives.hpp @@ -0,0 +1,607 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_DIRECTIVES_HPP) +#define BOOST_SPIRIT_DIRECTIVES_HPP + +/////////////////////////////////////////////////////////////////////////////// +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // contiguous class + // + /////////////////////////////////////////////////////////////////////////// + struct lexeme_parser_gen; + + template + struct contiguous + : public unary > > + { + typedef contiguous self_t; + typedef unary_parser_category parser_category_t; + typedef lexeme_parser_gen parser_generator_t; + typedef unary > base_t; + + template + struct result + { + typedef typename parser_result::type type; + }; + + contiguous(ParserT const& p) + : base_t(p) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + return impl::contiguous_parser_parse + (this->subject(), scan, scan); + } + }; + + struct lexeme_parser_gen + { + template + struct result { + + typedef contiguous type; + }; + + template + static contiguous + generate(parser const& subject) + { + return contiguous(subject.derived()); + } + + template + contiguous + operator[](parser const& subject) const + { + return contiguous(subject.derived()); + } + }; + + ////////////////////////////////// + const lexeme_parser_gen lexeme_d = lexeme_parser_gen(); + + /////////////////////////////////////////////////////////////////////////// + // + // lexeme_scanner + // + // Given a Scanner, return the correct scanner type that + // the lexeme_d uses. Scanner is assumed to be a phrase + // level scanner (see skipper.hpp) + // + /////////////////////////////////////////////////////////////////////////// + template + struct lexeme_scanner + { + typedef scanner_policies< + no_skipper_iteration_policy< + typename ScannerT::iteration_policy_t>, + typename ScannerT::match_policy_t, + typename ScannerT::action_policy_t + > policies_t; + + typedef typename + rebind_scanner_policies::type type; + }; + + /////////////////////////////////////////////////////////////////////////// + // + // inhibit_case_iteration_policy class + // + /////////////////////////////////////////////////////////////////////////// + template + struct inhibit_case_iteration_policy : public BaseT + { + typedef BaseT base_t; + + inhibit_case_iteration_policy() + : BaseT() {} + + template + inhibit_case_iteration_policy(PolicyT const& other) + : BaseT(other) {} + + template + CharT filter(CharT ch) const + { return impl::tolower_(ch); } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // inhibit_case class + // + /////////////////////////////////////////////////////////////////////////// + struct inhibit_case_parser_gen; + + template + struct inhibit_case + : public unary > > + { + typedef inhibit_case self_t; + typedef unary_parser_category parser_category_t; + typedef inhibit_case_parser_gen parser_generator_t; + typedef unary > base_t; + + template + struct result + { + typedef typename parser_result::type type; + }; + + inhibit_case(ParserT const& p) + : base_t(p) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + return impl::inhibit_case_parser_parse + (this->subject(), scan, scan); + } + }; + + template + struct inhibit_case_parser_gen_base + { + // This hack is needed to make borland happy. + // If these member operators were defined in the + // inhibit_case_parser_gen class, or if this class + // is non-templated, borland ICEs. + + static inhibit_case > + generate(char const* str) + { return inhibit_case >(str); } + + static inhibit_case > + generate(wchar_t const* str) + { return inhibit_case >(str); } + + static inhibit_case > + generate(char ch) + { return inhibit_case >(ch); } + + static inhibit_case > + generate(wchar_t ch) + { return inhibit_case >(ch); } + + template + static inhibit_case + generate(parser const& subject) + { return inhibit_case(subject.derived()); } + + inhibit_case > + operator[](char const* str) const + { return inhibit_case >(str); } + + inhibit_case > + operator[](wchar_t const* str) const + { return inhibit_case >(str); } + + inhibit_case > + operator[](char ch) const + { return inhibit_case >(ch); } + + inhibit_case > + operator[](wchar_t ch) const + { return inhibit_case >(ch); } + + template + inhibit_case + operator[](parser const& subject) const + { return inhibit_case(subject.derived()); } + }; + + ////////////////////////////////// + struct inhibit_case_parser_gen : public inhibit_case_parser_gen_base<0> + { + inhibit_case_parser_gen() {} + }; + + ////////////////////////////////// + // Depracated + const inhibit_case_parser_gen nocase_d = inhibit_case_parser_gen(); + + // Preferred syntax + const inhibit_case_parser_gen as_lower_d = inhibit_case_parser_gen(); + + /////////////////////////////////////////////////////////////////////////// + // + // as_lower_scanner + // + // Given a Scanner, return the correct scanner type that + // the as_lower_d uses. Scanner is assumed to be a scanner + // with an inhibit_case_iteration_policy. + // + /////////////////////////////////////////////////////////////////////////// + template + struct as_lower_scanner + { + typedef scanner_policies< + inhibit_case_iteration_policy< + typename ScannerT::iteration_policy_t>, + typename ScannerT::match_policy_t, + typename ScannerT::action_policy_t + > policies_t; + + typedef typename + rebind_scanner_policies::type type; + }; + + /////////////////////////////////////////////////////////////////////////// + // + // longest_alternative class + // + /////////////////////////////////////////////////////////////////////////// + struct longest_parser_gen; + + template + struct longest_alternative + : public binary > > + { + typedef longest_alternative self_t; + typedef binary_parser_category parser_category_t; + typedef longest_parser_gen parser_generator_t; + typedef binary > base_t; + + longest_alternative(A const& a, B const& b) + : base_t(a, b) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typename ScannerT::iterator_t save = scan.first; + result_t l = this->left().parse(scan); + std::swap(scan.first, save); + result_t r = this->right().parse(scan); + + if (l || r) + { + if (l.length() > r.length()) + { + scan.first = save; + return l; + } + return r; + } + + return scan.no_match(); + } + }; + + struct longest_parser_gen + { + template + struct result { + + typedef typename + impl::to_longest_alternative >::result_t + type; + }; + + template + static typename + impl::to_longest_alternative >::result_t + generate(alternative const& alt) + { + return impl::to_longest_alternative >:: + convert(alt); + } + + //'generate' for binary composite + template + static + longest_alternative + generate(A const &left, B const &right) + { + return longest_alternative(left, right); + } + + template + typename impl::to_longest_alternative >::result_t + operator[](alternative const& alt) const + { + return impl::to_longest_alternative >:: + convert(alt); + } + }; + + const longest_parser_gen longest_d = longest_parser_gen(); + + /////////////////////////////////////////////////////////////////////////// + // + // shortest_alternative class + // + /////////////////////////////////////////////////////////////////////////// + struct shortest_parser_gen; + + template + struct shortest_alternative + : public binary > > + { + typedef shortest_alternative self_t; + typedef binary_parser_category parser_category_t; + typedef shortest_parser_gen parser_generator_t; + typedef binary > base_t; + + shortest_alternative(A const& a, B const& b) + : base_t(a, b) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typename ScannerT::iterator_t save = scan.first; + result_t l = this->left().parse(scan); + std::swap(scan.first, save); + result_t r = this->right().parse(scan); + + if (l || r) + { + if ((l.length() < r.length() && l) || !r) + { + scan.first = save; + return l; + } + return r; + } + + return scan.no_match(); + } + }; + + struct shortest_parser_gen + { + template + struct result { + + typedef typename + impl::to_shortest_alternative >::result_t + type; + }; + + template + static typename + impl::to_shortest_alternative >::result_t + generate(alternative const& alt) + { + return impl::to_shortest_alternative >:: + convert(alt); + } + + //'generate' for binary composite + template + static + shortest_alternative + generate(A const &left, B const &right) + { + return shortest_alternative(left, right); + } + + template + typename impl::to_shortest_alternative >::result_t + operator[](alternative const& alt) const + { + return impl::to_shortest_alternative >:: + convert(alt); + } + }; + + const shortest_parser_gen shortest_d = shortest_parser_gen(); + + /////////////////////////////////////////////////////////////////////////// + // + // min_bounded class + // + /////////////////////////////////////////////////////////////////////////// + template + struct min_bounded_gen; + + template + struct min_bounded + : public unary > > + { + typedef min_bounded self_t; + typedef unary_parser_category parser_category_t; + typedef min_bounded_gen parser_generator_t; + typedef unary > base_t; + + template + struct result + { + typedef typename parser_result::type type; + }; + + min_bounded(ParserT const& p, BoundsT const& min__) + : base_t(p) + , min_(min__) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + result_t hit = this->subject().parse(scan); + if (hit.has_valid_attribute() && hit.value() < min_) + return scan.no_match(); + return hit; + } + + BoundsT min_; + }; + + template + struct min_bounded_gen + { + min_bounded_gen(BoundsT const& min__) + : min_(min__) {} + + template + min_bounded + operator[](parser const& p) const + { return min_bounded(p.derived(), min_); } + + BoundsT min_; + }; + + template + inline min_bounded_gen + min_limit_d(BoundsT const& min_) + { return min_bounded_gen(min_); } + + /////////////////////////////////////////////////////////////////////////// + // + // max_bounded class + // + /////////////////////////////////////////////////////////////////////////// + template + struct max_bounded_gen; + + template + struct max_bounded + : public unary > > + { + typedef max_bounded self_t; + typedef unary_parser_category parser_category_t; + typedef max_bounded_gen parser_generator_t; + typedef unary > base_t; + + template + struct result + { + typedef typename parser_result::type type; + }; + + max_bounded(ParserT const& p, BoundsT const& max__) + : base_t(p) + , max_(max__) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + result_t hit = this->subject().parse(scan); + if (hit.has_valid_attribute() && hit.value() > max_) + return scan.no_match(); + return hit; + } + + BoundsT max_; + }; + + template + struct max_bounded_gen + { + max_bounded_gen(BoundsT const& max__) + : max_(max__) {} + + template + max_bounded + operator[](parser const& p) const + { return max_bounded(p.derived(), max_); } + + BoundsT max_; + }; + + ////////////////////////////////// + template + inline max_bounded_gen + max_limit_d(BoundsT const& max_) + { return max_bounded_gen(max_); } + + /////////////////////////////////////////////////////////////////////////// + // + // bounded class + // + /////////////////////////////////////////////////////////////////////////// + template + struct bounded_gen; + + template + struct bounded + : public unary > > + { + typedef bounded self_t; + typedef unary_parser_category parser_category_t; + typedef bounded_gen parser_generator_t; + typedef unary > base_t; + + template + struct result + { + typedef typename parser_result::type type; + }; + + bounded(ParserT const& p, BoundsT const& min__, BoundsT const& max__) + : base_t(p) + , min_(min__) + , max_(max__) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + result_t hit = this->subject().parse(scan); + if (hit.has_valid_attribute() && + (hit.value() < min_ || hit.value() > max_)) + return scan.no_match(); + return hit; + } + + BoundsT min_, max_; + }; + + template + struct bounded_gen + { + bounded_gen(BoundsT const& min__, BoundsT const& max__) + : min_(min__) + , max_(max__) {} + + template + bounded + operator[](parser const& p) const + { return bounded(p.derived(), min_, max_); } + + BoundsT min_, max_; + }; + + template + inline bounded_gen + limit_d(BoundsT const& min_, BoundsT const& max_) + { return bounded_gen(min_, max_); } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/exclusive_or.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/exclusive_or.hpp new file mode 100644 index 0000000..69d4859 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/exclusive_or.hpp @@ -0,0 +1,142 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_EXCLUSIVE_OR_HPP) +#define BOOST_SPIRIT_EXCLUSIVE_OR_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // exclusive_or class + // + // Handles expressions of the form: + // + // a ^ b + // + // where a and b are parsers. The expression returns a composite + // parser that matches a or b but not both. One (not both) of the + // operands may be a literal char, wchar_t or a primitive string + // char const*, wchar_t const*. + // + /////////////////////////////////////////////////////////////////////////// + struct exclusive_or_parser_gen; + + template + struct exclusive_or + : public binary > > + { + typedef exclusive_or self_t; + typedef binary_parser_category parser_category_t; + typedef exclusive_or_parser_gen parser_generator_t; + typedef binary > base_t; + + exclusive_or(A const& a, B const& b) + : base_t(a, b) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typedef typename ScannerT::iterator_t iterator_t; + + iterator_t save = scan.first; + result_t l = this->left().parse(scan); + std::swap(save, scan.first); + result_t r = this->right().parse(scan); + + if (l ? !bool(r) : bool(r)) + { + if (l) + scan.first = save; + return l ? l : r; + } + + return scan.no_match(); + } + }; + + struct exclusive_or_parser_gen + { + template + struct result + { + typedef + exclusive_or< + typename as_parser::type + , typename as_parser::type + > + type; + }; + + template + static exclusive_or< + typename as_parser::type + , typename as_parser::type + > + generate(A const& a, B const& b) + { + return exclusive_or::type, + BOOST_DEDUCED_TYPENAME as_parser::type> + (as_parser::convert(a), as_parser::convert(b)); + } + }; + + template + exclusive_or + operator^(parser const& a, parser const& b); + + template + exclusive_or > + operator^(parser const& a, char b); + + template + exclusive_or, B> + operator^(char a, parser const& b); + + template + exclusive_or > + operator^(parser const& a, char const* b); + + template + exclusive_or, B> + operator^(char const* a, parser const& b); + + template + exclusive_or > + operator^(parser const& a, wchar_t b); + + template + exclusive_or, B> + operator^(wchar_t a, parser const& b); + + template + exclusive_or > + operator^(parser const& a, wchar_t const* b); + + template + exclusive_or, B> + operator^(wchar_t const* a, parser const& b); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/alternative.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/alternative.ipp new file mode 100644 index 0000000..7a7599b --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/alternative.ipp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_ALTERNATIVE_IPP) +#define BOOST_SPIRIT_ALTERNATIVE_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // alternative class implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline alternative + operator|(parser const& a, parser const& b) + { + return alternative(a.derived(), b.derived()); + } + + template + inline alternative > + operator|(parser const& a, char b) + { + return alternative >(a.derived(), b); + } + + template + inline alternative, B> + operator|(char a, parser const& b) + { + return alternative, B>(a, b.derived()); + } + + template + inline alternative > + operator|(parser const& a, char const* b) + { + return alternative >(a.derived(), b); + } + + template + inline alternative, B> + operator|(char const* a, parser const& b) + { + return alternative, B>(a, b.derived()); + } + + template + inline alternative > + operator|(parser const& a, wchar_t b) + { + return alternative >(a.derived(), b); + } + + template + inline alternative, B> + operator|(wchar_t a, parser const& b) + { + return alternative, B>(a, b.derived()); + } + + template + inline alternative > + operator|(parser const& a, wchar_t const* b) + { + return alternative >(a.derived(), b); + } + + template + inline alternative, B> + operator|(wchar_t const* a, parser const& b) + { + return alternative, B>(a, b.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/difference.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/difference.ipp new file mode 100644 index 0000000..f5df8c7 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/difference.ipp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_DIFFERENCE_IPP) +#define BOOST_SPIRIT_DIFFERENCE_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // difference class implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline difference + operator-(parser const& a, parser const& b) + { + return difference(a.derived(), b.derived()); + } + + template + inline difference > + operator-(parser const& a, char b) + { + return difference >(a.derived(), b); + } + + template + inline difference, B> + operator-(char a, parser const& b) + { + return difference, B>(a, b.derived()); + } + + template + inline difference > + operator-(parser const& a, char const* b) + { + return difference >(a.derived(), b); + } + + template + inline difference, B> + operator-(char const* a, parser const& b) + { + return difference, B>(a, b.derived()); + } + + template + inline difference > + operator-(parser const& a, wchar_t b) + { + return difference >(a.derived(), b); + } + + template + inline difference, B> + operator-(wchar_t a, parser const& b) + { + return difference, B>(a, b.derived()); + } + + template + inline difference > + operator-(parser const& a, wchar_t const* b) + { + return difference >(a.derived(), b); + } + + template + inline difference, B> + operator-(wchar_t const* a, parser const& b) + { + return difference, B>(a, b.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/directives.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/directives.ipp new file mode 100644 index 0000000..b25b25f --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/directives.ipp @@ -0,0 +1,374 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2001 Bruce Florman + Copyright (c) 2002 Raghavendra Satish + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_DIRECTIVES_IPP) +#define BOOST_SPIRIT_DIRECTIVES_IPP + +/////////////////////////////////////////////////////////////////////////////// +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + template + struct no_skipper_iteration_policy; + + template + struct inhibit_case_iteration_policy; + + template + struct alternative; + + template + struct longest_alternative; + + template + struct shortest_alternative; + + namespace impl + { + template + inline RT + contiguous_parser_parse( + ST const& s, + ScannerT const& scan, + skipper_iteration_policy const&) + { + typedef scanner_policies< + no_skipper_iteration_policy< + BOOST_DEDUCED_TYPENAME ScannerT::iteration_policy_t>, + BOOST_DEDUCED_TYPENAME ScannerT::match_policy_t, + BOOST_DEDUCED_TYPENAME ScannerT::action_policy_t + > policies_t; + + scan.skip(scan); + RT hit = s.parse(scan.change_policies(policies_t(scan))); + // We will not do a post skip!!! + return hit; + } + + template + inline RT + contiguous_parser_parse( + ST const& s, + ScannerT const& scan, + no_skipper_iteration_policy const&) + { + return s.parse(scan); + } + + template + inline RT + contiguous_parser_parse( + ST const& s, + ScannerT const& scan, + iteration_policy const&) + { + return s.parse(scan); + } + + template < + typename RT, + typename ParserT, + typename ScannerT, + typename BaseT> + inline RT + implicit_lexeme_parse( + ParserT const& p, + ScannerT const& scan, + skipper_iteration_policy const&) + { + typedef scanner_policies< + no_skipper_iteration_policy< + BOOST_DEDUCED_TYPENAME ScannerT::iteration_policy_t>, + BOOST_DEDUCED_TYPENAME ScannerT::match_policy_t, + BOOST_DEDUCED_TYPENAME ScannerT::action_policy_t + > policies_t; + + scan.skip(scan); + RT hit = p.parse_main(scan.change_policies(policies_t(scan))); + // We will not do a post skip!!! + return hit; + } + + template < + typename RT, + typename ParserT, + typename ScannerT, + typename BaseT> + inline RT + implicit_lexeme_parse( + ParserT const& p, + ScannerT const& scan, + no_skipper_iteration_policy const&) + { + return p.parse_main(scan); + } + + template + inline RT + implicit_lexeme_parse( + ParserT const& p, + ScannerT const& scan, + iteration_policy const&) + { + return p.parse_main(scan); + } + + template + inline RT + inhibit_case_parser_parse( + ST const& s, + ScannerT const& scan, + iteration_policy const&) + { + typedef scanner_policies< + inhibit_case_iteration_policy< + BOOST_DEDUCED_TYPENAME ScannerT::iteration_policy_t>, + BOOST_DEDUCED_TYPENAME ScannerT::match_policy_t, + BOOST_DEDUCED_TYPENAME ScannerT::action_policy_t + > policies_t; + + return s.parse(scan.change_policies(policies_t(scan))); + } + + template + inline RT + inhibit_case_parser_parse( + ST const& s, + ScannerT const& scan, + inhibit_case_iteration_policy const&) + { + return s.parse(scan); + } + +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + + /////////////////////////////////////////////////////////////////////// + // + // from spirit 1.1 (copyright (c) 2001 Bruce Florman) + // various workarounds to support longest and shortest directives + // + /////////////////////////////////////////////////////////////////////// + template + struct is_alternative + { + // Determine at compile time (without partial specialization) + // whether a given type is an instance of the alternative + + static T t(); + template + static char test_(alternative const&); // no implementation + static int test_(...); // no implementation + enum { r = sizeof(char) == sizeof(test_(t())) }; + typedef mpl::bool_ value; + }; + + template struct select_to_longest; + + template + struct to_longest_alternative + { + typedef typename select_to_longest::result_t result_t; + typedef typename select_to_longest::plain_t plain_t; + typedef typename select_to_longest::choose_t choose_t; + static result_t convert(T const& a); + }; + + template + struct to_longest_generic + { + typedef T const& result_t; + typedef T plain_t; + typedef mpl::false_ choose_t; + }; + + template + inline T const& + to_longest_convert(T const& a, mpl::false_) + { return a; } + + template + struct to_longest_recursive + { + typedef typename to_longest_alternative< + typename T::left_t>::plain_t a_t; + typedef typename to_longest_alternative< + typename T::right_t>::plain_t b_t; + + typedef longest_alternative result_t; + + typedef result_t plain_t; + typedef mpl::true_ choose_t; + }; + + template + inline typename to_longest_alternative >::result_t + to_longest_convert(alternative const& alt, mpl::true_) + { + typedef typename to_longest_alternative< + alternative >::result_t result_t; + return result_t( + to_longest_alternative::convert(alt.left()), + to_longest_alternative::convert(alt.right())); + } + + template + inline typename to_longest_alternative::result_t + to_longest_alternative::convert(T const& a) + { + return to_longest_convert( + a, to_longest_alternative::choose_t()); + } + + template + struct select_to_longest + { + typedef typename mpl::if_< + is_alternative // IF + , to_longest_recursive // THEN + , to_longest_generic // ELSE + >::type type; + + typedef typename select_to_longest::type::result_t result_t; + typedef typename select_to_longest::type::plain_t plain_t; + typedef typename select_to_longest::type::choose_t choose_t; + }; + + template struct select_to_shortest; + + template + struct to_shortest_alternative + { + typedef typename select_to_shortest::result_t result_t; + typedef typename select_to_shortest::plain_t plain_t; + typedef typename select_to_shortest::choose_t choose_t; + static result_t convert(T const& a); + }; + + template + struct to_shortest_generic + { + typedef T const& result_t; + typedef T plain_t; + typedef mpl::false_ choose_t; + }; + + template + inline T const& + to_shortest_convert(T const& a, mpl::false_) { return a; } + + template + struct to_shortest_recursive + { + typedef typename to_shortest_alternative< + typename T::left_t>::plain_t a_t; + typedef typename to_shortest_alternative< + typename T::right_t>::plain_t b_t; + + typedef shortest_alternative result_t; + + typedef result_t plain_t; + typedef mpl::true_ choose_t; + }; + + template + inline typename to_shortest_alternative >::result_t + to_shortest_convert(alternative const& alt, mpl::true_) + { + typedef typename to_shortest_alternative< + alternative >::result_t result_t; + return result_t( + to_shortest_alternative::convert(alt.left()), + to_shortest_alternative::convert(alt.right())); + } + + template + inline typename to_shortest_alternative::result_t + to_shortest_alternative::convert(T const& a) + { + return to_shortest_convert( + a, to_shortest_alternative::choose_t()); + } + + template + struct select_to_shortest + { + typedef typename mpl::if_< + is_alternative // IF + , to_shortest_recursive // THEN + , to_shortest_generic // ELSE + >::type type; + + typedef typename select_to_shortest::type::result_t result_t; + typedef typename select_to_shortest::type::plain_t plain_t; + typedef typename select_to_shortest::type::choose_t choose_t; + }; +#else + template + struct to_longest_alternative + { + typedef T result_t; + static result_t const& + convert(T const& a) // Special (end) case + { return a; } + }; + + template + struct to_longest_alternative > + { + typedef typename to_longest_alternative::result_t a_t; + typedef typename to_longest_alternative::result_t b_t; + typedef longest_alternative result_t; + + static result_t + convert(alternative const& alt) // Recursive case + { + return result_t( + to_longest_alternative::convert(alt.left()), + to_longest_alternative::convert(alt.right())); + } + }; + + template + struct to_shortest_alternative + { + typedef T result_t; + static result_t const& + convert(T const& a) // Special (end) case + { return a; } + }; + + template + struct to_shortest_alternative > + { + typedef typename to_shortest_alternative::result_t a_t; + typedef typename to_shortest_alternative::result_t b_t; + typedef shortest_alternative result_t; + + static result_t + convert(alternative const& alt) // Recursive case + { + return result_t( + to_shortest_alternative::convert(alt.left()), + to_shortest_alternative::convert(alt.right())); + } + }; +#endif + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/exclusive_or.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/exclusive_or.ipp new file mode 100644 index 0000000..34831a7 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/exclusive_or.ipp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_EXCLUSIVE_OR_IPP) +#define BOOST_SPIRIT_EXCLUSIVE_OR_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // exclusive_or class implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline exclusive_or + operator^(parser const& a, parser const& b) + { + return exclusive_or(a.derived(), b.derived()); + } + + template + inline exclusive_or > + operator^(parser const& a, char b) + { + return exclusive_or >(a.derived(), b); + } + + template + inline exclusive_or, B> + operator^(char a, parser const& b) + { + return exclusive_or, B>(a, b.derived()); + } + + template + inline exclusive_or > + operator^(parser const& a, char const* b) + { + return exclusive_or >(a.derived(), b); + } + + template + inline exclusive_or, B> + operator^(char const* a, parser const& b) + { + return exclusive_or, B>(a, b.derived()); + } + + template + inline exclusive_or > + operator^(parser const& a, wchar_t b) + { + return exclusive_or >(a.derived(), b); + } + + template + inline exclusive_or, B> + operator^(wchar_t a, parser const& b) + { + return exclusive_or, B>(a, b.derived()); + } + + template + inline exclusive_or > + operator^(parser const& a, wchar_t const* b) + { + return exclusive_or >(a.derived(), b); + } + + template + inline exclusive_or, B> + operator^(wchar_t const* a, parser const& b) + { + return exclusive_or, B>(a, b.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/intersection.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/intersection.ipp new file mode 100644 index 0000000..2810586 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/intersection.ipp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_INTERSECTION_IPP) +#define BOOST_SPIRIT_INTERSECTION_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // intersection class implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline intersection + operator&(parser const& a, parser const& b) + { + return intersection(a.derived(), b.derived()); + } + + template + inline intersection > + operator&(parser const& a, char b) + { + return intersection >(a.derived(), b); + } + + template + inline intersection, B> + operator&(char a, parser const& b) + { + return intersection, B>(a, b.derived()); + } + + template + inline intersection > + operator&(parser const& a, char const* b) + { + return intersection >(a.derived(), b); + } + + template + inline intersection, B> + operator&(char const* a, parser const& b) + { + return intersection, B>(a, b.derived()); + } + + template + inline intersection > + operator&(parser const& a, wchar_t b) + { + return intersection >(a.derived(), b); + } + + template + inline intersection, B> + operator&(wchar_t a, parser const& b) + { + return intersection, B>(a, b.derived()); + } + + template + inline intersection > + operator&(parser const& a, wchar_t const* b) + { + return intersection >(a.derived(), b); + } + + template + inline intersection, B> + operator&(wchar_t const* a, parser const& b) + { + return intersection, B>(a, b.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/kleene_star.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/kleene_star.ipp new file mode 100644 index 0000000..8c4f513 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/kleene_star.ipp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_KLEENE_STAR_IPP) +#define BOOST_SPIRIT_KLEENE_STAR_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // kleene_star class implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline kleene_star + operator*(parser const& a) + { + return kleene_star(a.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/list.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/list.ipp new file mode 100644 index 0000000..cd7965a --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/list.ipp @@ -0,0 +1,93 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_LIST_IPP) +#define BOOST_SPIRIT_LIST_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // operator% is defined as: + // a % b ---> a >> *(b >> a) + // + /////////////////////////////////////////////////////////////////////////// + template + inline sequence > > + operator%(parser const& a, parser const& b) + { + return a.derived() >> *(b.derived() >> a.derived()); + } + + template + inline sequence, A> > > + operator%(parser const& a, char b) + { + return a.derived() >> *(b >> a.derived()); + } + + template + inline sequence, kleene_star > > > + operator%(char a, parser const& b) + { + return a >> *(b.derived() >> a); + } + + template + inline sequence, A> > > + operator%(parser const& a, char const* b) + { + return a.derived() >> *(b >> a.derived()); + } + + template + inline sequence, + kleene_star > > > + operator%(char const* a, parser const& b) + { + return a >> *(b.derived() >> a); + } + + template + inline sequence, A> > > + operator%(parser const& a, wchar_t b) + { + return a.derived() >> *(b >> a.derived()); + } + + template + inline sequence, kleene_star > > > + operator%(wchar_t a, parser const& b) + { + return a >> *(b.derived() >> a); + } + + template + inline sequence, A> > > + operator%(parser const& a, wchar_t const* b) + { + return a.derived() >> *(b >> a.derived()); + } + + template + inline sequence, + kleene_star > > > + operator%(wchar_t const* a, parser const& b) + { + return a >> *(b.derived() >> a); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/optional.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/optional.ipp new file mode 100644 index 0000000..629eac8 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/optional.ipp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_OPTIONAL_IPP) +#define BOOST_SPIRIT_OPTIONAL_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // optional class implementation + // + /////////////////////////////////////////////////////////////////////////// + template + optional + operator!(parser const& a) + { + return optional(a.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/positive.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/positive.ipp new file mode 100644 index 0000000..9698e69 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/positive.ipp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_POSITIVE_IPP) +#define BOOST_SPIRIT_POSITIVE_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // positive class implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline positive + operator+(parser const& a) + { + return positive(a.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/sequence.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/sequence.ipp new file mode 100644 index 0000000..283d420 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/sequence.ipp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SEQUENCE_IPP) +#define BOOST_SPIRIT_SEQUENCE_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // sequence class implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline sequence + operator>>(parser const& a, parser const& b) + { + return sequence(a.derived(), b.derived()); + } + + template + inline sequence > + operator>>(parser const& a, char b) + { + return sequence >(a.derived(), b); + } + + template + inline sequence, B> + operator>>(char a, parser const& b) + { + return sequence, B>(a, b.derived()); + } + + template + inline sequence > + operator>>(parser const& a, char const* b) + { + return sequence >(a.derived(), b); + } + + template + inline sequence, B> + operator>>(char const* a, parser const& b) + { + return sequence, B>(a, b.derived()); + } + + template + inline sequence > + operator>>(parser const& a, wchar_t b) + { + return sequence >(a.derived(), b); + } + + template + inline sequence, B> + operator>>(wchar_t a, parser const& b) + { + return sequence, B>(a, b.derived()); + } + + template + inline sequence > + operator>>(parser const& a, wchar_t const* b) + { + return sequence >(a.derived(), b); + } + + template + inline sequence, B> + operator>>(wchar_t const* a, parser const& b) + { + return sequence, B>(a, b.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/sequential_and.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/sequential_and.ipp new file mode 100644 index 0000000..9f577a4 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/sequential_and.ipp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SEQUENTIAL_AND_IPP) +#define BOOST_SPIRIT_SEQUENTIAL_AND_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // sequential-and operators implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline sequence + operator&&(parser const& a, parser const& b) + { + return sequence(a.derived(), b.derived()); + } + + template + inline sequence > + operator&&(parser const& a, char b) + { + return sequence >(a.derived(), b); + } + + template + inline sequence, B> + operator&&(char a, parser const& b) + { + return sequence, B>(a, b.derived()); + } + + template + inline sequence > + operator&&(parser const& a, char const* b) + { + return sequence >(a.derived(), b); + } + + template + inline sequence, B> + operator&&(char const* a, parser const& b) + { + return sequence, B>(a, b.derived()); + } + + template + inline sequence > + operator&&(parser const& a, wchar_t b) + { + return sequence >(a.derived(), b); + } + + template + inline sequence, B> + operator&&(wchar_t a, parser const& b) + { + return sequence, B>(a, b.derived()); + } + + template + inline sequence > + operator&&(parser const& a, wchar_t const* b) + { + return sequence >(a.derived(), b); + } + + template + inline sequence, B> + operator&&(wchar_t const* a, parser const& b) + { + return sequence, B>(a, b.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/sequential_or.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/sequential_or.ipp new file mode 100644 index 0000000..521faf6 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/impl/sequential_or.ipp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SEQUENTIAL_OR_IPP) +#define BOOST_SPIRIT_SEQUENTIAL_OR_IPP + +namespace boost { namespace spirit { + + BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // sequential-or class implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline sequential_or + operator||(parser const& a, parser const& b) + { + return sequential_or(a.derived(), b.derived()); + } + + template + inline sequential_or > + operator||(parser const& a, char b) + { + return sequential_or >(a.derived(), b); + } + + template + inline sequential_or, B> + operator||(char a, parser const& b) + { + return sequential_or, B>(a, b.derived()); + } + + template + inline sequential_or > + operator||(parser const& a, char const* b) + { + return sequential_or >(a.derived(), b); + } + + template + inline sequential_or, B> + operator||(char const* a, parser const& b) + { + return sequential_or, B>(a, b.derived()); + } + + template + inline sequential_or > + operator||(parser const& a, wchar_t b) + { + return sequential_or >(a.derived(), b); + } + + template + inline sequential_or, B> + operator||(wchar_t a, parser const& b) + { + return sequential_or, B>(a, b.derived()); + } + + template + inline sequential_or > + operator||(parser const& a, wchar_t const* b) + { + return sequential_or >(a.derived(), b); + } + + template + inline sequential_or, B> + operator||(wchar_t const* a, parser const& b) + { + return sequential_or, B>(a, b.derived()); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/intersection.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/intersection.hpp new file mode 100644 index 0000000..867c20f --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/intersection.hpp @@ -0,0 +1,142 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_INTERSECTION_HPP) +#define BOOST_SPIRIT_INTERSECTION_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // intersection class + // + // Handles expressions of the form: + // + // a & b + // + // where a and b are parsers. The expression returns a composite + // parser that matches a and b. One (not both) of the operands may + // be a literal char, wchar_t or a primitive string char const*, + // wchar_t const*. + // + // The expression is short circuit evaluated. b is never touched + // when a is returns a no-match. + // + /////////////////////////////////////////////////////////////////////////// + struct intersection_parser_gen; + + template + struct intersection + : public binary > > + { + typedef intersection self_t; + typedef binary_parser_category parser_category_t; + typedef intersection_parser_gen parser_generator_t; + typedef binary > base_t; + + intersection(A const& a, B const& b) + : base_t(a, b) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typedef typename ScannerT::iterator_t iterator_t; + iterator_t save = scan.first; + if (result_t hl = this->left().parse(scan)) + { + ScannerT bscan(scan.first, scan.first, scan); + scan.first = save; + result_t hr = this->right().parse(bscan); + if (hl.length() == hr.length()) + return hl; + } + + return scan.no_match(); + } + }; + + struct intersection_parser_gen + { + template + struct result + { + typedef + intersection< + typename as_parser::type + , typename as_parser::type + > + type; + }; + + template + static intersection< + typename as_parser::type + , typename as_parser::type + > + generate(A const& a, B const& b) + { + return intersection::type, + BOOST_DEDUCED_TYPENAME as_parser::type> + (as_parser::convert(a), as_parser::convert(b)); + } + }; + + template + intersection + operator&(parser const& a, parser const& b); + + template + intersection > + operator&(parser const& a, char b); + + template + intersection, B> + operator&(char a, parser const& b); + + template + intersection > + operator&(parser const& a, char const* b); + + template + intersection, B> + operator&(char const* a, parser const& b); + + template + intersection > + operator&(parser const& a, wchar_t b); + + template + intersection, B> + operator&(wchar_t a, parser const& b); + + template + intersection > + operator&(parser const& a, wchar_t const* b); + + template + intersection, B> + operator&(wchar_t const* a, parser const& b); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/kleene_star.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/kleene_star.hpp new file mode 100644 index 0000000..9b6c73a --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/kleene_star.hpp @@ -0,0 +1,109 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_KLEENE_STAR_HPP) +#define BOOST_SPIRIT_KLEENE_STAR_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // kleene_star class + // + // Handles expressions of the form: + // + // *a + // + // where a is a parser. The expression returns a composite + // parser that matches its subject zero (0) or more times. + // + /////////////////////////////////////////////////////////////////////////// + struct kleene_star_parser_gen; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + + template + struct kleene_star + : public unary > > + { + typedef kleene_star self_t; + typedef unary_parser_category parser_category_t; + typedef kleene_star_parser_gen parser_generator_t; + typedef unary > base_t; + + kleene_star(S const& a) + : base_t(a) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typedef typename ScannerT::iterator_t iterator_t; + result_t hit = scan.empty_match(); + + for (;;) + { + iterator_t save = scan.first; + if (result_t next = this->subject().parse(scan)) + { + scan.concat_match(hit, next); + } + else + { + scan.first = save; + return hit; + } + } + } + }; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + + struct kleene_star_parser_gen + { + template + struct result + { + typedef kleene_star type; + }; + + template + static kleene_star + generate(parser const& a) + { + return kleene_star(a.derived()); + } + }; + + ////////////////////////////////// + template + kleene_star + operator*(parser const& a); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/list.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/list.hpp new file mode 100644 index 0000000..cdb879e --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/list.hpp @@ -0,0 +1,73 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_LIST_HPP) +#define BOOST_SPIRIT_LIST_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // operator% is defined as: + // a % b ---> a >> *(b >> a) + // + /////////////////////////////////////////////////////////////////////////// + template + sequence > > + operator%(parser const& a, parser const& b); + + template + sequence, A> > > + operator%(parser const& a, char b); + + template + sequence, kleene_star > > > + operator%(char a, parser const& b); + + template + sequence, A> > > + operator%(parser const& a, char const* b); + + template + sequence, + kleene_star > > > + operator%(char const* a, parser const& b); + + template + sequence, A> > > + operator%(parser const& a, wchar_t b); + + template + sequence, kleene_star > > > + operator%(wchar_t a, parser const& b); + + template + sequence, A> > > + operator%(parser const& a, wchar_t const* b); + + template + sequence, + kleene_star > > > + operator%(wchar_t const* a, parser const& b); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/operators.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/operators.hpp new file mode 100644 index 0000000..5732ef9 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/operators.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_OPERATORS_HPP) +#define BOOST_SPIRIT_OPERATORS_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/optional.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/optional.hpp new file mode 100644 index 0000000..69e49f9 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/optional.hpp @@ -0,0 +1,94 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_OPTIONAL_HPP) +#define BOOST_SPIRIT_OPTIONAL_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // optional class + // + // Handles expressions of the form: + // + // !a + // + // where a is a parser. The expression returns a composite + // parser that matches its subject zero (0) or one (1) time. + // + /////////////////////////////////////////////////////////////////////////// + struct optional_parser_gen; + + template + struct optional + : public unary > > + { + typedef optional self_t; + typedef unary_parser_category parser_category_t; + typedef optional_parser_gen parser_generator_t; + typedef unary > base_t; + + optional(S const& a) + : base_t(a) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typedef typename ScannerT::iterator_t iterator_t; + iterator_t save = scan.first; + if (result_t r = this->subject().parse(scan)) + { + return r; + } + else + { + scan.first = save; + return scan.empty_match(); + } + } + }; + + struct optional_parser_gen + { + template + struct result + { + typedef optional type; + }; + + template + static optional + generate(parser const& a) + { + return optional(a.derived()); + } + }; + + template + optional + operator!(parser const& a); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/positive.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/positive.hpp new file mode 100644 index 0000000..7b494b4 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/positive.hpp @@ -0,0 +1,112 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_POSITIVE_HPP) +#define BOOST_SPIRIT_POSITIVE_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // positive class + // + // Handles expressions of the form: + // + // +a + // + // where a is a parser. The expression returns a composite + // parser that matches its subject one (1) or more times. + // + /////////////////////////////////////////////////////////////////////////// + struct positive_parser_gen; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + + template + struct positive + : public unary > > + { + typedef positive self_t; + typedef unary_parser_category parser_category_t; + typedef positive_parser_gen parser_generator_t; + typedef unary > base_t; + + positive(S const& a) + : base_t(a) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typedef typename ScannerT::iterator_t iterator_t; + result_t hit = this->subject().parse(scan); + + if (hit) + { + for (;;) + { + iterator_t save = scan.first; + if (result_t next = this->subject().parse(scan)) + { + scan.concat_match(hit, next); + } + else + { + scan.first = save; + break; + } + } + } + return hit; + } + }; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + + struct positive_parser_gen + { + template + struct result + { + typedef positive type; + }; + + template + static positive + generate(parser const& a) + { + return positive(a.derived()); + } + }; + + template + inline positive + operator+(parser const& a); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/sequence.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/sequence.hpp new file mode 100644 index 0000000..3ccd9ea --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/sequence.hpp @@ -0,0 +1,142 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SEQUENCE_HPP) +#define BOOST_SPIRIT_SEQUENCE_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // sequence class + // + // Handles expressions of the form: + // + // a >> b + // + // where a and b are parsers. The expression returns a composite + // parser that matches a and b in sequence. One (not both) of the + // operands may be a literal char, wchar_t or a primitive string + // char const*, wchar_t const*. + // + ////////////////////////////////////////////////////////////////////////// + struct sequence_parser_gen; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + + template + struct sequence : public binary > > + { + typedef sequence self_t; + typedef binary_parser_category parser_category_t; + typedef sequence_parser_gen parser_generator_t; + typedef binary > base_t; + + sequence(A const& a, B const& b) + : base_t(a, b) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + if (result_t ma = this->left().parse(scan)) + if (result_t mb = this->right().parse(scan)) + { + scan.concat_match(ma, mb); + return ma; + } + return scan.no_match(); + } + }; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + + struct sequence_parser_gen + { + template + struct result + { + typedef + sequence< + typename as_parser::type + , typename as_parser::type + > + type; + }; + + template + static sequence< + typename as_parser::type + , typename as_parser::type + > + generate(A const& a, B const& b) + { + return sequence::type, + BOOST_DEDUCED_TYPENAME as_parser::type> + (as_parser::convert(a), as_parser::convert(b)); + } + }; + + template + sequence + operator>>(parser const& a, parser const& b); + + template + sequence > + operator>>(parser const& a, char b); + + template + sequence, B> + operator>>(char a, parser const& b); + + template + sequence > + operator>>(parser const& a, char const* b); + + template + sequence, B> + operator>>(char const* a, parser const& b); + + template + sequence > + operator>>(parser const& a, wchar_t b); + + template + sequence, B> + operator>>(wchar_t a, parser const& b); + + template + sequence > + operator>>(parser const& a, wchar_t const* b); + + template + sequence, B> + operator>>(wchar_t const* a, parser const& b); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/sequential_and.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/sequential_and.hpp new file mode 100644 index 0000000..da11f87 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/sequential_and.hpp @@ -0,0 +1,76 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SEQUENTIAL_AND_HPP) +#define BOOST_SPIRIT_SEQUENTIAL_AND_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // sequential-and operators + // + // Handles expressions of the form: + // + // a && b + // + // Same as a >> b. + // + /////////////////////////////////////////////////////////////////////////// + template + sequence + operator&&(parser const& a, parser const& b); + + template + sequence > + operator&&(parser const& a, char b); + + template + sequence, B> + operator&&(char a, parser const& b); + + template + sequence > + operator&&(parser const& a, char const* b); + + template + sequence, B> + operator&&(char const* a, parser const& b); + + template + sequence > + operator&&(parser const& a, wchar_t b); + + template + sequence, B> + operator&&(wchar_t a, parser const& b); + + template + sequence > + operator&&(parser const& a, wchar_t const* b); + + template + sequence, B> + operator&&(wchar_t const* a, parser const& b); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/sequential_or.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/sequential_or.hpp new file mode 100644 index 0000000..b276f6c --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/composite/sequential_or.hpp @@ -0,0 +1,154 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + Copyright (c) 2002 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SEQUENTIAL_OR_HPP) +#define BOOST_SPIRIT_SEQUENTIAL_OR_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // sequential-or class + // + // Handles expressions of the form: + // + // a || b + // + // Equivalent to + // + // a | b | a >> b; + // + // where a and b are parsers. The expression returns a composite + // parser that matches matches a or b in sequence. One (not both) of + // the operands may be a literal char, wchar_t or a primitive string + // char const*, wchar_t const*. + // + /////////////////////////////////////////////////////////////////////////// + struct sequential_or_parser_gen; + + template + struct sequential_or : public binary > > + { + typedef sequential_or self_t; + typedef binary_parser_category parser_category_t; + typedef sequential_or_parser_gen parser_generator_t; + typedef binary > base_t; + + sequential_or(A const& a, B const& b) + : base_t(a, b) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typedef typename ScannerT::iterator_t iterator_t; + { // scope for save + iterator_t save = scan.first; + if (result_t ma = this->left().parse(scan)) + { + save = scan.first; + if (result_t mb = this->right().parse(scan)) + { + // matched a b + scan.concat_match(ma, mb); + return ma; + } + else + { + // matched a + scan.first = save; + return ma; + } + } + scan.first = save; + } + + // matched b + return this->right().parse(scan); + } + }; + + struct sequential_or_parser_gen + { + template + struct result + { + typedef + sequential_or< + typename as_parser::type + , typename as_parser::type + > + type; + }; + + template + static sequential_or< + typename as_parser::type + , typename as_parser::type + > + generate(A const& a, B const& b) + { + return sequential_or::type, + BOOST_DEDUCED_TYPENAME as_parser::type> + (as_parser::convert(a), as_parser::convert(b)); + } + }; + + template + sequential_or + operator||(parser const& a, parser const& b); + + template + sequential_or > + operator||(parser const& a, char b); + + template + sequential_or, B> + operator||(char a, parser const& b); + + template + sequential_or > + operator||(parser const& a, char const* b); + + template + sequential_or, B> + operator||(char const* a, parser const& b); + + template + sequential_or > + operator||(parser const& a, wchar_t b); + + template + sequential_or, B> + operator||(wchar_t a, parser const& b); + + template + sequential_or > + operator||(parser const& a, wchar_t const* b); + + template + sequential_or, B> + operator||(wchar_t const* a, parser const& b); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/config.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/config.hpp new file mode 100644 index 0000000..57eca7f --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/config.hpp @@ -0,0 +1,62 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_CONFIG_HPP) +#define BOOST_SPIRIT_CONFIG_HPP + +#include + +/////////////////////////////////////////////////////////////////////////////// +// +// Compiler check: +// +// Historically, Spirit supported a lot of compilers, including (to some +// extent) poorly conforming compilers such as VC6. Spirit v1.6.x will be +// the last release that will support older poorly conforming compilers. +// Starting from Spirit v1.8.0, ill conforming compilers will not be +// supported. If you are still using one of these older compilers, you can +// still use Spirit v1.6.x. +// +// The reason why Spirit v1.6.x worked on old non-conforming compilers is +// that the authors laboriously took the trouble of searching for +// workarounds to make these compilers happy. The process takes a lot of +// time and energy, especially when one encounters the dreaded ICE or +// "Internal Compiler Error". Sometimes searching for a single workaround +// takes days or even weeks. Sometimes, there are no known workarounds. This +// stifles progress a lot. And, as the library gets more progressive and +// takes on more advanced C++ techniques, the difficulty is escalated to +// even new heights. +// +// Spirit v1.6.x will still be supported. Maintenance and bug fixes will +// still be applied. There will still be active development for the back- +// porting of new features introduced in Spirit v1.8.0 (and Spirit 1.9.0) +// to lesser able compilers; hopefully, fueled by contributions from the +// community. For instance, there is already a working AST tree back-port +// for VC6 and VC7 by Peder Holt. +// +// If you got here somehow, your compiler is known to be poorly conforming +// WRT ANSI/ISO C++ standard. Library implementers get a bad reputation when +// someone attempts to compile the code on a non-conforming compiler. She'll +// be confronted with tons of compiler errors when she tries to compile the +// library. Such errors will somehow make less informed users conclude that +// the code is poorly written. It's better for the user to see a message +// "sorry, this code has not been ported to your compiler yet", than to see +// pages and pages of compiler error messages. +// +///////////////////////////////////////////////////////////////////////////////// +#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1310)) \ + || (defined(__BORLANDC__) && (__BORLANDC__ <= 0x570)) \ + || (defined(__GNUC__) && (__GNUC__ < 3)) \ + || (defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ < 1)) +# error "Compiler not supported. See note in " +#else +// Pass... Compiler supported. +#endif + +#endif + + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/impl/match.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/impl/match.ipp new file mode 100644 index 0000000..0319dcf --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/impl/match.ipp @@ -0,0 +1,113 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_MATCH_IPP) +#define BOOST_SPIRIT_MATCH_IPP +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + template + inline match::match() + : len(-1), val() {} + + template + inline match::match(std::size_t length_) + : len(length_), val() {} + + template + inline match::match(std::size_t length_, ctor_param_t val_) + : len(length_), val(val_) {} + + template + inline bool + match::operator!() const + { + return len < 0; + } + + template + inline std::ptrdiff_t + match::length() const + { + return len; + } + + template + inline bool + match::has_valid_attribute() const + { + return val.is_initialized(); + } + + template + inline typename match::return_t + match::value() const + { + BOOST_SPIRIT_ASSERT(val.is_initialized()); + return *val; + } + + template + inline void + match::swap(match& other) + { + std::swap(len, other.len); + std::swap(val, other.val); + } + + inline match::match() + : len(-1) {} + + inline match::match(std::size_t length_) + : len(length_) {} + + inline match::match(std::size_t length_, nil_t) + : len(length_) {} + + inline bool + match::operator!() const + { + return len < 0; + } + + inline bool + match::has_valid_attribute() const + { + return false; + } + + inline std::ptrdiff_t + match::length() const + { + return len; + } + + inline nil_t + match::value() const + { + return nil_t(); + } + + inline void + match::value(nil_t) {} + + inline void + match::swap(match& other) + { + std::swap(len, other.len); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/impl/match_attr_traits.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/impl/match_attr_traits.ipp new file mode 100644 index 0000000..24d9a43 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/impl/match_attr_traits.ipp @@ -0,0 +1,102 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_MATCH_ATTR_TRAITS_IPP) +#define BOOST_SPIRIT_MATCH_ATTR_TRAITS_IPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +namespace impl +{ + template + struct match_attr_traits + { + typedef typename + boost::optional::reference_const_type + const_reference; + + // case where src *IS* convertible to T (dest) + template + static void + convert(boost::optional& dest, T2 const& src, mpl::true_) + { + dest.reset(src); + } + + // case where src *IS NOT* convertible to T (dest) + template + static void + convert(boost::optional& dest, T2 const& /*src*/, mpl::false_) + { + dest.reset(); + } + + static void + convert(boost::optional& dest, nil_t/*src*/) + { + dest.reset(); + } + + template + static void + convert(boost::optional& dest, T2 const& src) + { + convert(dest, src, is_convertible()); + } + + template + static void + copy(boost::optional& dest, OtherMatchT const& src) + { + if (src.has_valid_attribute()) + convert(dest, src.value()); + } + + template + static void + assign(boost::optional& dest, OtherMatchT const& src) + { + if (src.has_valid_attribute()) + convert(dest, src.value()); + else + dest.reset(); + } + + // T is not reference + template + static void + set_value(boost::optional& dest, ValueT const& val, mpl::false_) + { + dest.reset(val); + } + + // T is a reference + template + static void + set_value(boost::optional& dest, ValueT const& val, mpl::true_) + { + dest.get() = val; + } + }; + +} + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit::impl + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/impl/parser.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/impl/parser.ipp new file mode 100644 index 0000000..d5abe69 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/impl/parser.ipp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_PARSER_IPP) +#define BOOST_SPIRIT_PARSER_IPP + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // Generic parse function implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline parse_info + parse( + IteratorT const& first_ + , IteratorT const& last + , parser const& p) + { + IteratorT first = first_; + scanner > scan(first, last); + match hit = p.derived().parse(scan); + return parse_info( + first, hit, hit && (first == last), hit.length()); + } + + /////////////////////////////////////////////////////////////////////////// + // + // Parse function for null terminated strings implementation + // + /////////////////////////////////////////////////////////////////////////// + template + inline parse_info + parse(CharT const* str, parser const& p) + { + CharT const* last = str; + while (*last) + last++; + return parse(str, last, p); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/match.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/match.hpp new file mode 100644 index 0000000..6f1822e --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/match.hpp @@ -0,0 +1,185 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_MATCH_HPP) +#define BOOST_SPIRIT_MATCH_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // match class + // + // The match holds the result of a parser. A match object evaluates + // to true when a successful match is found, otherwise false. The + // length of the match is the number of characters (or tokens) that + // is successfully matched. This can be queried through its length() + // member function. A negative value means that the match is + // unsucessful. + // + // Each parser may have an associated attribute. This attribute is + // also returned back to the client on a successful parse through + // the match object. The match's value() member function returns the + // match's attribute. + // + // A match attribute is valid: + // + // * on a successful match + // * when its value is set through the value(val) member function + // * if it is assigned or copied from a compatible match object + // (e.g. match from match) with a valid attribute. + // + // The match attribute is undefined: + // + // * on an unsuccessful match + // * when an attempt to copy or assign from another match object + // with an incompatible attribute type (e.g. match + // from match). + // + // The member function has_valid_attribute() can be queried to know if + // it is safe to get the match's attribute. The attribute may be set + // through the member function value(v) where v is the new attribute + // value. + // + /////////////////////////////////////////////////////////////////////////// + template + class match : public safe_bool > + { + + public: + + typedef typename boost::optional optional_type; + typedef typename optional_type::argument_type ctor_param_t; + typedef typename optional_type::reference_const_type return_t; + typedef T attr_t; + + match(); + explicit match(std::size_t length); + match(std::size_t length, ctor_param_t val); + + bool operator!() const; + std::ptrdiff_t length() const; + bool has_valid_attribute() const; + return_t value() const; + void swap(match& other); + + template + match(match const& other) + : len(other.length()), val() + { + impl::match_attr_traits::copy(val, other); + } + + template + match& + operator=(match const& other) + { + impl::match_attr_traits::assign(val, other); + len = other.length(); + return *this; + } + + template + void + concat(MatchT const& other) + { + BOOST_SPIRIT_ASSERT(*this && other); + len += other.length(); + } + + template + void + value(ValueT const& val_) + { + impl::match_attr_traits::set_value(val, val_, is_reference()); + } + + bool operator_bool() const + { + return len >= 0; + } + + private: + + std::ptrdiff_t len; + optional_type val; + }; + + /////////////////////////////////////////////////////////////////////////// + // + // match class specialization for nil_t values + // + /////////////////////////////////////////////////////////////////////////// + template <> + class match : public safe_bool > + { + public: + + typedef nil_t attr_t; + typedef nil_t return_t; + + match(); + explicit match(std::size_t length); + match(std::size_t length, nil_t); + + bool operator!() const; + bool has_valid_attribute() const; + std::ptrdiff_t length() const; + nil_t value() const; + void value(nil_t); + void swap(match& other); + + template + match(match const& other) + : len(other.length()) {} + + template + match<>& + operator=(match const& other) + { + len = other.length(); + return *this; + } + + template + void + concat(match const& other) + { + BOOST_SPIRIT_ASSERT(*this && other); + len += other.length(); + } + + bool operator_bool() const + { + return len >= 0; + } + + private: + + std::ptrdiff_t len; + }; + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif +#include + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/nil.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/nil.hpp new file mode 100644 index 0000000..c94c064 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/nil.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_NIL_HPP) +#define BOOST_SPIRIT_NIL_HPP + +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + struct nil_t {}; + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} + +#endif + + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/impl/rule.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/impl/rule.ipp new file mode 100644 index 0000000..9f10306 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/impl/rule.ipp @@ -0,0 +1,420 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_RULE_IPP) +#define BOOST_SPIRIT_RULE_IPP + +#if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 +#include +#include +#include +#include +#include +#include +#include +#endif + +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +#if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 + + template < + BOOST_PP_ENUM_BINARY_PARAMS( + BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT, + typename ScannerT, = mpl::void_ BOOST_PP_INTERCEPT + ) + > + struct scanner_list; + +#endif // BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 + + /////////////////////////////////////////////////////////////////////////// + namespace impl + { + template + struct get_param + { + typedef typename mpl::if_< + is_base_and_derived + , T0 + , typename mpl::if_< + is_base_and_derived + , T1 + , typename mpl::if_< + is_base_and_derived + , T2 + , DefaultT + >::type + >::type + >::type type; + }; + + template + struct get_context + { + typedef typename get_param< + parser_context_base, parser_context<>, T0, T1, T2>::type + type; + }; + + template + struct get_tag + { + typedef typename get_param< + parser_tag_base, parser_address_tag, T0, T1, T2>::type + type; + }; + + template + struct get_scanner + { + typedef typename get_param< + scanner_base, scanner<>, T0, T1, T2>::type + type; + }; + + /////////////////////////////////////////////////////////////////////// + // + // rule_base class + // + // The rule_base class implements the basic plumbing for rules + // minus the storage mechanism. It is up to the derived class + // to actually store the definition somewhere. The rule_base + // class assumes that the derived class provides a get() function + // that will return a pointer to a parser. The get() function + // may return NULL. See rule below for details. + // + // <<< For framework use only. Not for public consumption. >>> + // + /////////////////////////////////////////////////////////////////////// + template < + typename DerivedT // derived class + , typename EmbedT // how derived class is embedded + , typename T0 = nil_t // see rule class + , typename T1 = nil_t // see rule class + , typename T2 = nil_t // see rule class + > + class rule_base; // forward declaration + + class rule_base_access + { +#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \ + || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) + public: // YUCK! +#else + template < + typename DerivedT + , typename EmbedT + , typename T0 + , typename T1 + , typename T2 + > + friend class rule_base; +#endif + template + static typename RuleT::abstract_parser_t* + get(RuleT const& r) + { + return r.get(); + } + }; + + template < + typename DerivedT // derived class + , typename EmbedT // how derived class is embedded + , typename T0 // see rule class + , typename T1 // see rule class + , typename T2 // see rule class + > + class rule_base + : public parser + , public impl::get_context::type::base_t + , public context_aux< + typename impl::get_context::type, DerivedT> + , public impl::get_tag::type + { + public: + + typedef typename impl::get_scanner::type scanner_t; + typedef typename impl::get_context::type context_t; + typedef typename impl::get_tag::type tag_t; + + typedef EmbedT embed_t; + typedef typename context_t::context_linker_t linked_context_t; + typedef typename linked_context_t::attr_t attr_t; + + template + struct result + { + typedef typename match_result::type type; + }; + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef parser_scanner_linker linked_scanner_t; + typedef typename parser_result::type result_t; + BOOST_SPIRIT_CONTEXT_PARSE( + scan, *this, linked_scanner_t, linked_context_t, result_t); + } + + template + typename parser_result::type + parse_main(ScannerT const& scan) const + { + typename parser_result::type hit; + + // MWCW 8.3 needs this cast to be done through a pointer, + // not a reference. Otherwise, it will silently construct + // a temporary, causing an infinite runtime recursion. + DerivedT const* derived_this = static_cast(this); + + if (rule_base_access::get(*derived_this)) + { + typename ScannerT::iterator_t s(scan.first); + hit = rule_base_access::get(*derived_this) + ->do_parse_virtual(scan); + scan.group_match(hit, this->id(), s, scan.first); + } + else + { + hit = scan.no_match(); + } + return hit; + } + }; + + /////////////////////////////////////////////////////////////////////// + // + // abstract_parser class + // + /////////////////////////////////////////////////////////////////////// + template + struct abstract_parser + { + abstract_parser() {} + virtual ~abstract_parser() {} + + virtual typename match_result::type + do_parse_virtual(ScannerT const& scan) const = 0; + + virtual abstract_parser* + clone() const = 0; + }; + + /////////////////////////////////////////////////////////////////////// + // + // concrete_parser class + // + /////////////////////////////////////////////////////////////////////// +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + + template + struct concrete_parser : abstract_parser + { + concrete_parser(ParserT const& p_) : p(p_) {} + virtual ~concrete_parser() {} + + virtual typename match_result::type + do_parse_virtual(ScannerT const& scan) const + { + return p.parse(scan); + } + + virtual abstract_parser* + clone() const + { + return new concrete_parser(p); + } + + typename ParserT::embed_t p; + }; + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + +#if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 + + /////////////////////////////////////////////////////////////////////// + // + // This generates partial specializations for the class + // + // abstract_parser + // + // with an increasing number of different ScannerT template parameters + // and corresponding do_parse_virtual function declarations for each + // of the different required scanner types: + // + // template + // struct abstract_parser, AttrT> + // { + // abstract_parser() {} + // virtual ~abstract_parser() {} + // + // virtual typename match_result::type + // do_parse_virtual(ScannerT0 const &scan) const = 0; + // + // virtual abstract_parser* + // clone() const = 0; + // + // ... + // }; + // + /////////////////////////////////////////////////////////////////////// + #define BOOST_SPIRIT_RULE_ENUM_DOPARSE_A(z, N, _) \ + virtual typename match_result< \ + BOOST_PP_CAT(ScannerT, N), AttrT \ + >::type \ + do_parse_virtual( \ + BOOST_PP_CAT(ScannerT, N) const& scan) const = 0; \ + + #define BOOST_SPIRIT_ENUM_ABSTRACT_PARSERS(z, N, _) \ + template < \ + BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(N), typename ScannerT), \ + typename AttrT \ + > \ + struct abstract_parser< \ + scanner_list< \ + BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(N), ScannerT) \ + >, \ + AttrT \ + > \ + { \ + abstract_parser() {} \ + virtual ~abstract_parser() {} \ + \ + BOOST_PP_REPEAT_ ## z( \ + BOOST_PP_INC(N), BOOST_SPIRIT_RULE_ENUM_DOPARSE_A, _) \ + \ + virtual abstract_parser* \ + clone() const = 0; \ + }; \ + + BOOST_PP_REPEAT_FROM_TO(1, BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT, + BOOST_SPIRIT_ENUM_ABSTRACT_PARSERS, _) + + #undef BOOST_SPIRIT_RULE_ENUM_DOPARSE_A + #undef BOOST_SPIRIT_ENUM_ABSTRACT_PARSERS + /////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////////// + // + // This generates partial specializations for the class + // + // concrete_parser + // + // with an increasing number of different ScannerT template parameters + // and corresponding do_parse_virtual function declarations for each + // of the different required scanner types: + // + // template < + // typename ParserT, typename ScannerT0, ..., typename AttrT + // > + // struct concrete_parser< + // ParserT, scanner_list, AttrT + // > + // : public abstract_parser, AttrT> + // { + // concrete_parser(ParserT const& p_) : p(p_) {} + // virtual ~concrete_parser() {} + // + // virtual typename match_result::type + // do_parse_virtual(ScannerT0 const &scan) const + // { return p.parse(scan); } + // + // virtual abstract_parser, AttrT>* + // clone() const + // { + // return new concrete_parser(p); + // } + // + // ... + // + // typename ParserT::embed_t p; + // }; + // + /////////////////////////////////////////////////////////////////////// + #define BOOST_SPIRIT_RULE_ENUM_DOPARSE_C(z, N, _) \ + virtual typename match_result< \ + BOOST_PP_CAT(ScannerT, N), AttrT \ + >::type \ + do_parse_virtual( \ + BOOST_PP_CAT(ScannerT, N) const& scan) const \ + { return p.parse(scan); } \ + + #define BOOST_SPIRIT_ENUM_CONCRETE_PARSERS(z, N, _) \ + template < \ + typename ParserT, \ + BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(N), typename ScannerT), \ + typename AttrT \ + > \ + struct concrete_parser< \ + ParserT, \ + scanner_list< \ + BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(N), ScannerT) \ + >, \ + AttrT \ + > \ + : abstract_parser< \ + scanner_list< \ + BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(N), ScannerT) \ + >, \ + AttrT \ + > \ + { \ + concrete_parser(ParserT const& p_) : p(p_) {} \ + virtual ~concrete_parser() {} \ + \ + BOOST_PP_REPEAT_ ## z( \ + BOOST_PP_INC(N), BOOST_SPIRIT_RULE_ENUM_DOPARSE_C, _) \ + \ + virtual abstract_parser< \ + scanner_list< \ + BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(N), ScannerT) \ + >, \ + AttrT \ + >* \ + clone() const \ + { \ + return new concrete_parser(p); \ + } \ + \ + typename ParserT::embed_t p; \ + }; \ + + BOOST_PP_REPEAT_FROM_TO(1, BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT, + BOOST_SPIRIT_ENUM_CONCRETE_PARSERS, _) + + #undef BOOST_SPIRIT_ENUM_CONCRETE_PARSERS + #undef BOOST_SPIRIT_RULE_ENUM_DOPARSE_C + /////////////////////////////////////////////////////////////////////// + +#endif // BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 + + } // namespace impl + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/parser_context.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/parser_context.hpp new file mode 100644 index 0000000..2f7dd23 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/parser_context.hpp @@ -0,0 +1,150 @@ +/*============================================================================= + Copyright (c) 2002-2003 Joel de Guzman + Copyright (c) 2002-2003 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_PARSER_CONTEXT_HPP) +#define BOOST_SPIRIT_PARSER_CONTEXT_HPP + +/////////////////////////////////////////////////////////////////////////////// +namespace boost +{ + namespace spirit + { + BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + + /////////////////////////////////////////////////////////////////////////// + // + // default_parser_context_base class { default context base } + // + /////////////////////////////////////////////////////////////////////////// + struct default_parser_context_base + { + template + struct aux {}; + }; + + /////////////////////////////////////////////////////////////////////////// + // + // parser_context_base class { base class of all context classes } + // + /////////////////////////////////////////////////////////////////////////// + struct parser_context_base {}; + + /////////////////////////////////////////////////////////////////////////// + // + // parser_context class { default context } + // + /////////////////////////////////////////////////////////////////////////// + struct nil_t; + template struct parser_context_linker; + + template + struct parser_context : parser_context_base + { + typedef AttrT attr_t; + typedef default_parser_context_base base_t; + typedef parser_context_linker > context_linker_t; + + template + parser_context(ParserT const&) {} + + template + void + pre_parse(ParserT const&, ScannerT const&) {} + + template + ResultT& + post_parse(ResultT& hit, ParserT const&, ScannerT const&) + { return hit; } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // context_aux class + // + // context_aux is a class derived from the + // ContextT's nested base_t::base template class. (see + // default_parser_context_base::aux for an example). + // + // Basically, this class provides ContextT dependent optional + // functionality to the derived class DerivedT through the CRTP + // idiom (Curiously recurring template pattern). + // + /////////////////////////////////////////////////////////////////////////// + template + struct context_aux : public ContextT::base_t::template aux {}; + + /////////////////////////////////////////////////////////////////////////// + // + // parser_scanner_linker and parser_scanner_linker classes + // { helper templates for the rule extensibility } + // + // This classes can be 'overloaded' (defined elsewhere), to plug + // in additional functionality into the non-terminal parsing process. + // + /////////////////////////////////////////////////////////////////////////// + #if !defined(BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED) + #define BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED + + template + struct parser_scanner_linker : public ScannerT + { + parser_scanner_linker(ScannerT const scan_) : ScannerT(scan_) {} + }; + + #endif // !defined(BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED) + + ////////////////////////////////// + #if !defined(BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED) + #define BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED + + template + struct parser_context_linker : public ContextT + { + template + parser_context_linker(ParserT const& p) + : ContextT(p) {} + + template + void pre_parse(ParserT const& p, ScannerT const& scan) + { ContextT::pre_parse(p, scan); } + + template + ResultT& + post_parse(ResultT& hit, ParserT const& p, ScannerT const& scan) + { return ContextT::post_parse(hit, p, scan); } + }; + + #endif // !defined(BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED) + + /////////////////////////////////////////////////////////////////////////// + // + // BOOST_SPIRIT_CONTEXT_PARSE helper macro + // + // The original implementation uses a template class. However, we + // need to lessen the template instantiation depth to help inferior + // compilers that sometimes choke on deep template instantiations. + // The objective is to avoid code redundancy. A macro, in this case + // is an obvious solution. Sigh! + // + // WARNING: INTERNAL USE ONLY. NOT FOR PUBLIC CONSUMPTION. + // + /////////////////////////////////////////////////////////////////////////// + #define BOOST_SPIRIT_CONTEXT_PARSE(scan, this_, scanner_t, context_t, result_t) \ + scanner_t scan_wrap(scan); \ + context_t context_wrap(this_); \ + context_wrap.pre_parse(this_, scan_wrap); \ + result_t hit = parse_main(scan); \ + return context_wrap.post_parse(hit, this_, scan_wrap); + + BOOST_SPIRIT_CLASSIC_NAMESPACE_END + + } // namespace spirit +} // namespace boost + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/parser_id.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/parser_id.hpp new file mode 100644 index 0000000..bc465dc --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/parser_id.hpp @@ -0,0 +1,122 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2001 Daniel Nuffer + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_PARSER_ID_HPP) +#define BOOST_SPIRIT_PARSER_ID_HPP + +#if defined(BOOST_SPIRIT_DEBUG) +# include +#endif +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // parser_id class + // + /////////////////////////////////////////////////////////////////////////// + class parser_id + { + public: + parser_id() : p(0) {} + explicit parser_id(void const* prule) : p(prule) {} + parser_id(std::size_t l_) : l(l_) {} + + bool operator==(parser_id const& x) const { return p == x.p; } + bool operator!=(parser_id const& x) const { return !(*this == x); } + bool operator<(parser_id const& x) const { return p < x.p; } + std::size_t to_long() const { return l; } + + private: + + union + { + void const* p; + std::size_t l; + }; + }; + + #if defined(BOOST_SPIRIT_DEBUG) + inline std::ostream& + operator<<(std::ostream& out, parser_id const& rid) + { + out << (unsigned int)rid.to_long(); + return out; + } + #endif + + /////////////////////////////////////////////////////////////////////////// + // + // parser_tag_base class: base class of all parser tags + // + /////////////////////////////////////////////////////////////////////////// + struct parser_tag_base {}; + + /////////////////////////////////////////////////////////////////////////// + // + // parser_address_tag class: tags a parser with its address + // + /////////////////////////////////////////////////////////////////////////// + struct parser_address_tag : parser_tag_base + { + parser_id id() const + { return parser_id(reinterpret_cast(this)); } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // parser_tag class: tags a parser with an integer ID + // + /////////////////////////////////////////////////////////////////////////// + template + struct parser_tag : parser_tag_base + { + static parser_id id() + { return parser_id(std::size_t(N)); } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // dynamic_parser_tag class: tags a parser with a dynamically changeable + // integer ID + // + /////////////////////////////////////////////////////////////////////////// + class dynamic_parser_tag : public parser_tag_base + { + public: + + dynamic_parser_tag() + : tag(std::size_t(0)) {} + + parser_id + id() const + { + return + tag.to_long() + ? tag + : parser_id(reinterpret_cast(this)); + } + + void set_id(parser_id id_) { tag = id_; } + + private: + + parser_id tag; + }; + +/////////////////////////////////////////////////////////////////////////////// +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/rule.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/rule.hpp new file mode 100644 index 0000000..e905689 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/non_terminal/rule.hpp @@ -0,0 +1,175 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_RULE_HPP) +#define BOOST_SPIRIT_RULE_HPP + +#include + +/////////////////////////////////////////////////////////////////////////////// +// +// Spirit predefined maximum number of simultaneously usable different +// scanner types. +// +// This limit defines the maximum number of of possible different scanner +// types for which a specific rule<> may be used. If this isn't defined, a +// rule<> may be used with one scanner type only (multiple scanner support +// is disabled). +// +/////////////////////////////////////////////////////////////////////////////// +#if !defined(BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT) +# define BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT 1 +#endif + +// Ensure a meaningful maximum number of simultaneously usable scanner types +BOOST_STATIC_ASSERT(BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 0); + +#include +#include +#include + +#if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 +# include +#endif + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +#if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 + + /////////////////////////////////////////////////////////////////////////// + // + // scanner_list (a fake scanner) + // + // Typically, rules are tied to a specific scanner type and + // a particular rule cannot be used with anything else. Sometimes + // there's a need for rules that can accept more than one scanner + // type. The scanner_list can be used as a template + // parameter to the rule class to specify up to the number of + // scanner types defined by the BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT + // constant. Example: + // + // rule > r; + // + // *** This feature is available only to compilers that support + // partial template specialization. *** + // + /////////////////////////////////////////////////////////////////////////// + template < + BOOST_PP_ENUM_PARAMS( + BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT, + typename ScannerT + ) + > + struct scanner_list : scanner_base {}; + +#endif + + /////////////////////////////////////////////////////////////////////////// + // + // rule class + // + // The rule is a polymorphic parser that acts as a named place- + // holder capturing the behavior of an EBNF expression assigned to + // it. + // + // The rule is a template class parameterized by: + // + // 1) scanner (scanner_t, see scanner.hpp), + // 2) the rule's context (context_t, see parser_context.hpp) + // 3) an arbitrary tag (tag_t, see parser_id.hpp) that allows + // a rule to be tagged for identification. + // + // These template parameters may be specified in any order. The + // scanner will default to scanner<> when it is not specified. + // The context will default to parser_context when not specified. + // The tag will default to parser_address_tag when not specified. + // + // The definition of the rule (its right hand side, RHS) held by + // the rule through a scoped_ptr. When a rule is seen in the RHS + // of an assignment or copy construction EBNF expression, the rule + // is held by the LHS rule by reference. + // + /////////////////////////////////////////////////////////////////////////// + template < + typename T0 = nil_t + , typename T1 = nil_t + , typename T2 = nil_t + > + class rule + : public impl::rule_base< + rule + , rule const& + , T0, T1, T2> + { + public: + + typedef rule self_t; + typedef impl::rule_base< + self_t + , self_t const& + , T0, T1, T2> + base_t; + + typedef typename base_t::scanner_t scanner_t; + typedef typename base_t::attr_t attr_t; + typedef impl::abstract_parser abstract_parser_t; + + rule() : ptr() {} + ~rule() {} + + rule(rule const& r) + : ptr(new impl::concrete_parser(r)) {} + + template + rule(ParserT const& p) + : ptr(new impl::concrete_parser(p)) {} + + template + rule& operator=(ParserT const& p) + { + ptr.reset(new impl::concrete_parser(p)); + return *this; + } + + rule& operator=(rule const& r) + { + ptr.reset(new impl::concrete_parser(r)); + return *this; + } + + rule + copy() const + { + return rule(ptr.get() ? ptr->clone() : 0); + } + + private: + friend class impl::rule_base_access; + + abstract_parser_t* + get() const + { + return ptr.get(); + } + + rule(abstract_parser_t* ptr_) + : ptr(ptr_) {} + + rule(abstract_parser_t const* ptr_) + : ptr(ptr_) {} + + scoped_ptr ptr; + }; + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/parser.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/parser.hpp new file mode 100644 index 0000000..8f6bc6a --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/parser.hpp @@ -0,0 +1,223 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_PARSER_HPP) +#define BOOST_SPIRIT_PARSER_HPP + +#include +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + template + class action; // forward declaration + + /////////////////////////////////////////////////////////////////////////// + // + // Parser categories + // + // Helper template classes to distinguish different types of + // parsers. The following categories are the most generic. More + // specific types may inherit from these. Each parser has a typedef + // parser_category_t that defines its category. By default, if one + // is not specified, it will inherit from the base parser class + // which typedefs its parser_category_t as plain_parser_category. + // + // - plain parser has nothing special + // - binary parser has subject a and b (e.g. alternative) + // - unary parser has single subject (e.g. kleene star) + // - action parser has an attached action parser + // + /////////////////////////////////////////////////////////////////////////// + struct plain_parser_category {}; + struct binary_parser_category : plain_parser_category {}; + struct unary_parser_category : plain_parser_category {}; + struct action_parser_category : unary_parser_category {}; + + /////////////////////////////////////////////////////////////////////////// + // + // parser_result metafunction + // + // Given a scanner type ScannerT and a parser type ParserT, the + // parser_result metafunction provides the actual result of the + // parser. + // + // Usage: + // + // typename parser_result::type + // + /////////////////////////////////////////////////////////////////////////// + template + struct parser_result + { + typedef typename boost::remove_reference::type parser_type; + typedef typename parser_type::template result::type type; + }; + + /////////////////////////////////////////////////////////////////////////// + // + // parser class + // + // This class is a protocol base class for all parsers. This is + // essentially an interface contract. The parser class does not + // really know how to parse anything but instead relies on the + // template parameter DerivedT (which obviously is assumed to be a + // subclass) to do the actual parsing. + // + // Concrete sub-classes inheriting from parser must have a + // corresponding member function parse(...) compatible with the + // conceptual Interface: + // + // template + // RT parse(ScannerT const& scan) const; + // + // where RT is the desired return type of the parser and ScannerT + // scan is the scanner (see scanner.hpp). + // + // Concrete sub-classes inheriting from parser in most cases need to + // have a nested meta-function result that returns the result type + // of the parser's parse member function, given a scanner type. The + // meta-function has the form: + // + // template + // struct result + // { + // typedef RT type; + // }; + // + // where RT is the desired return type of the parser. This is + // usually, but not always, dependent on the template parameter + // ScannerT. If a parser does not supply a result metafunction, a + // default is provided by the base parser class. + // + // The parser's derived() member function returns a reference to the + // parser as its derived object. + // + // An operator[] is provided. The operator returns a semantic action + // handler (see actions.hpp). + // + // Each parser has a typedef embed_t. This typedef specifies how a + // parser is embedded in a composite (see composite.hpp). By + // default, if one is not specified, the parser will be embedded by + // value. That is, a copy of the parser is placed as a member + // variable of the composite. Most parsers are embedded by value. In + // certain situations however, this is not desirable or possible. + // + /////////////////////////////////////////////////////////////////////////// + template + struct parser + { + typedef DerivedT embed_t; + typedef DerivedT derived_t; + typedef plain_parser_category parser_category_t; + + template + struct result + { + typedef typename match_result::type type; + }; + + DerivedT& derived() + { + return *static_cast(this); + } + + DerivedT const& derived() const + { + return *static_cast(this); + } + + template + action + operator[](ActionT const& actor) const + { + return action(derived(), actor); + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // parse_info + // + // Results returned by the free parse functions: + // + // stop: points to the final parse position (i.e parsing + // processed the input up to this point). + // + // hit: true if parsing is successful. This may be full: + // the parser consumed all the input, or partial: + // the parser consumed only a portion of the input. + // + // full: true when we have a full hit (i.e the parser + // consumed all the input. + // + // length: The number of characters consumed by the parser. + // This is valid only if we have a successful hit + // (either partial or full). + // + /////////////////////////////////////////////////////////////////////////// + template + struct parse_info + { + IteratorT stop; + bool hit; + bool full; + std::size_t length; + + parse_info( + IteratorT const& stop_ = IteratorT(), + bool hit_ = false, + bool full_ = false, + std::size_t length_ = 0) + : stop(stop_) + , hit(hit_) + , full(full_) + , length(length_) {} + + template + parse_info(ParseInfoT const& pi) + : stop(pi.stop) + , hit(pi.hit) + , full(pi.full) + , length(pi.length) {} + }; + + /////////////////////////////////////////////////////////////////////////// + // + // Generic parse function + // + /////////////////////////////////////////////////////////////////////////// + template + parse_info + parse( + IteratorT const& first, + IteratorT const& last, + parser const& p); + + /////////////////////////////////////////////////////////////////////////// + // + // Parse function for null terminated strings + // + /////////////////////////////////////////////////////////////////////////// + template + parse_info + parse( + CharT const* str, + parser const& p); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/impl/numerics.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/impl/numerics.ipp new file mode 100644 index 0000000..19586f1 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/impl/numerics.ipp @@ -0,0 +1,478 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001-2003 Hartmut Kaiser + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_NUMERICS_IPP +#define BOOST_SPIRIT_NUMERICS_IPP + +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + struct sign_parser; // forward declaration only + + namespace impl + { + /////////////////////////////////////////////////////////////////////// + // + // Extract the prefix sign (- or +) + // + /////////////////////////////////////////////////////////////////////// + template + bool + extract_sign(ScannerT const& scan, std::size_t& count) + { + // Extract the sign + count = 0; + bool neg = *scan == '-'; + if (neg || (*scan == '+')) + { + ++scan; + ++count; + return neg; + } + + return false; + } + + /////////////////////////////////////////////////////////////////////// + // + // Traits class for radix specific number conversion + // + // Convert a digit from character representation, ch, to binary + // representation, returned in val. + // Returns whether the conversion was successful. + // + // template static bool digit(CharT ch, T& val); + // + /////////////////////////////////////////////////////////////////////// + template + struct radix_traits; + + ////////////////////////////////// Binary + template<> + struct radix_traits<2> + { + template + static bool digit(CharT ch, T& val) + { + val = ch - '0'; + return ('0' == ch || '1' == ch); + } + }; + + ////////////////////////////////// Octal + template<> + struct radix_traits<8> + { + template + static bool digit(CharT ch, T& val) + { + val = ch - '0'; + return ('0' <= ch && ch <= '7'); + } + }; + + ////////////////////////////////// Decimal + template<> + struct radix_traits<10> + { + template + static bool digit(CharT ch, T& val) + { + val = ch - '0'; + return impl::isdigit_(ch); + } + }; + + ////////////////////////////////// Hexadecimal + template<> + struct radix_traits<16> + { + template + static bool digit(CharT ch, T& val) + { + if (radix_traits<10>::digit(ch, val)) + return true; + + CharT lc = impl::tolower_(ch); + if ('a' <= lc && lc <= 'f') + { + val = lc - 'a' + 10; + return true; + } + return false; + } + }; + + /////////////////////////////////////////////////////////////////////// + // + // Helper templates for encapsulation of radix specific + // conversion of an input string to an integral value. + // + // main entry point: + // + // extract_int + // ::f(first, last, n, count); + // + // The template parameter Radix represents the radix of the + // number contained in the parsed string. The template + // parameter MinDigits specifies the minimum digits to + // accept. The template parameter MaxDigits specifies the + // maximum digits to parse. A -1 value for MaxDigits will + // make it parse an arbitrarilly large number as long as the + // numeric type can hold it. Accumulate is either + // positive_accumulate (default) for parsing positive + // numbers or negative_accumulate otherwise. + // Checking is only performed when std::numeric_limits:: + // is_specialized is true. Otherwise, there's no way to + // do the check. + // + // scan.first and scan.last are iterators as usual (i.e. + // first is mutable and is moved forward when a match is + // found), n is a variable that holds the number (passed by + // reference). The number of parsed characters is added to + // count (also passed by reference) + // + // NOTE: + // Returns a non-match, if the number to parse + // overflows (or underflows) the used type. + // + // BEWARE: + // the parameters 'n' and 'count' should be properly + // initialized before calling this function. + // + /////////////////////////////////////////////////////////////////////// +#if defined(BOOST_MSVC) +#pragma warning(push) +#pragma warning(disable:4127) //conditional expression is constant +#endif + + template + struct positive_accumulate + { + // Use this accumulator if number is positive + static bool add(T& n, T digit) + { + if (std::numeric_limits::is_specialized) + { + static T const max = (std::numeric_limits::max)(); + static T const max_div_radix = max/Radix; + + if (n > max_div_radix) + return false; + n *= Radix; + + if (n > max - digit) + return false; + n += digit; + + return true; + } + else + { + n *= Radix; + n += digit; + return true; + } + } + }; + + template + struct negative_accumulate + { + // Use this accumulator if number is negative + static bool add(T& n, T digit) + { + if (std::numeric_limits::is_specialized) + { + typedef std::numeric_limits num_limits; + static T const min = + (!num_limits::is_integer && num_limits::is_signed && num_limits::has_denorm) ? + -(num_limits::max)() : (num_limits::min)(); + static T const min_div_radix = min/Radix; + + if (n < min_div_radix) + return false; + n *= Radix; + + if (n < min + digit) + return false; + n -= digit; + + return true; + } + else + { + n *= Radix; + n -= digit; + return true; + } + } + }; + + template + inline bool allow_more_digits(std::size_t i) + { + return i < MaxDigits; + } + + template <> + inline bool allow_more_digits<-1>(std::size_t) + { + return true; + } + + ////////////////////////////////// + template < + int Radix, unsigned MinDigits, int MaxDigits, + typename Accumulate + > + struct extract_int + { + template + static bool + f(ScannerT& scan, T& n, std::size_t& count) + { + std::size_t i = 0; + T digit; + while( allow_more_digits(i) && !scan.at_end() && + radix_traits::digit(*scan, digit) ) + { + if (!Accumulate::add(n, digit)) + return false; // Overflow + ++i, ++scan, ++count; + } + return i >= MinDigits; + } + }; + + /////////////////////////////////////////////////////////////////////// + // + // uint_parser_impl class + // + /////////////////////////////////////////////////////////////////////// + template < + typename T = unsigned, + int Radix = 10, + unsigned MinDigits = 1, + int MaxDigits = -1 + > + struct uint_parser_impl + : parser > + { + typedef uint_parser_impl self_t; + + template + struct result + { + typedef typename match_result::type type; + }; + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + if (!scan.at_end()) + { + T n = 0; + std::size_t count = 0; + typename ScannerT::iterator_t save = scan.first; + if (extract_int >::f(scan, n, count)) + { + return scan.create_match(count, n, save, scan.first); + } + // return no-match if number overflows + } + return scan.no_match(); + } + }; + + /////////////////////////////////////////////////////////////////////// + // + // int_parser_impl class + // + /////////////////////////////////////////////////////////////////////// + template < + typename T = unsigned, + int Radix = 10, + unsigned MinDigits = 1, + int MaxDigits = -1 + > + struct int_parser_impl + : parser > + { + typedef int_parser_impl self_t; + + template + struct result + { + typedef typename match_result::type type; + }; + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef extract_int > extract_int_neg_t; + typedef extract_int > extract_int_pos_t; + + if (!scan.at_end()) + { + T n = 0; + std::size_t count = 0; + typename ScannerT::iterator_t save = scan.first; + + bool hit = impl::extract_sign(scan, count); + + if (hit) + hit = extract_int_neg_t::f(scan, n, count); + else + hit = extract_int_pos_t::f(scan, n, count); + + if (hit) + return scan.create_match(count, n, save, scan.first); + else + scan.first = save; + // return no-match if number overflows or underflows + } + return scan.no_match(); + } + }; + + /////////////////////////////////////////////////////////////////////// + // + // real_parser_impl class + // + /////////////////////////////////////////////////////////////////////// + template + struct real_parser_impl + { + typedef real_parser_impl self_t; + + template + RT parse_main(ScannerT const& scan) const + { + if (scan.at_end()) + return scan.no_match(); + typename ScannerT::iterator_t save = scan.first; + + typedef typename parser_result::type + sign_match_t; + typedef typename parser_result, ScannerT>::type + exp_match_t; + + sign_match_t sign_match = RealPoliciesT::parse_sign(scan); + std::size_t count = sign_match ? sign_match.length() : 0; + bool neg = sign_match.has_valid_attribute() ? + sign_match.value() : false; + + RT n_match = RealPoliciesT::parse_n(scan); + T n = n_match.has_valid_attribute() ? + n_match.value() : T(0); + bool got_a_number = n_match; + exp_match_t e_hit; + + if (!got_a_number && !RealPoliciesT::allow_leading_dot) + return scan.no_match(); + else + count += n_match.length(); + + if (neg) + n = -n; + + if (RealPoliciesT::parse_dot(scan)) + { + // We got the decimal point. Now we will try to parse + // the fraction if it is there. If not, it defaults + // to zero (0) only if we already got a number. + + if (RT hit = RealPoliciesT::parse_frac_n(scan)) + { +#if !defined(BOOST_NO_STDC_NAMESPACE) + using namespace std; // allow for ADL to find pow() +#endif + hit.value(hit.value() + * pow(T(10), T(-hit.length()))); + if (neg) + n -= hit.value(); + else + n += hit.value(); + count += hit.length() + 1; + + } + + else if (!got_a_number || + !RealPoliciesT::allow_trailing_dot) + return scan.no_match(); + + e_hit = RealPoliciesT::parse_exp(scan); + } + else + { + // We have reached a point where we + // still haven't seen a number at all. + // We return early with a no-match. + if (!got_a_number) + return scan.no_match(); + + // If we must expect a dot and we didn't see + // an exponent, return early with a no-match. + e_hit = RealPoliciesT::parse_exp(scan); + if (RealPoliciesT::expect_dot && !e_hit) + return scan.no_match(); + } + + if (e_hit) + { + // We got the exponent prefix. Now we will try to parse the + // actual exponent. It is an error if it is not there. + if (RT e_n_hit = RealPoliciesT::parse_exp_n(scan)) + { +#if !defined(BOOST_NO_STDC_NAMESPACE) + using namespace std; // allow for ADL to find pow() +#endif + n *= pow(T(10), T(e_n_hit.value())); + count += e_n_hit.length() + e_hit.length(); + } + else + { + // Oops, no exponent, return a no-match + return scan.no_match(); + } + } + + return scan.create_match(count, n, save, scan.first); + } + + template + static RT parse(ScannerT const& scan) + { + static self_t this_; + return impl::implicit_lexeme_parse(this_, scan, scan); + } + }; + +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + + } // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/impl/primitives.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/impl/primitives.ipp new file mode 100644 index 0000000..152e5b1 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/impl/primitives.ipp @@ -0,0 +1,476 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2003 Martin Wille + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_PRIMITIVES_IPP) +#define BOOST_SPIRIT_PRIMITIVES_IPP + +// This should eventually go to a config file. +#if defined(__GNUC__) && (__GNUC__ < 3) && !defined(_STLPORT_VERSION) +# ifndef BOOST_SPIRIT_NO_CHAR_TRAITS +# define BOOST_SPIRIT_NO_CHAR_TRAITS +# endif +#endif + +#include +#if !defined(BOOST_NO_CWCTYPE) +#include +#endif + +#ifndef BOOST_SPIRIT_NO_CHAR_TRAITS +# include // char_traits +#endif + +#if defined(BOOST_MSVC) +# pragma warning (push) +# pragma warning(disable:4800) +#endif + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + template struct char_parser; + + namespace impl + { + template + inline IteratorT + get_last(IteratorT first) + { + while (*first) + first++; + return first; + } + + template< + typename RT, + typename IteratorT, + typename ScannerT> + inline RT + string_parser_parse( + IteratorT str_first, + IteratorT str_last, + ScannerT& scan) + { + typedef typename ScannerT::iterator_t iterator_t; + iterator_t saved = scan.first; + std::size_t slen = str_last - str_first; + + while (str_first != str_last) + { + if (scan.at_end() || (*str_first != *scan)) + return scan.no_match(); + ++str_first; + ++scan; + } + + return scan.create_match(slen, nil_t(), saved, scan.first); + } + + /////////////////////////////////////////////////////////////////////////// + // + // Conversion from char_type to int_type + // + /////////////////////////////////////////////////////////////////////////// + +#ifndef BOOST_SPIRIT_NO_CHAR_TRAITS +# define BOOST_SPIRIT_CHAR_TRAITS_NAMESPACE std +#else + + template + struct char_traits + { + typedef CharT int_type; + typedef CharT char_type; + }; + + template<> + struct char_traits + { + typedef int int_type; + typedef char char_type; + + static char_type + to_char_type(int_type c) + { + return static_cast(c); + } + + static int + to_int_type(char c) + { + return static_cast(c); + } + }; + + template<> + struct char_traits + { + typedef int int_type; + typedef unsigned char char_type; + + static char_type + to_char_type(int_type c) + { + return static_cast(c); + } + + static int + to_int_type(unsigned char c) + { + return c; + } + }; + +# define BOOST_SPIRIT_CHAR_TRAITS_NAMESPACE impl +# ifndef BOOST_NO_CWCTYPE + + template<> + struct char_traits + { + typedef wint_t int_type; + typedef wchar_t char_type; + + static char_type + to_char_type(int_type c) + { + return static_cast(c); + } + + static wint_t + to_int_type(wchar_t c) + { + return c; + } + }; + +# endif +#endif // BOOST_SPIRIT_NO_CHAR_TRAITS + + // Use char_traits for char and wchar_t only, as these are the only + // specializations provided in the standard. Other types are on their + // own. + // + // For UDT, one may override: + // + // isalnum + // isalpha + // iscntrl + // isdigit + // isgraph + // islower + // isprint + // ispunct + // isspace + // isupper + // isxdigit + // isblank + // isupper + // tolower + // toupper + // + // in a namespace suitable for Argument Dependent lookup or in + // namespace std (disallowed by the standard). + + template + struct char_type_char_traits_helper + { + typedef CharT char_type; + typedef typename BOOST_SPIRIT_CHAR_TRAITS_NAMESPACE + ::char_traits::int_type int_type; + + static int_type to_int_type(CharT c) + { + return BOOST_SPIRIT_CHAR_TRAITS_NAMESPACE + ::char_traits::to_int_type(c); + } + + static char_type to_char_type(int_type i) + { + return BOOST_SPIRIT_CHAR_TRAITS_NAMESPACE + ::char_traits::to_char_type(i); + } + }; + + template + struct char_traits_helper + { + typedef CharT char_type; + typedef CharT int_type; + + static CharT & to_int_type(CharT & c) + { + return c; + } + + static CharT & to_char_type(CharT & c) + { + return c; + } + }; + + template <> + struct char_traits_helper + : char_type_char_traits_helper + { + }; + +#if !defined(BOOST_NO_CWCTYPE) + + template <> + struct char_traits_helper + : char_type_char_traits_helper + { + }; + +#endif + + template + inline typename char_traits_helper::int_type + to_int_type(CharT c) + { + return char_traits_helper::to_int_type(c); + } + + template + inline CharT + to_char_type(typename char_traits_helper::int_type c) + { + return char_traits_helper::to_char_type(c); + } + + /////////////////////////////////////////////////////////////////////// + // + // Convenience functions + // + /////////////////////////////////////////////////////////////////////// + + template + inline bool + isalnum_(CharT c) + { + using namespace std; + return isalnum(to_int_type(c)) ? true : false; + } + + template + inline bool + isalpha_(CharT c) + { + using namespace std; + return isalpha(to_int_type(c)) ? true : false; + } + + template + inline bool + iscntrl_(CharT c) + { + using namespace std; + return iscntrl(to_int_type(c)) ? true : false; + } + + template + inline bool + isdigit_(CharT c) + { + using namespace std; + return isdigit(to_int_type(c)) ? true : false; + } + + template + inline bool + isgraph_(CharT c) + { + using namespace std; + return isgraph(to_int_type(c)) ? true : false; + } + + template + inline bool + islower_(CharT c) + { + using namespace std; + return islower(to_int_type(c)) ? true : false; + } + + template + inline bool + isprint_(CharT c) + { + using namespace std; + return isprint(to_int_type(c)) ? true : false; + } + + template + inline bool + ispunct_(CharT c) + { + using namespace std; + return ispunct(to_int_type(c)) ? true : false; + } + + template + inline bool + isspace_(CharT c) + { + using namespace std; + return isspace(to_int_type(c)) ? true : false; + } + + template + inline bool + isupper_(CharT c) + { + using namespace std; + return isupper(to_int_type(c)) ? true : false; + } + + template + inline bool + isxdigit_(CharT c) + { + using namespace std; + return isxdigit(to_int_type(c)) ? true : false; + } + + template + inline bool + isblank_(CharT c) + { + return (c == ' ' || c == '\t'); + } + + template + inline CharT + tolower_(CharT c) + { + using namespace std; + return to_char_type(tolower(to_int_type(c))); + } + + template + inline CharT + toupper_(CharT c) + { + using namespace std; + return to_char_type(toupper(to_int_type(c))); + } + +#if !defined(BOOST_NO_CWCTYPE) + + inline bool + isalnum_(wchar_t c) + { + using namespace std; + return iswalnum(to_int_type(c)) ? true : false; + } + + inline bool + isalpha_(wchar_t c) + { + using namespace std; + return iswalpha(to_int_type(c)) ? true : false; + } + + inline bool + iscntrl_(wchar_t c) + { + using namespace std; + return iswcntrl(to_int_type(c)) ? true : false; + } + + inline bool + isdigit_(wchar_t c) + { + using namespace std; + return iswdigit(to_int_type(c)) ? true : false; + } + + inline bool + isgraph_(wchar_t c) + { + using namespace std; + return iswgraph(to_int_type(c)) ? true : false; + } + + inline bool + islower_(wchar_t c) + { + using namespace std; + return iswlower(to_int_type(c)) ? true : false; + } + + inline bool + isprint_(wchar_t c) + { + using namespace std; + return iswprint(to_int_type(c)) ? true : false; + } + + inline bool + ispunct_(wchar_t c) + { + using namespace std; + return iswpunct(to_int_type(c)) ? true : false; + } + + inline bool + isspace_(wchar_t c) + { + using namespace std; + return iswspace(to_int_type(c)) ? true : false; + } + + inline bool + isupper_(wchar_t c) + { + using namespace std; + return iswupper(to_int_type(c)) ? true : false; + } + + inline bool + isxdigit_(wchar_t c) + { + using namespace std; + return iswxdigit(to_int_type(c)) ? true : false; + } + + inline bool + isblank_(wchar_t c) + { + return (c == L' ' || c == L'\t'); + } + + inline wchar_t + tolower_(wchar_t c) + { + using namespace std; + return to_char_type(towlower(to_int_type(c))); + } + + inline wchar_t + toupper_(wchar_t c) + { + using namespace std; + return to_char_type(towupper(to_int_type(c))); + } + +#endif // !defined(BOOST_NO_CWCTYPE) + +} + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit::impl + +#ifdef BOOST_MSVC +#pragma warning (pop) +#endif + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/numerics.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/numerics.hpp new file mode 100644 index 0000000..20ea091 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/numerics.hpp @@ -0,0 +1,289 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2001-2003 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_NUMERICS_HPP +#define BOOST_SPIRIT_NUMERICS_HPP + +#include +#include +#include +#include + +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // uint_parser class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename T, + int Radix, + unsigned MinDigits, + int MaxDigits + > + struct uint_parser : parser > + { + typedef uint_parser self_t; + + template + struct result + { + typedef typename match_result::type type; + }; + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef impl::uint_parser_impl impl_t; + typedef typename parser_result::type result_t; + return impl::contiguous_parser_parse(impl_t(), scan, scan); + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // int_parser class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename T, + int Radix, + unsigned MinDigits, + int MaxDigits + > + struct int_parser : parser > + { + typedef int_parser self_t; + + template + struct result + { + typedef typename match_result::type type; + }; + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef impl::int_parser_impl impl_t; + typedef typename parser_result::type result_t; + return impl::contiguous_parser_parse(impl_t(), scan, scan); + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // uint_parser/int_parser instantiations + // + /////////////////////////////////////////////////////////////////////////// + int_parser const + int_p = int_parser(); + + uint_parser const + uint_p = uint_parser(); + + uint_parser const + bin_p = uint_parser(); + + uint_parser const + oct_p = uint_parser(); + + uint_parser const + hex_p = uint_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // sign_parser class + // + /////////////////////////////////////////////////////////////////////////// + namespace impl + { + // Utility to extract the prefix sign ('-' | '+') + template + bool extract_sign(ScannerT const& scan, std::size_t& count); + } + + struct sign_parser : public parser + { + typedef sign_parser self_t; + + template + struct result + { + typedef typename match_result::type type; + }; + + sign_parser() {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + if (!scan.at_end()) + { + std::size_t length; + typename ScannerT::iterator_t save(scan.first); + bool neg = impl::extract_sign(scan, length); + if (length) + return scan.create_match(1, neg, save, scan.first); + } + return scan.no_match(); + } + }; + + sign_parser const sign_p = sign_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // default real number policies + // + /////////////////////////////////////////////////////////////////////////// + template + struct ureal_parser_policies + { + // trailing dot policy suggested suggested by Gustavo Guerra + BOOST_STATIC_CONSTANT(bool, allow_leading_dot = true); + BOOST_STATIC_CONSTANT(bool, allow_trailing_dot = true); + BOOST_STATIC_CONSTANT(bool, expect_dot = false); + + typedef uint_parser uint_parser_t; + typedef int_parser int_parser_t; + + template + static typename match_result::type + parse_sign(ScannerT& scan) + { + return scan.no_match(); + } + + template + static typename parser_result::type + parse_n(ScannerT& scan) + { + return uint_parser_t().parse(scan); + } + + template + static typename parser_result, ScannerT>::type + parse_dot(ScannerT& scan) + { + return ch_p('.').parse(scan); + } + + template + static typename parser_result::type + parse_frac_n(ScannerT& scan) + { + return uint_parser_t().parse(scan); + } + + template + static typename parser_result, ScannerT>::type + parse_exp(ScannerT& scan) + { + return as_lower_d['e'].parse(scan); + } + + template + static typename parser_result::type + parse_exp_n(ScannerT& scan) + { + return int_parser_t().parse(scan); + } + }; + + template + struct real_parser_policies : public ureal_parser_policies + { + template + static typename parser_result::type + parse_sign(ScannerT& scan) + { + return sign_p.parse(scan); + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // real_parser class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename T, + typename RealPoliciesT + > + struct real_parser + : public parser > + { + typedef real_parser self_t; + + template + struct result + { + typedef typename match_result::type type; + }; + + real_parser() {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + return impl::real_parser_impl::parse(scan); + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // real_parser instantiations + // + /////////////////////////////////////////////////////////////////////////// + real_parser > const + ureal_p = real_parser >(); + + real_parser > const + real_p = real_parser >(); + + /////////////////////////////////////////////////////////////////////////// + // + // strict reals (do not allow plain integers (no decimal point)) + // + /////////////////////////////////////////////////////////////////////////// + template + struct strict_ureal_parser_policies : public ureal_parser_policies + { + BOOST_STATIC_CONSTANT(bool, expect_dot = true); + }; + + template + struct strict_real_parser_policies : public real_parser_policies + { + BOOST_STATIC_CONSTANT(bool, expect_dot = true); + }; + + real_parser > const + strict_ureal_p + = real_parser >(); + + real_parser > const + strict_real_p + = real_parser >(); + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/numerics_fwd.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/numerics_fwd.hpp new file mode 100644 index 0000000..b0f20d9 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/numerics_fwd.hpp @@ -0,0 +1,88 @@ +/*============================================================================= + Copyright (C) 2006 Tobias Schwinger + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_NUMERICS_FWD_HPP) +# define BOOST_SPIRIT_NUMERICS_FWD_HPP + +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // uint_parser class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename T = unsigned, + int Radix = 10, + unsigned MinDigits = 1, + int MaxDigits = -1 + > + struct uint_parser; + + /////////////////////////////////////////////////////////////////////////// + // + // int_parser class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename T = unsigned, + int Radix = 10, + unsigned MinDigits = 1, + int MaxDigits = -1 + > + struct int_parser; + + /////////////////////////////////////////////////////////////////////////// + // + // sign_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct sign_parser; + + /////////////////////////////////////////////////////////////////////////// + // + // default real number policies + // + /////////////////////////////////////////////////////////////////////////// + template + struct ureal_parser_policies; + + template + struct real_parser_policies; + + /////////////////////////////////////////////////////////////////////////// + // + // real_parser class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename T = double, + typename RealPoliciesT = ureal_parser_policies + > + struct real_parser; + + /////////////////////////////////////////////////////////////////////////// + // + // strict reals (do not allow plain integers (no decimal point)) + // + /////////////////////////////////////////////////////////////////////////// + template + struct strict_ureal_parser_policies; + + template + struct strict_real_parser_policies; + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/primitives.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/primitives.hpp new file mode 100644 index 0000000..d89585b --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/primitives/primitives.hpp @@ -0,0 +1,654 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + Copyright (c) 2003 Martin Wille + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_PRIMITIVES_HPP) +#define BOOST_SPIRIT_PRIMITIVES_HPP + +#include +#include +#include +#include +#include +#include + +#ifdef BOOST_MSVC +#pragma warning (push) +#pragma warning(disable : 4512) +#endif + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // char_parser class + // + /////////////////////////////////////////////////////////////////////////// + template + struct char_parser : public parser + { + typedef DerivedT self_t; + template + struct result + { + typedef typename match_result< + ScannerT, + typename ScannerT::value_t + >::type type; + }; + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + typedef typename ScannerT::value_t value_t; + typedef typename ScannerT::iterator_t iterator_t; + + if (!scan.at_end()) + { + value_t ch = *scan; + if (this->derived().test(ch)) + { + iterator_t save(scan.first); + ++scan.first; + return scan.create_match(1, ch, save, scan.first); + } + } + return scan.no_match(); + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // negation of char_parsers + // + /////////////////////////////////////////////////////////////////////////// + template + struct negated_char_parser + : public char_parser > + { + typedef negated_char_parser self_t; + typedef PositiveT positive_t; + + negated_char_parser(positive_t const& p) + : positive(p.derived()) {} + + template + bool test(T ch) const + { + return !positive.test(ch); + } + + positive_t const positive; + }; + + template + inline negated_char_parser + operator~(char_parser const& p) + { + return negated_char_parser(p.derived()); + } + + template + inline ParserT + operator~(negated_char_parser const& n) + { + return n.positive; + } + + /////////////////////////////////////////////////////////////////////////// + // + // chlit class + // + /////////////////////////////////////////////////////////////////////////// + template + struct chlit : public char_parser > + { + chlit(CharT ch_) + : ch(ch_) {} + + template + bool test(T ch_) const + { + return ch_ == ch; + } + + CharT ch; + }; + + template + inline chlit + ch_p(CharT ch) + { + return chlit(ch); + } + + // This should take care of ch_p("a") "bugs" + template + inline chlit + ch_p(CharT const (& str)[N]) + { + // ch_p's argument should be a single character or a null-terminated + // string with a single character + BOOST_STATIC_ASSERT(N < 3); + return chlit(str[0]); + } + + /////////////////////////////////////////////////////////////////////////// + // + // range class + // + /////////////////////////////////////////////////////////////////////////// + template + struct range : public char_parser > + { + range(CharT first_, CharT last_) + : first(first_), last(last_) + { + BOOST_SPIRIT_ASSERT(!(last < first)); + } + + template + bool test(T ch) const + { + return !(CharT(ch) < first) && !(last < CharT(ch)); + } + + CharT first; + CharT last; + }; + + template + inline range + range_p(CharT first, CharT last) + { + return range(first, last); + } + + /////////////////////////////////////////////////////////////////////////// + // + // chseq class + // + /////////////////////////////////////////////////////////////////////////// + template + class chseq : public parser > + { + public: + + typedef chseq self_t; + + chseq(IteratorT first_, IteratorT last_) + : first(first_), last(last_) {} + + chseq(IteratorT first_) + : first(first_), last(impl::get_last(first_)) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename boost::unwrap_reference::type striter_t; + typedef typename parser_result::type result_t; + return impl::string_parser_parse( + striter_t(first), + striter_t(last), + scan); + } + + private: + + IteratorT first; + IteratorT last; + }; + + template + inline chseq + chseq_p(CharT const* str) + { + return chseq(str); + } + + template + inline chseq + chseq_p(IteratorT first, IteratorT last) + { + return chseq(first, last); + } + + /////////////////////////////////////////////////////////////////////////// + // + // strlit class + // + /////////////////////////////////////////////////////////////////////////// + template + class strlit : public parser > + { + public: + + typedef strlit self_t; + + strlit(IteratorT first, IteratorT last) + : seq(first, last) {} + + strlit(IteratorT first) + : seq(first) {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typedef typename parser_result::type result_t; + return impl::contiguous_parser_parse + (seq, scan, scan); + } + + private: + + chseq seq; + }; + + template + inline strlit + str_p(CharT const* str) + { + return strlit(str); + } + + template + inline strlit + str_p(CharT * str) + { + return strlit(str); + } + + template + inline strlit + str_p(IteratorT first, IteratorT last) + { + return strlit(first, last); + } + + // This should take care of str_p('a') "bugs" + template + inline chlit + str_p(CharT ch) + { + return chlit(ch); + } + + /////////////////////////////////////////////////////////////////////////// + // + // nothing_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct nothing_parser : public parser + { + typedef nothing_parser self_t; + + nothing_parser() {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + return scan.no_match(); + } + }; + + nothing_parser const nothing_p = nothing_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // anychar_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct anychar_parser : public char_parser + { + typedef anychar_parser self_t; + + anychar_parser() {} + + template + bool test(CharT) const + { + return true; + } + }; + + anychar_parser const anychar_p = anychar_parser(); + + inline nothing_parser + operator~(anychar_parser) + { + return nothing_p; + } + + /////////////////////////////////////////////////////////////////////////// + // + // alnum_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct alnum_parser : public char_parser + { + typedef alnum_parser self_t; + + alnum_parser() {} + + template + bool test(CharT ch) const + { + return impl::isalnum_(ch); + } + }; + + alnum_parser const alnum_p = alnum_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // alpha_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct alpha_parser : public char_parser + { + typedef alpha_parser self_t; + + alpha_parser() {} + + template + bool test(CharT ch) const + { + return impl::isalpha_(ch); + } + }; + + alpha_parser const alpha_p = alpha_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // cntrl_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct cntrl_parser : public char_parser + { + typedef cntrl_parser self_t; + + cntrl_parser() {} + + template + bool test(CharT ch) const + { + return impl::iscntrl_(ch); + } + }; + + cntrl_parser const cntrl_p = cntrl_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // digit_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct digit_parser : public char_parser + { + typedef digit_parser self_t; + + digit_parser() {} + + template + bool test(CharT ch) const + { + return impl::isdigit_(ch); + } + }; + + digit_parser const digit_p = digit_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // graph_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct graph_parser : public char_parser + { + typedef graph_parser self_t; + + graph_parser() {} + + template + bool test(CharT ch) const + { + return impl::isgraph_(ch); + } + }; + + graph_parser const graph_p = graph_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // lower_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct lower_parser : public char_parser + { + typedef lower_parser self_t; + + lower_parser() {} + + template + bool test(CharT ch) const + { + return impl::islower_(ch); + } + }; + + lower_parser const lower_p = lower_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // print_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct print_parser : public char_parser + { + typedef print_parser self_t; + + print_parser() {} + + template + bool test(CharT ch) const + { + return impl::isprint_(ch); + } + }; + + print_parser const print_p = print_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // punct_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct punct_parser : public char_parser + { + typedef punct_parser self_t; + + punct_parser() {} + + template + bool test(CharT ch) const + { + return impl::ispunct_(ch); + } + }; + + punct_parser const punct_p = punct_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // blank_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct blank_parser : public char_parser + { + typedef blank_parser self_t; + + blank_parser() {} + + template + bool test(CharT ch) const + { + return impl::isblank_(ch); + } + }; + + blank_parser const blank_p = blank_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // space_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct space_parser : public char_parser + { + typedef space_parser self_t; + + space_parser() {} + + template + bool test(CharT ch) const + { + return impl::isspace_(ch); + } + }; + + space_parser const space_p = space_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // upper_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct upper_parser : public char_parser + { + typedef upper_parser self_t; + + upper_parser() {} + + template + bool test(CharT ch) const + { + return impl::isupper_(ch); + } + }; + + upper_parser const upper_p = upper_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // xdigit_parser class + // + /////////////////////////////////////////////////////////////////////////// + struct xdigit_parser : public char_parser + { + typedef xdigit_parser self_t; + + xdigit_parser() {} + + template + bool test(CharT ch) const + { + return impl::isxdigit_(ch); + } + }; + + xdigit_parser const xdigit_p = xdigit_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // eol_parser class (contributed by Martin Wille) + // + /////////////////////////////////////////////////////////////////////////// + struct eol_parser : public parser + { + typedef eol_parser self_t; + + eol_parser() {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + typename ScannerT::iterator_t save = scan.first; + std::size_t len = 0; + + if (!scan.at_end() && *scan == '\r') // CR + { + ++scan.first; + ++len; + } + + // Don't call skipper here + if (scan.first != scan.last && *scan == '\n') // LF + { + ++scan.first; + ++len; + } + + if (len) + return scan.create_match(len, nil_t(), save, scan.first); + return scan.no_match(); + } + }; + + eol_parser const eol_p = eol_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // end_parser class (suggested by Markus Schoepflin) + // + /////////////////////////////////////////////////////////////////////////// + struct end_parser : public parser + { + typedef end_parser self_t; + + end_parser() {} + + template + typename parser_result::type + parse(ScannerT const& scan) const + { + if (scan.at_end()) + return scan.empty_match(); + return scan.no_match(); + } + }; + + end_parser const end_p = end_parser(); + + /////////////////////////////////////////////////////////////////////////// + // + // the pizza_p parser :-) + // + /////////////////////////////////////////////////////////////////////////// + inline strlit const + pizza_p(char const* your_favorite_pizza) + { + return your_favorite_pizza; + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#ifdef BOOST_MSVC +#pragma warning (pop) +#endif + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/safe_bool.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/safe_bool.hpp new file mode 100644 index 0000000..73b6e7b --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/safe_bool.hpp @@ -0,0 +1,64 @@ +/*============================================================================= + Copyright (c) 2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SAFE_BOOL_HPP) +#define BOOST_SPIRIT_SAFE_BOOL_HPP + +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + namespace impl + { + template + struct no_base {}; + + template + struct safe_bool_impl + { +#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) + void stub(T*) {}; + typedef void (safe_bool_impl::*type)(T*); +#else + typedef T* TP; // workaround to make parsing easier + TP stub; + typedef TP safe_bool_impl::*type; +#endif + }; + } + + template > + struct safe_bool : BaseT + { + private: + typedef impl::safe_bool_impl impl_t; + typedef typename impl_t::type bool_type; + + public: + operator bool_type() const + { + return static_cast(this)->operator_bool() ? + &impl_t::stub : 0; + } + + operator bool_type() + { + return static_cast(this)->operator_bool() ? + &impl_t::stub : 0; + } + }; + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/impl/skipper.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/impl/skipper.ipp new file mode 100644 index 0000000..fab74bd --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/impl/skipper.ipp @@ -0,0 +1,181 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + 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) +============================================================================*/ +#if !defined(BOOST_SPIRIT_SKIPPER_IPP) +#define BOOST_SPIRIT_SKIPPER_IPP + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + struct space_parser; + template + struct no_skipper_iteration_policy; + + namespace impl + { + template + inline void + skipper_skip( + ST const& s, + ScannerT const& scan, + skipper_iteration_policy const&) + { + typedef scanner_policies< + no_skipper_iteration_policy< + BOOST_DEDUCED_TYPENAME ScannerT::iteration_policy_t>, + BOOST_DEDUCED_TYPENAME ScannerT::match_policy_t, + BOOST_DEDUCED_TYPENAME ScannerT::action_policy_t + > policies_t; + + scanner + scan2(scan.first, scan.last, policies_t(scan)); + typedef typename ScannerT::iterator_t iterator_t; + + for (;;) + { + iterator_t save = scan.first; + if (!s.parse(scan2)) + { + scan.first = save; + break; + } + } + } + + template + inline void + skipper_skip( + ST const& s, + ScannerT const& scan, + no_skipper_iteration_policy const&) + { + for (;;) + { + typedef typename ScannerT::iterator_t iterator_t; + iterator_t save = scan.first; + if (!s.parse(scan)) + { + scan.first = save; + break; + } + } + } + + template + inline void + skipper_skip( + ST const& s, + ScannerT const& scan, + iteration_policy const&) + { + for (;;) + { + typedef typename ScannerT::iterator_t iterator_t; + iterator_t save = scan.first; + if (!s.parse(scan)) + { + scan.first = save; + break; + } + } + } + + template + struct phrase_parser + { + template + static parse_info + parse( + IteratorT const& first_, + IteratorT const& last, + ParserT const& p, + SkipT const& skip) + { + typedef skip_parser_iteration_policy iter_policy_t; + typedef scanner_policies scanner_policies_t; + typedef scanner scanner_t; + + iter_policy_t iter_policy(skip); + scanner_policies_t policies(iter_policy); + IteratorT first = first_; + scanner_t scan(first, last, policies); + match hit = p.parse(scan); + return parse_info( + first, hit, hit && (first == last), + hit.length()); + } + }; + + template <> + struct phrase_parser + { + template + static parse_info + parse( + IteratorT const& first_, + IteratorT const& last, + ParserT const& p, + space_parser const&) + { + typedef skipper_iteration_policy<> iter_policy_t; + typedef scanner_policies scanner_policies_t; + typedef scanner scanner_t; + + IteratorT first = first_; + scanner_t scan(first, last); + match hit = p.parse(scan); + return parse_info( + first, hit, hit && (first == last), + hit.length()); + } + }; + } + + /////////////////////////////////////////////////////////////////////////// + // + // Free parse functions using the skippers + // + /////////////////////////////////////////////////////////////////////////// + template + inline parse_info + parse( + IteratorT const& first, + IteratorT const& last, + parser const& p, + parser const& skip) + { + return impl::phrase_parser:: + parse(first, last, p.derived(), skip.derived()); + } + + /////////////////////////////////////////////////////////////////////////// + // + // Parse function for null terminated strings using the skippers + // + /////////////////////////////////////////////////////////////////////////// + template + inline parse_info + parse( + CharT const* str, + parser const& p, + parser const& skip) + { + CharT const* last = str; + while (*last) + last++; + return parse(str, last, p, skip); + } + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/scanner.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/scanner.hpp new file mode 100644 index 0000000..3854877 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/scanner.hpp @@ -0,0 +1,329 @@ +/*============================================================================= + Copyright (c) 1998-2002 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SCANNER_HPP) +#define BOOST_SPIRIT_SCANNER_HPP + +#include +#include +#include +#include +#include +#include // for boost::detail::iterator_traits + +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // iteration_policy class + // + /////////////////////////////////////////////////////////////////////////// + struct iteration_policy + { + template + void + advance(ScannerT const& scan) const + { + ++scan.first; + } + + template + bool at_end(ScannerT const& scan) const + { + return scan.first == scan.last; + } + + template + T filter(T ch) const + { + return ch; + } + + template + typename ScannerT::ref_t + get(ScannerT const& scan) const + { + return *scan.first; + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // match_policy class + // + /////////////////////////////////////////////////////////////////////////// + struct match_policy + { + template + struct result { typedef match type; }; + + const match + no_match() const + { + return match(); + } + + const match + empty_match() const + { + return match(0, nil_t()); + } + + template + match + create_match( + std::size_t length, + AttrT const& val, + IteratorT const& /*first*/, + IteratorT const& /*last*/) const + { + return match(length, val); + } + + template + void group_match( + MatchT& /*m*/, + parser_id const& /*id*/, + IteratorT const& /*first*/, + IteratorT const& /*last*/) const {} + + template + void concat_match(Match1T& l, Match2T const& r) const + { + l.concat(r); + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // match_result class + // + /////////////////////////////////////////////////////////////////////////// + template + struct match_result + { + typedef typename MatchPolicyT::template result::type type; + }; + + /////////////////////////////////////////////////////////////////////////// + // + // action_policy class + // + /////////////////////////////////////////////////////////////////////////// + template + struct attributed_action_policy + { + template + static void + call( + ActorT const& actor, + AttrT& val, + IteratorT const&, + IteratorT const&) + { + actor(val); + } + }; + + ////////////////////////////////// + template <> + struct attributed_action_policy + { + template + static void + call( + ActorT const& actor, + nil_t, + IteratorT const& first, + IteratorT const& last) + { + actor(first, last); + } + }; + + ////////////////////////////////// + struct action_policy + { + template + void + do_action( + ActorT const& actor, + AttrT& val, + IteratorT const& first, + IteratorT const& last) const + { + attributed_action_policy::call(actor, val, first, last); + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // scanner_policies class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename IterationPolicyT, + typename MatchPolicyT, + typename ActionPolicyT> + struct scanner_policies : + public IterationPolicyT, + public MatchPolicyT, + public ActionPolicyT + { + typedef IterationPolicyT iteration_policy_t; + typedef MatchPolicyT match_policy_t; + typedef ActionPolicyT action_policy_t; + + scanner_policies( + IterationPolicyT const& i_policy = IterationPolicyT(), + MatchPolicyT const& m_policy = MatchPolicyT(), + ActionPolicyT const& a_policy = ActionPolicyT()) + : IterationPolicyT(i_policy) + , MatchPolicyT(m_policy) + , ActionPolicyT(a_policy) {} + + template + scanner_policies(ScannerPoliciesT const& policies) + : IterationPolicyT(policies) + , MatchPolicyT(policies) + , ActionPolicyT(policies) {} + }; + + /////////////////////////////////////////////////////////////////////////// + // + // scanner_policies_base class: the base class of all scanners + // + /////////////////////////////////////////////////////////////////////////// + struct scanner_base {}; + + /////////////////////////////////////////////////////////////////////////// + // + // scanner class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename IteratorT, + typename PoliciesT> + class scanner : public PoliciesT, public scanner_base + { + public: + + typedef IteratorT iterator_t; + typedef PoliciesT policies_t; + + typedef typename boost::detail:: + iterator_traits::value_type value_t; + typedef typename boost::detail:: + iterator_traits::reference ref_t; + typedef typename boost:: + call_traits::param_type iter_param_t; + + scanner( + IteratorT& first_, + iter_param_t last_, + PoliciesT const& policies = PoliciesT()) + : PoliciesT(policies), first(first_), last(last_) + { + at_end(); + } + + scanner(scanner const& other) + : PoliciesT(other), first(other.first), last(other.last) {} + + scanner(scanner const& other, IteratorT& first_) + : PoliciesT(other), first(first_), last(other.last) {} + + template + scanner(scanner const& other) + : PoliciesT(other), first(other.first), last(other.last) {} + + bool + at_end() const + { + typedef typename PoliciesT::iteration_policy_t iteration_policy_type; + return iteration_policy_type::at_end(*this); + } + + value_t + operator*() const + { + typedef typename PoliciesT::iteration_policy_t iteration_policy_type; + return iteration_policy_type::filter(iteration_policy_type::get(*this)); + } + + scanner const& + operator++() const + { + typedef typename PoliciesT::iteration_policy_t iteration_policy_type; + iteration_policy_type::advance(*this); + return *this; + } + + template + struct rebind_policies + { + typedef scanner type; + }; + + template + scanner + change_policies(PoliciesT2 const& policies) const + { + return scanner(first, last, policies); + } + + template + struct rebind_iterator + { + typedef scanner type; + }; + + template + scanner + change_iterator(IteratorT2 const& first_, IteratorT2 const &last_) const + { + return scanner(first_, last_, *this); + } + + IteratorT& first; + IteratorT const last; + + private: + + scanner& + operator=(scanner const& other); + }; + + /////////////////////////////////////////////////////////////////////////// + // + // rebind_scanner_policies class + // + /////////////////////////////////////////////////////////////////////////// + template + struct rebind_scanner_policies + { + typedef typename ScannerT::template + rebind_policies::type type; + }; + + ////////////////////////////////// + template + struct rebind_scanner_iterator + { + typedef typename ScannerT::template + rebind_iterator::type type; + }; + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/scanner_fwd.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/scanner_fwd.hpp new file mode 100644 index 0000000..efd78cf --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/scanner_fwd.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 2006 Tobias Schwinger + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SCANNER_FWD_HPP) +#define BOOST_SPIRIT_SCANNER_FWD_HPP + +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // policy classes + // + /////////////////////////////////////////////////////////////////////////// + struct iteration_policy; + struct action_policy; + struct match_policy; + + /////////////////////////////////////////////////////////////////////////// + // + // scanner_policies class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename IterationPolicyT = iteration_policy, + typename MatchPolicyT = match_policy, + typename ActionPolicyT = action_policy> + struct scanner_policies; + + /////////////////////////////////////////////////////////////////////////// + // + // scanner class + // + /////////////////////////////////////////////////////////////////////////// + template < + typename IteratorT = char const*, + typename PoliciesT = scanner_policies<> > + class scanner; + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/skipper.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/skipper.hpp new file mode 100644 index 0000000..4e655ae --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/skipper.hpp @@ -0,0 +1,197 @@ +/*============================================================================= + Copyright (c) 1998-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SKIPPER_HPP) +#define BOOST_SPIRIT_SKIPPER_HPP + +/////////////////////////////////////////////////////////////////////////////// +#include + +#include +#include +#include + +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // skipper_iteration_policy class + // + /////////////////////////////////////////////////////////////////////////// + template + struct skipper_iteration_policy : public BaseT + { + typedef BaseT base_t; + + skipper_iteration_policy() + : BaseT() {} + + template + skipper_iteration_policy(PolicyT const& other) + : BaseT(other) {} + + template + void + advance(ScannerT const& scan) const + { + BaseT::advance(scan); + scan.skip(scan); + } + + template + bool + at_end(ScannerT const& scan) const + { + scan.skip(scan); + return BaseT::at_end(scan); + } + + template + void + skip(ScannerT const& scan) const + { + while (!BaseT::at_end(scan) && impl::isspace_(BaseT::get(scan))) + BaseT::advance(scan); + } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // no_skipper_iteration_policy class + // + /////////////////////////////////////////////////////////////////////////// + template + struct no_skipper_iteration_policy : public BaseT + { + typedef BaseT base_t; + + no_skipper_iteration_policy() + : BaseT() {} + + template + no_skipper_iteration_policy(PolicyT const& other) + : BaseT(other) {} + + template + void + skip(ScannerT const& /*scan*/) const {} + }; + + /////////////////////////////////////////////////////////////////////////// + // + // skip_parser_iteration_policy class + // + /////////////////////////////////////////////////////////////////////////// + namespace impl + { + template + void + skipper_skip( + ST const& s, + ScannerT const& scan, + skipper_iteration_policy const&); + + template + void + skipper_skip( + ST const& s, + ScannerT const& scan, + no_skipper_iteration_policy const&); + + template + void + skipper_skip( + ST const& s, + ScannerT const& scan, + iteration_policy const&); + } + + template + class skip_parser_iteration_policy : public skipper_iteration_policy + { + public: + + typedef skipper_iteration_policy base_t; + + skip_parser_iteration_policy( + ParserT const& skip_parser, + base_t const& base = base_t()) + : base_t(base), subject(skip_parser) {} + + template + skip_parser_iteration_policy(PolicyT const& other) + : base_t(other), subject(other.skipper()) {} + + template + void + skip(ScannerT const& scan) const + { + impl::skipper_skip(subject, scan, scan); + } + + ParserT const& + skipper() const + { + return subject; + } + + private: + + ParserT const& subject; + }; + + /////////////////////////////////////////////////////////////////////////////// + // + // Free parse functions using the skippers + // + /////////////////////////////////////////////////////////////////////////////// + template + parse_info + parse( + IteratorT const& first, + IteratorT const& last, + parser const& p, + parser const& skip); + + /////////////////////////////////////////////////////////////////////////////// + // + // Parse function for null terminated strings using the skippers + // + /////////////////////////////////////////////////////////////////////////////// + template + parse_info + parse( + CharT const* str, + parser const& p, + parser const& skip); + + /////////////////////////////////////////////////////////////////////////////// + // + // phrase_scanner_t and wide_phrase_scanner_t + // + // The most common scanners. Use these typedefs when you need + // a scanner that skips white spaces. + // + /////////////////////////////////////////////////////////////////////////////// + typedef skipper_iteration_policy<> iter_policy_t; + typedef scanner_policies scanner_policies_t; + typedef scanner phrase_scanner_t; + typedef scanner wide_phrase_scanner_t; + + /////////////////////////////////////////////////////////////////////////////// + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#include +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/skipper_fwd.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/skipper_fwd.hpp new file mode 100644 index 0000000..228e618 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/core/scanner/skipper_fwd.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2006 Tobias Schwinger + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_SKIPPER_FWD_HPP) +#define BOOST_SPIRIT_SKIPPER_FWD_HPP + +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + template + struct skipper_iteration_policy; + + template + struct no_skipper_iteration_policy; + + template + class skip_parser_iteration_policy; + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/debug.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/debug.hpp new file mode 100644 index 0000000..9737b35 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/debug.hpp @@ -0,0 +1,154 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2002-2003 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_DEBUG_MAIN_HPP) +#define BOOST_SPIRIT_DEBUG_MAIN_HPP + +/////////////////////////////////////////////////////////////////////////// +#if defined(BOOST_SPIRIT_DEBUG) + +#include + +/////////////////////////////////////////////////////////////////////////////// +// +// Spirit.Debug includes and defines +// +/////////////////////////////////////////////////////////////////////////////// + + #include + + /////////////////////////////////////////////////////////////////////////// + // + // The BOOST_SPIRIT_DEBUG_OUT defines the stream object, which should be used + // for debug diagnostics. This defaults to std::cout. + // + /////////////////////////////////////////////////////////////////////////// + #if !defined(BOOST_SPIRIT_DEBUG_OUT) + #define BOOST_SPIRIT_DEBUG_OUT std::cout + #endif + + /////////////////////////////////////////////////////////////////////////// + // + // The BOOST_SPIRIT_DEBUG_PRINT_SOME constant defines the number of characters + // from the stream to be printed for diagnosis. This defaults to the first + // 20 characters. + // + /////////////////////////////////////////////////////////////////////////// + #if !defined(BOOST_SPIRIT_DEBUG_PRINT_SOME) + #define BOOST_SPIRIT_DEBUG_PRINT_SOME 20 + #endif + + /////////////////////////////////////////////////////////////////////////// + // + // Additional BOOST_SPIRIT_DEBUG_FLAGS control the level of diagnostics printed + // Basic constants are defined in debug/minimal.hpp. + // + /////////////////////////////////////////////////////////////////////////// + #define BOOST_SPIRIT_DEBUG_FLAGS_NODES 0x0001 // node diagnostics + #define BOOST_SPIRIT_DEBUG_FLAGS_ESCAPE_CHAR 0x0002 // escape_char_parse diagnostics + #define BOOST_SPIRIT_DEBUG_FLAGS_TREES 0x0004 // parse tree/ast diagnostics + #define BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES 0x0008 // closure diagnostics + #define BOOST_SPIRIT_DEBUG_FLAGS_SLEX 0x8000 // slex diagnostics + + #define BOOST_SPIRIT_DEBUG_FLAGS_MAX 0xFFFF // print maximal diagnostics + + #if !defined(BOOST_SPIRIT_DEBUG_FLAGS) + #define BOOST_SPIRIT_DEBUG_FLAGS BOOST_SPIRIT_DEBUG_FLAGS_MAX + #endif + + /////////////////////////////////////////////////////////////////////////// + // + // By default all nodes are traced (even those, not registered with + // BOOST_SPIRIT_DEBUG_RULE et.al. - see below). The following constant may be + // used to redefine this default. + // + /////////////////////////////////////////////////////////////////////////// + #if !defined(BOOST_SPIRIT_DEBUG_TRACENODE) + #define BOOST_SPIRIT_DEBUG_TRACENODE (true) + #endif // !defined(BOOST_SPIRIT_DEBUG_TRACENODE) + + /////////////////////////////////////////////////////////////////////////// + // + // Helper macros for giving rules and subrules a name accessible through + // parser_name() functions (see parser_names.hpp). + // + // Additionally, the macros BOOST_SPIRIT_DEBUG_RULE, SPIRIT_DEBUG_NODE and + // BOOST_SPIRIT_DEBUG_GRAMMAR enable/disable the tracing of the + // correspondingnode accordingly to the PP constant + // BOOST_SPIRIT_DEBUG_TRACENODE. + // + // The macros BOOST_SPIRIT_DEBUG_TRACE_RULE, BOOST_SPIRIT_DEBUG_TRACE_NODE + // and BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR allow to specify a flag to define, + // whether the corresponding node is to be traced or not. + // + /////////////////////////////////////////////////////////////////////////// + #if !defined(BOOST_SPIRIT_DEBUG_RULE) + #define BOOST_SPIRIT_DEBUG_RULE(r) \ + ::BOOST_SPIRIT_CLASSIC_NS::impl::get_node_registry(). \ + register_node(&r, #r, BOOST_SPIRIT_DEBUG_TRACENODE) + #endif // !defined(BOOST_SPIRIT_DEBUG_RULE) + + #if !defined(BOOST_SPIRIT_DEBUG_NODE) + #define BOOST_SPIRIT_DEBUG_NODE(r) \ + ::BOOST_SPIRIT_CLASSIC_NS::impl::get_node_registry(). \ + register_node(&r, #r, BOOST_SPIRIT_DEBUG_TRACENODE) + #endif // !defined(BOOST_SPIRIT_DEBUG_NODE) + + #if !defined(BOOST_SPIRIT_DEBUG_GRAMMAR) + #define BOOST_SPIRIT_DEBUG_GRAMMAR(r) \ + ::BOOST_SPIRIT_CLASSIC_NS::impl::get_node_registry(). \ + register_node(&r, #r, BOOST_SPIRIT_DEBUG_TRACENODE) + #endif // !defined(BOOST_SPIRIT_DEBUG_GRAMMAR) + + #if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE) + #define BOOST_SPIRIT_DEBUG_TRACE_RULE(r, t) \ + ::BOOST_SPIRIT_CLASSIC_NS::impl::get_node_registry(). \ + register_node(&r, #r, (t)) + #endif // !defined(BOOST_SPIRIT_TRACE_RULE) + + #if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE) + #define BOOST_SPIRIT_DEBUG_TRACE_NODE(r, t) \ + ::BOOST_SPIRIT_CLASSIC_NS::impl::get_node_registry(). \ + register_node(&r, #r, (t)) + #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE) + + #if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR) + #define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR(r, t) \ + ::BOOST_SPIRIT_CLASSIC_NS::impl::get_node_registry(). \ + register_node(&r, #r, (t)) + #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR) + + #if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME) + #define BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME(r, n, t) \ + ::BOOST_SPIRIT_CLASSIC_NS::impl::get_node_registry(). \ + register_node(&r, (n), (t)) + #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME) + + #if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME) + #define BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME(r, n, t) \ + ::BOOST_SPIRIT_CLASSIC_NS::impl::get_node_registry(). \ + register_node(&r, (n), (t)) + #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME) + + #if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME) + #define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME(r, n, t) \ + ::BOOST_SPIRIT_CLASSIC_NS::impl::get_node_registry(). \ + register_node(&r, (n), (t)) + #endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME) + + ////////////////////////////////// + #include + +#else + ////////////////////////////////// + #include + +#endif // BOOST_SPIRIT_DEBUG + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/debug/debug_node.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/debug/debug_node.hpp new file mode 100644 index 0000000..adc1f91 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/debug/debug_node.hpp @@ -0,0 +1,319 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2002-2003 Hartmut Kaiser + Copyright (c) 2003 Gustavo Guerra + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_DEBUG_NODE_HPP) +#define BOOST_SPIRIT_DEBUG_NODE_HPP + +#if !defined(BOOST_SPIRIT_DEBUG_MAIN_HPP) +#error "You must include boost/spirit/debug.hpp, not boost/spirit/debug/debug_node.hpp" +#endif + +#if defined(BOOST_SPIRIT_DEBUG) + +#include + +#include +#include +#include +#include +#include // for iscntrl_ + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// +// Debug helper classes for rules, which ensure maximum non-intrusiveness of +// the Spirit debug support +// +/////////////////////////////////////////////////////////////////////////////// + +namespace impl { + + struct token_printer_aux_for_chars + { + template + static void print(std::ostream& o, CharT c) + { + if (c == static_cast('\a')) + o << "\\a"; + + else if (c == static_cast('\b')) + o << "\\b"; + + else if (c == static_cast('\f')) + o << "\\f"; + + else if (c == static_cast('\n')) + o << "\\n"; + + else if (c == static_cast('\r')) + o << "\\r"; + + else if (c == static_cast('\t')) + o << "\\t"; + + else if (c == static_cast('\v')) + o << "\\v"; + + else if (iscntrl_(c)) + o << "\\" << static_cast(c); + + else + o << static_cast(c); + } + }; + + // for token types where the comparison with char constants wouldn't work + struct token_printer_aux_for_other_types + { + template + static void print(std::ostream& o, CharT c) + { + o << c; + } + }; + + template + struct token_printer_aux + : mpl::if_< + mpl::and_< + is_convertible, + is_convertible >, + token_printer_aux_for_chars, + token_printer_aux_for_other_types + >::type + { + }; + + template + inline void token_printer(std::ostream& o, CharT c) + { + #if !defined(BOOST_SPIRIT_DEBUG_TOKEN_PRINTER) + + token_printer_aux::print(o, c); + + #else + + BOOST_SPIRIT_DEBUG_TOKEN_PRINTER(o, c); + + #endif + } + +/////////////////////////////////////////////////////////////////////////////// +// +// Dump infos about the parsing state of a rule +// +/////////////////////////////////////////////////////////////////////////////// + +#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES + template + inline void + print_node_info(bool hit, int level, bool close, std::string const& name, + IteratorT first, IteratorT last) + { + if (!name.empty()) + { + for (int i = 0; i < level; ++i) + BOOST_SPIRIT_DEBUG_OUT << " "; + if (close) + { + if (hit) + BOOST_SPIRIT_DEBUG_OUT << "/"; + else + BOOST_SPIRIT_DEBUG_OUT << "#"; + } + BOOST_SPIRIT_DEBUG_OUT << name << ":\t\""; + IteratorT iter = first; + IteratorT ilast = last; + for (int j = 0; j < BOOST_SPIRIT_DEBUG_PRINT_SOME; ++j) + { + if (iter == ilast) + break; + + token_printer(BOOST_SPIRIT_DEBUG_OUT, *iter); + ++iter; + } + BOOST_SPIRIT_DEBUG_OUT << "\"\n"; + } + } +#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES + +#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES + template + inline ResultT & + print_closure_info(ResultT &hit, int level, std::string const& name) + { + if (!name.empty()) + { + for (int i = 0; i < level-1; ++i) + BOOST_SPIRIT_DEBUG_OUT << " "; + + // for now, print out the return value only + BOOST_SPIRIT_DEBUG_OUT << "^" << name << ":\t"; + if (hit.has_valid_attribute()) + BOOST_SPIRIT_DEBUG_OUT << hit.value(); + else + BOOST_SPIRIT_DEBUG_OUT << "undefined attribute"; + BOOST_SPIRIT_DEBUG_OUT << "\n"; + } + return hit; + } +#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES + +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Implementation note: The parser_context_linker, parser_scanner_linker and +// closure_context_linker classes are wrapped by a PP constant to allow +// redefinition of this classes outside of Spirit +// +/////////////////////////////////////////////////////////////////////////////// +#if !defined(BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED) +#define BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED + + /////////////////////////////////////////////////////////////////////////// + // + // parser_context_linker is a debug wrapper for the ContextT template + // parameter of the rule<>, subrule<> and the grammar<> classes + // + /////////////////////////////////////////////////////////////////////////// + template + struct parser_context_linker : public ContextT + { + typedef ContextT base_t; + + template + parser_context_linker(ParserT const& p) + : ContextT(p) {} + + template + void pre_parse(ParserT const& p, ScannerT &scan) + { + this->base_t::pre_parse(p, scan); + +#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES + if (trace_parser(p.derived())) { + impl::print_node_info( + false, + scan.get_level(), + false, + parser_name(p.derived()), + scan.first, + scan.last); + } + scan.get_level()++; +#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES + } + + template + ResultT& post_parse(ResultT& hit, ParserT const& p, ScannerT &scan) + { +#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES + --scan.get_level(); + if (trace_parser(p.derived())) { + impl::print_node_info( + hit, + scan.get_level(), + true, + parser_name(p.derived()), + scan.first, + scan.last); + } +#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_NODES + + return this->base_t::post_parse(hit, p, scan); + } + }; + +#endif // !defined(BOOST_SPIRIT_PARSER_CONTEXT_LINKER_DEFINED) + +#if !defined(BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED) +#define BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED + +/////////////////////////////////////////////////////////////////////////////// +// This class is to avoid linker problems and to ensure a real singleton +// 'level' variable + struct debug_support + { + int& get_level() + { + static int level = 0; + return level; + } + }; + + template + struct parser_scanner_linker : public ScannerT + { + parser_scanner_linker(ScannerT const &scan_) : ScannerT(scan_) + {} + + int &get_level() + { return debug.get_level(); } + + private: debug_support debug; + }; + +#endif // !defined(BOOST_SPIRIT_PARSER_SCANNER_LINKER_DEFINED) + +#if !defined(BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED) +#define BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED + + /////////////////////////////////////////////////////////////////////////// + // + // closure_context_linker is a debug wrapper for the closure template + // parameter of the rule<>, subrule<> and grammar classes + // + /////////////////////////////////////////////////////////////////////////// + + template + struct closure_context_linker : public parser_context_linker + { + typedef parser_context_linker base_t; + + template + closure_context_linker(ParserT const& p) + : parser_context_linker(p) {} + + template + void pre_parse(ParserT const& p, ScannerT &scan) + { this->base_t::pre_parse(p, scan); } + + template + ResultT& + post_parse(ResultT& hit, ParserT const& p, ScannerT &scan) + { +#if BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES + if (hit && trace_parser(p.derived())) { + // for now, print out the return value only + return impl::print_closure_info( + this->base_t::post_parse(hit, p, scan), + scan.get_level(), + parser_name(p.derived()) + ); + } +#endif // BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES + + return this->base_t::post_parse(hit, p, scan); + } + }; + +#endif // !defined(BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED) + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif // defined(BOOST_SPIRIT_DEBUG) + +#endif // !defined(BOOST_SPIRIT_DEBUG_NODE_HPP) + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/debug/minimal.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/debug/minimal.hpp new file mode 100644 index 0000000..0cb4264 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/debug/minimal.hpp @@ -0,0 +1,81 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2002-2003 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_MINIMAL_DEBUG_HPP) +#define BOOST_SPIRIT_MINIMAL_DEBUG_HPP + +#if !defined(BOOST_SPIRIT_DEBUG_MAIN_HPP) +#error "You must include boost/spirit/debug.hpp, not boost/spirit/debug/minimal.hpp" +#endif +/////////////////////////////////////////////////////////////////////////////// +// +// Minimum debugging tools support +// +/////////////////////////////////////////////////////////////////////////////// +#if !defined(BOOST_SPIRIT_DEBUG_OUT) +#define BOOST_SPIRIT_DEBUG_OUT std::cout +#endif + +/////////////////////////////////////////////////////////////////////////// +// +// BOOST_SPIRIT_DEBUG_FLAGS controls the level of diagnostics printed +// +/////////////////////////////////////////////////////////////////////////// +#if !defined(BOOST_SPIRIT_DEBUG_FLAGS_NONE) +#define BOOST_SPIRIT_DEBUG_FLAGS_NONE 0x0000 // no diagnostics at all +#endif + +#if !defined(BOOST_SPIRIT_DEBUG_FLAGS_MAX) +#define BOOST_SPIRIT_DEBUG_FLAGS_MAX 0xFFFF // print maximal diagnostics +#endif + +#if !defined(BOOST_SPIRIT_DEBUG_FLAGS) +#define BOOST_SPIRIT_DEBUG_FLAGS BOOST_SPIRIT_DEBUG_FLAGS_MAX +#endif + +#if !defined(BOOST_SPIRIT_DEBUG_PRINT_SOME) +#define BOOST_SPIRIT_DEBUG_PRINT_SOME 20 +#endif + +#if !defined(BOOST_SPIRIT_DEBUG_RULE) +#define BOOST_SPIRIT_DEBUG_RULE(r) +#endif // !defined(BOOST_SPIRIT_DEBUG_RULE) + +#if !defined(BOOST_SPIRIT_DEBUG_NODE) +#define BOOST_SPIRIT_DEBUG_NODE(r) +#endif // !defined(BOOST_SPIRIT_DEBUG_NODE) + +#if !defined(BOOST_SPIRIT_DEBUG_GRAMMAR) +#define BOOST_SPIRIT_DEBUG_GRAMMAR(r) +#endif // !defined(BOOST_SPIRIT_DEBUG_GRAMMAR) + +#if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE) +#define BOOST_SPIRIT_DEBUG_TRACE_RULE(r, t) +#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE) + +#if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE) +#define BOOST_SPIRIT_DEBUG_TRACE_NODE(r, t) +#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE) + +#if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR) +#define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR(r, t) +#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR) + +#if !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME) +#define BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME(r, n, t) +#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_RULE_NAME) + +#if !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME) +#define BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME(r, n, t) +#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME) + +#if !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME) +#define BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME(r, n, t) +#endif // !defined(BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME) + +#endif // !defined(BOOST_SPIRIT_MINIMAL_DEBUG_HPP) diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/meta/as_parser.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/meta/as_parser.hpp new file mode 100644 index 0000000..c5cc82d --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/meta/as_parser.hpp @@ -0,0 +1,113 @@ +/*============================================================================= + Copyright (c) 2002-2003 Joel de Guzman + Copyright (c) 2002-2003 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(BOOST_SPIRIT_AS_PARSER_HPP) +#define BOOST_SPIRIT_AS_PARSER_HPP + +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // Helper templates to derive the parser type from an auxilliary type + // and to generate an object of the required parser type given an + // auxilliary object. Supported types to convert are parsers, + // single characters and character strings. + // + /////////////////////////////////////////////////////////////////////////// + namespace impl + { + template + struct default_as_parser + { + typedef T type; + static type const& convert(type const& p) + { + return p; + } + }; + + struct char_as_parser + { + typedef chlit type; + static type convert(char ch) + { + return type(ch); + } + }; + + struct wchar_as_parser + { + typedef chlit type; + static type convert(wchar_t ch) + { + return type(ch); + } + }; + + struct string_as_parser + { + typedef strlit type; + static type convert(char const* str) + { + return type(str); + } + }; + + struct wstring_as_parser + { + typedef strlit type; + static type convert(wchar_t const* str) + { + return type(str); + } + }; + } + + template + struct as_parser : impl::default_as_parser {}; + + template<> + struct as_parser : impl::char_as_parser {}; + + template<> + struct as_parser : impl::wchar_as_parser {}; + + template<> + struct as_parser : impl::string_as_parser {}; + + template<> + struct as_parser : impl::string_as_parser {}; + + template<> + struct as_parser : impl::wstring_as_parser {}; + + template<> + struct as_parser : impl::wstring_as_parser {}; + + template + struct as_parser : impl::string_as_parser {}; + + template + struct as_parser : impl::wstring_as_parser {}; + + template + struct as_parser : impl::string_as_parser {}; + + template + struct as_parser : impl::wstring_as_parser {}; + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/namespace.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/namespace.hpp new file mode 100644 index 0000000..f64fc81 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/namespace.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2008 Joel de Guzman + Copyright (c) 2001-2008 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(SPIRIT_CLASSIC_NAMESPACE_HPP) +#define SPIRIT_CLASSIC_NAMESPACE_HPP + +#if defined(BOOST_SPIRIT_USE_OLD_NAMESPACE) + +// Use the old namespace for Spirit.Classic, everything is located in the +// namespace boost::spirit. +// This is in place for backwards compatibility with Spirit V1.8.x. Don't use +// it when combining Spirit.Classic with other parts of the library + +#define BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN /*namespace classic {*/ +#define BOOST_SPIRIT_CLASSIC_NS boost::spirit/*::classic*/ +#define BOOST_SPIRIT_CLASSIC_NAMESPACE_END /*}*/ + +#else + +// This is the normal (and suggested) mode of operation when using +// Spirit.Classic. Everything will be located in the namespace +// boost::spirit::classic, avoiding name clashes with other parts of Spirit. + +#define BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN namespace classic { +#define BOOST_SPIRIT_CLASSIC_NS boost::spirit::classic +#define BOOST_SPIRIT_CLASSIC_NAMESPACE_END } + +#endif + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/utility/chset.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/utility/chset.hpp new file mode 100644 index 0000000..3635456 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/utility/chset.hpp @@ -0,0 +1,187 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2001-2003 Daniel Nuffer + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_CHSET_HPP +#define BOOST_SPIRIT_CHSET_HPP + +/////////////////////////////////////////////////////////////////////////////// +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +namespace utility { namespace impl { + + // This is here because some compilers choke on out-of-line member + // template functions. And we don't want to put the whole algorithm + // in the chset constructor in the class definition. + template + void construct_chset(boost::shared_ptr >& ptr, + CharT2 const* definition); + +}} // namespace utility::impl + +/////////////////////////////////////////////////////////////////////////////// +// +// chset class +// +/////////////////////////////////////////////////////////////////////////////// +template +class chset: public char_parser > { + +public: + chset(); + chset(chset const& arg_); + explicit chset(CharT arg_); + explicit chset(anychar_parser arg_); + explicit chset(nothing_parser arg_); + explicit chset(chlit const& arg_); + explicit chset(range const& arg_); + explicit chset(negated_char_parser > const& arg_); + explicit chset(negated_char_parser > const& arg_); + + template + explicit chset(CharT2 const* definition) + : ptr(new basic_chset()) + { + utility::impl::construct_chset(ptr, definition); + } + ~chset(); + + chset& operator=(chset const& rhs); + chset& operator=(CharT rhs); + chset& operator=(anychar_parser rhs); + chset& operator=(nothing_parser rhs); + chset& operator=(chlit const& rhs); + chset& operator=(range const& rhs); + chset& operator=(negated_char_parser > const& rhs); + chset& operator=(negated_char_parser > const& rhs); + + void set(range const& arg_); + void set(negated_char_parser > const& arg_); + void set(negated_char_parser > const& arg_); + + void clear(range const& arg_); + void clear(negated_char_parser > const& arg_); + bool test(CharT ch) const; + chset& inverse(); + void swap(chset& x); + + chset& operator|=(chset const& x); + chset& operator&=(chset const& x); + chset& operator-=(chset const& x); + chset& operator^=(chset const& x); + +private: + + boost::shared_ptr > ptr; +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// Generator functions +// +/////////////////////////////////////////////////////////////////////////////// +template +inline chset +chset_p(chlit const& arg_) +{ return chset(arg_); } + +////////////////////////////////// +template +inline chset +chset_p(range const& arg_) +{ return chset(arg_); } + +template +inline chset +chset_p(negated_char_parser > const& arg_) +{ return chset(arg_); } + +template +inline chset +chset_p(negated_char_parser > const& arg_) +{ return chset(arg_); } + +////////////////////////////////// +inline chset +chset_p(char const* init) +{ return chset(init); } + +////////////////////////////////// +inline chset +chset_p(wchar_t const* init) +{ return chset(init); } + +////////////////////////////////// +inline chset +chset_p(char ch) +{ return chset(ch); } + +////////////////////////////////// +inline chset +chset_p(wchar_t ch) +{ return chset(ch); } + +////////////////////////////////// +inline chset +chset_p(int ch) +{ return chset(ch); } + +////////////////////////////////// +inline chset +chset_p(unsigned int ch) +{ return chset(ch); } + +////////////////////////////////// +inline chset +chset_p(short ch) +{ return chset(ch); } + +#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) +////////////////////////////////// +inline chset +chset_p(unsigned short ch) +{ return chset(ch); } +#endif +////////////////////////////////// +inline chset +chset_p(long ch) +{ return chset(ch); } + +////////////////////////////////// +inline chset +chset_p(unsigned long ch) +{ return chset(ch); } + +#ifdef BOOST_HAS_LONG_LONG +////////////////////////////////// +inline chset< ::boost::long_long_type> +chset_p( ::boost::long_long_type ch) +{ return chset< ::boost::long_long_type>(ch); } + +////////////////////////////////// +inline chset< ::boost::ulong_long_type> +chset_p( ::boost::ulong_long_type ch) +{ return chset< ::boost::ulong_long_type>(ch); } +#endif + +/////////////////////////////////////////////////////////////////////////////// +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/utility/chset_operators.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/utility/chset_operators.hpp new file mode 100644 index 0000000..d42b5fa --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/utility/chset_operators.hpp @@ -0,0 +1,402 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2001-2003 Daniel Nuffer + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_CHSET_OPERATORS_HPP +#define BOOST_SPIRIT_CHSET_OPERATORS_HPP + +/////////////////////////////////////////////////////////////////////////////// +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// +// chset free operators +// +// Where a and b are both chsets, implements: +// +// a | b, a & b, a - b, a ^ b +// +// Where a is a chset, implements: +// +// ~a +// +/////////////////////////////////////////////////////////////////////////////// +template +chset +operator~(chset const& a); + +////////////////////////////////// +template +chset +operator|(chset const& a, chset const& b); + +////////////////////////////////// +template +chset +operator&(chset const& a, chset const& b); + +////////////////////////////////// +template +chset +operator-(chset const& a, chset const& b); + +////////////////////////////////// +template +chset +operator^(chset const& a, chset const& b); + +/////////////////////////////////////////////////////////////////////////////// +// +// range <--> chset free operators +// +// Where a is a chset and b is a range, and vice-versa, implements: +// +// a | b, a & b, a - b, a ^ b +// +/////////////////////////////////////////////////////////////////////////////// +template +chset +operator|(chset const& a, range const& b); + +////////////////////////////////// +template +chset +operator&(chset const& a, range const& b); + +////////////////////////////////// +template +chset +operator-(chset const& a, range const& b); + +////////////////////////////////// +template +chset +operator^(chset const& a, range const& b); + +////////////////////////////////// +template +chset +operator|(range const& a, chset const& b); + +////////////////////////////////// +template +chset +operator&(range const& a, chset const& b); + +////////////////////////////////// +template +chset +operator-(range const& a, chset const& b); + +////////////////////////////////// +template +chset +operator^(range const& a, chset const& b); + +/////////////////////////////////////////////////////////////////////////////// +// +// chlit <--> chset free operators +// +// Where a is a chset and b is a chlit, and vice-versa, implements: +// +// a | b, a & b, a - b, a ^ b +// +/////////////////////////////////////////////////////////////////////////////// +template +chset +operator|(chset const& a, chlit const& b); + +////////////////////////////////// +template +chset +operator&(chset const& a, chlit const& b); + +////////////////////////////////// +template +chset +operator-(chset const& a, chlit const& b); + +////////////////////////////////// +template +chset +operator^(chset const& a, chlit const& b); + +////////////////////////////////// +template +chset +operator|(chlit const& a, chset const& b); + +////////////////////////////////// +template +chset +operator&(chlit const& a, chset const& b); + +////////////////////////////////// +template +chset +operator-(chlit const& a, chset const& b); + +////////////////////////////////// +template +chset +operator^(chlit const& a, chset const& b); + +/////////////////////////////////////////////////////////////////////////////// +// +// negated_char_parser <--> chset free operators +// +// Where a is a chset and b is a range, and vice-versa, implements: +// +// a | b, a & b, a - b, a ^ b +// +/////////////////////////////////////////////////////////////////////////////// +template +chset +operator|(chset const& a, negated_char_parser > const& b); + +////////////////////////////////// +template +chset +operator&(chset const& a, negated_char_parser > const& b); + +////////////////////////////////// +template +chset +operator-(chset const& a, negated_char_parser > const& b); + +////////////////////////////////// +template +chset +operator^(chset const& a, negated_char_parser > const& b); + +////////////////////////////////// +template +chset +operator|(negated_char_parser > const& a, chset const& b); + +////////////////////////////////// +template +chset +operator&(negated_char_parser > const& a, chset const& b); + +////////////////////////////////// +template +chset +operator-(negated_char_parser > const& a, chset const& b); + +////////////////////////////////// +template +chset +operator^(negated_char_parser > const& a, chset const& b); + +/////////////////////////////////////////////////////////////////////////////// +// +// negated_char_parser <--> chset free operators +// +// Where a is a chset and b is a chlit, and vice-versa, implements: +// +// a | b, a & b, a - b, a ^ b +// +/////////////////////////////////////////////////////////////////////////////// +template +chset +operator|(chset const& a, negated_char_parser > const& b); + +////////////////////////////////// +template +chset +operator&(chset const& a, negated_char_parser > const& b); + +////////////////////////////////// +template +chset +operator-(chset const& a, negated_char_parser > const& b); + +////////////////////////////////// +template +chset +operator^(chset const& a, negated_char_parser > const& b); + +////////////////////////////////// +template +chset +operator|(negated_char_parser > const& a, chset const& b); + +////////////////////////////////// +template +chset +operator&(negated_char_parser > const& a, chset const& b); + +////////////////////////////////// +template +chset +operator-(negated_char_parser > const& a, chset const& b); + +////////////////////////////////// +template +chset +operator^(negated_char_parser > const& a, chset const& b); + +/////////////////////////////////////////////////////////////////////////////// +// +// literal primitives <--> chset free operators +// +// Where a is a chset and b is a literal primitive, +// and vice-versa, implements: +// +// a | b, a & b, a - b, a ^ b +// +/////////////////////////////////////////////////////////////////////////////// +template +chset +operator|(chset const& a, CharT b); + +////////////////////////////////// +template +chset +operator&(chset const& a, CharT b); + +////////////////////////////////// +template +chset +operator-(chset const& a, CharT b); + +////////////////////////////////// +template +chset +operator^(chset const& a, CharT b); + +////////////////////////////////// +template +chset +operator|(CharT a, chset const& b); + +////////////////////////////////// +template +chset +operator&(CharT a, chset const& b); + +////////////////////////////////// +template +chset +operator-(CharT a, chset const& b); + +////////////////////////////////// +template +chset +operator^(CharT a, chset const& b); + +/////////////////////////////////////////////////////////////////////////////// +// +// anychar_parser <--> chset free operators +// +// Where a is chset and b is a anychar_parser, and vice-versa, implements: +// +// a | b, a & b, a - b, a ^ b +// +/////////////////////////////////////////////////////////////////////////////// +template +chset +operator|(chset const& a, anychar_parser b); + +////////////////////////////////// +template +chset +operator&(chset const& a, anychar_parser b); + +////////////////////////////////// +template +chset +operator-(chset const& a, anychar_parser b); + +////////////////////////////////// +template +chset +operator^(chset const& a, anychar_parser b); + +////////////////////////////////// +template +chset +operator|(anychar_parser a, chset const& b); + +////////////////////////////////// +template +chset +operator&(anychar_parser a, chset const& b); + +////////////////////////////////// +template +chset +operator-(anychar_parser a, chset const& b); + +////////////////////////////////// +template +chset +operator^(anychar_parser a, chset const& b); + +/////////////////////////////////////////////////////////////////////////////// +// +// nothing_parser <--> chset free operators +// +// Where a is chset and b is nothing_parser, and vice-versa, implements: +// +// a | b, a & b, a - b, a ^ b +// +/////////////////////////////////////////////////////////////////////////////// +template +chset +operator|(chset const& a, nothing_parser b); + +////////////////////////////////// +template +chset +operator&(chset const& a, nothing_parser b); + +////////////////////////////////// +template +chset +operator-(chset const& a, nothing_parser b); + +////////////////////////////////// +template +chset +operator^(chset const& a, nothing_parser b); + +////////////////////////////////// +template +chset +operator|(nothing_parser a, chset const& b); + +////////////////////////////////// +template +chset +operator&(nothing_parser a, chset const& b); + +////////////////////////////////// +template +chset +operator-(nothing_parser a, chset const& b); + +////////////////////////////////// +template +chset +operator^(nothing_parser a, chset const& b); + +/////////////////////////////////////////////////////////////////////////////// +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset.ipp new file mode 100644 index 0000000..3017035 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset.ipp @@ -0,0 +1,366 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2001-2003 Daniel Nuffer + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_CHSET_IPP +#define BOOST_SPIRIT_CHSET_IPP + +/////////////////////////////////////////////////////////////////////////////// +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// +// chset class +// +/////////////////////////////////////////////////////////////////////////////// +namespace utility { namespace impl { + template + inline void + detach(boost::shared_ptr >& ptr) + { + if (!ptr.unique()) + ptr = boost::shared_ptr > + (new basic_chset(*ptr)); + } + + template + inline void + detach_clear(boost::shared_ptr >& ptr) + { + if (ptr.unique()) + ptr->clear(); + else + ptr.reset(new basic_chset()); + } + + template + void construct_chset(boost::shared_ptr >& ptr, + CharT2 const* definition) + { + CharT2 ch = *definition++; + while (ch) + { + CharT2 next = *definition++; + if (next == '-') + { + next = *definition++; + if (next == 0) + { + ptr->set(ch); + ptr->set('-'); + break; + } + ptr->set(ch, next); + } + else + { + ptr->set(ch); + } + ch = next; + } + } + + ////////////////////////////////// + +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) + + template + void chset_negated_set(boost::shared_ptr > &ptr, chlit const &ch, + FakeT) + { + if(ch.ch != (std::numeric_limits::min)()) { + ptr->set((std::numeric_limits::min)(), ch.ch - 1); + } + if(ch.ch != (std::numeric_limits::max)()) { + ptr->set(ch.ch + 1, (std::numeric_limits::max)()); + } + } + + template + void chset_negated_set(boost::shared_ptr > &ptr, + spirit::range const &rng, FakeT) + { + if(rng.first != (std::numeric_limits::min)()) { + ptr->set((std::numeric_limits::min)(), rng.first - 1); + } + if(rng.last != (std::numeric_limits::max)()) { + ptr->set(rng.last + 1, (std::numeric_limits::max)()); + } + } + +#endif // BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +////////////////////////////////// + +}} // namespace utility::impl + +template +inline chset::chset() +: ptr(new basic_chset()) {} + +template +inline chset::chset(chset const& arg_) +: ptr(new basic_chset(*arg_.ptr)) {} + +template +inline chset::chset(CharT arg_) +: ptr(new basic_chset()) +{ ptr->set(arg_); } + +template +inline chset::chset(anychar_parser /*arg*/) +: ptr(new basic_chset()) +{ + ptr->set( + (std::numeric_limits::min)(), + (std::numeric_limits::max)() + ); +} + +template +inline chset::chset(nothing_parser arg_) +: ptr(new basic_chset()) {} + +template +inline chset::chset(chlit const& arg_) +: ptr(new basic_chset()) +{ ptr->set(arg_.ch); } + +template +inline chset::chset(range const& arg_) +: ptr(new basic_chset()) +{ ptr->set(arg_.first, arg_.last); } + +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +template +inline chset::chset(negated_char_parser > const& arg_) +: ptr(new basic_chset()) +{ + set(arg_); +} + +template +inline chset::chset(negated_char_parser > const& arg_) +: ptr(new basic_chset()) +{ + set(arg_); +} + +#endif // !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +template +inline chset::~chset() {} + +template +inline chset& +chset::operator=(chset const& rhs) +{ + ptr = rhs.ptr; + return *this; +} + +template +inline chset& +chset::operator=(CharT rhs) +{ + utility::impl::detach_clear(ptr); + ptr->set(rhs); + return *this; +} + +template +inline chset& +chset::operator=(anychar_parser rhs) +{ + utility::impl::detach_clear(ptr); + ptr->set( + (std::numeric_limits::min)(), + (std::numeric_limits::max)() + ); + return *this; +} + +template +inline chset& +chset::operator=(nothing_parser rhs) +{ + utility::impl::detach_clear(ptr); + return *this; +} + +template +inline chset& +chset::operator=(chlit const& rhs) +{ + utility::impl::detach_clear(ptr); + ptr->set(rhs.ch); + return *this; +} + +template +inline chset& +chset::operator=(range const& rhs) +{ + utility::impl::detach_clear(ptr); + ptr->set(rhs.first, rhs.last); + return *this; +} + +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +template +inline chset& +chset::operator=(negated_char_parser > const& rhs) +{ + utility::impl::detach_clear(ptr); + set(rhs); + return *this; +} + +template +inline chset& +chset::operator=(negated_char_parser > const& rhs) +{ + utility::impl::detach_clear(ptr); + set(rhs); + return *this; +} + +#endif // !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +template +inline void +chset::set(range const& arg_) +{ + utility::impl::detach(ptr); + ptr->set(arg_.first, arg_.last); +} + +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +template +inline void +chset::set(negated_char_parser > const& arg_) +{ + utility::impl::detach(ptr); + + if(arg_.positive.ch != (std::numeric_limits::min)()) { + ptr->set((std::numeric_limits::min)(), arg_.positive.ch - 1); + } + if(arg_.positive.ch != (std::numeric_limits::max)()) { + ptr->set(arg_.positive.ch + 1, (std::numeric_limits::max)()); + } +} + +template +inline void +chset::set(negated_char_parser > const& arg_) +{ + utility::impl::detach(ptr); + + if(arg_.positive.first != (std::numeric_limits::min)()) { + ptr->set((std::numeric_limits::min)(), arg_.positive.first - 1); + } + if(arg_.positive.last != (std::numeric_limits::max)()) { + ptr->set(arg_.positive.last + 1, (std::numeric_limits::max)()); + } +} + +#endif // !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +template +inline void +chset::clear(range const& arg_) +{ + utility::impl::detach(ptr); + ptr->clear(arg_.first, arg_.last); +} + +template +inline void +chset::clear(negated_char_parser > const& arg_) +{ + utility::impl::detach(ptr); + + if(arg_.positive.first != (std::numeric_limits::min)()) { + ptr->clear((std::numeric_limits::min)(), arg_.positive.first - 1); + } + if(arg_.positive.last != (std::numeric_limits::max)()) { + ptr->clear(arg_.positive.last + 1, (std::numeric_limits::max)()); + } +} + +template +inline bool +chset::test(CharT ch) const +{ return ptr->test(ch); } + +template +inline chset& +chset::inverse() +{ + utility::impl::detach(ptr); + ptr->inverse(); + return *this; +} + +template +inline void +chset::swap(chset& x) +{ ptr.swap(x.ptr); } + +template +inline chset& +chset::operator|=(chset const& x) +{ + utility::impl::detach(ptr); + *ptr |= *x.ptr; + return *this; +} + +template +inline chset& +chset::operator&=(chset const& x) +{ + utility::impl::detach(ptr); + *ptr &= *x.ptr; + return *this; +} + +template +inline chset& +chset::operator-=(chset const& x) +{ + utility::impl::detach(ptr); + *ptr -= *x.ptr; + return *this; +} + +template +inline chset& +chset::operator^=(chset const& x) +{ + utility::impl::detach(ptr); + *ptr ^= *x.ptr; + return *this; +} + +/////////////////////////////////////////////////////////////////////////////// +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/basic_chset.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/basic_chset.hpp new file mode 100644 index 0000000..ace6501 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/basic_chset.hpp @@ -0,0 +1,107 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2001-2003 Daniel Nuffer + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_BASIC_CHSET_HPP +#define BOOST_SPIRIT_BASIC_CHSET_HPP + +/////////////////////////////////////////////////////////////////////////////// +#include +#include +#include +#include + +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + /////////////////////////////////////////////////////////////////////////// + // + // basic_chset: basic character set implementation using range_run + // + /////////////////////////////////////////////////////////////////////////// + template + class basic_chset + { + public: + basic_chset(); + basic_chset(basic_chset const& arg_); + + bool test(CharT v) const; + void set(CharT from, CharT to); + void set(CharT c); + void clear(CharT from, CharT to); + void clear(CharT c); + void clear(); + + void inverse(); + void swap(basic_chset& x); + + basic_chset& operator|=(basic_chset const& x); + basic_chset& operator&=(basic_chset const& x); + basic_chset& operator-=(basic_chset const& x); + basic_chset& operator^=(basic_chset const& x); + + private: utility::impl::range_run rr; + }; + + #if (CHAR_BIT == 8) + + /////////////////////////////////////////////////////////////////////////// + // + // basic_chset: specializations for 8 bit chars using std::bitset + // + /////////////////////////////////////////////////////////////////////////// + template + class basic_chset_8bit { + + public: + basic_chset_8bit(); + basic_chset_8bit(basic_chset_8bit const& arg_); + + bool test(CharT v) const; + void set(CharT from, CharT to); + void set(CharT c); + void clear(CharT from, CharT to); + void clear(CharT c); + void clear(); + + void inverse(); + void swap(basic_chset_8bit& x); + + basic_chset_8bit& operator|=(basic_chset_8bit const& x); + basic_chset_8bit& operator&=(basic_chset_8bit const& x); + basic_chset_8bit& operator-=(basic_chset_8bit const& x); + basic_chset_8bit& operator^=(basic_chset_8bit const& x); + + private: std::bitset<256> bset; + }; + + ///////////////////////////////// + template <> + class basic_chset + : public basic_chset_8bit {}; + + ///////////////////////////////// + template <> + class basic_chset + : public basic_chset_8bit {}; + + ///////////////////////////////// + template <> + class basic_chset + : public basic_chset_8bit {}; + +#endif + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/basic_chset.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/basic_chset.ipp new file mode 100644 index 0000000..e7d9272 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/basic_chset.ipp @@ -0,0 +1,246 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + Copyright (c) 2001-2003 Daniel Nuffer + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_BASIC_CHSET_IPP +#define BOOST_SPIRIT_BASIC_CHSET_IPP + +/////////////////////////////////////////////////////////////////////////////// +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// +// basic_chset: character set implementation +// +/////////////////////////////////////////////////////////////////////////////// +template +inline basic_chset::basic_chset() {} + +////////////////////////////////// +template +inline basic_chset::basic_chset(basic_chset const& arg_) +: rr(arg_.rr) {} + +////////////////////////////////// +template +inline bool +basic_chset::test(CharT v) const +{ return rr.test(v); } + +////////////////////////////////// +template +inline void +basic_chset::set(CharT from, CharT to) +{ rr.set(utility::impl::range(from, to)); } + +////////////////////////////////// +template +inline void +basic_chset::set(CharT c) +{ rr.set(utility::impl::range(c, c)); } + +////////////////////////////////// +template +inline void +basic_chset::clear(CharT from, CharT to) +{ rr.clear(utility::impl::range(from, to)); } + +////////////////////////////////// +template +inline void +basic_chset::clear() +{ rr.clear(); } + +///////////////////////////////// +template +inline void +basic_chset::inverse() +{ + basic_chset inv; + inv.set( + (std::numeric_limits::min)(), + (std::numeric_limits::max)() + ); + inv -= *this; + swap(inv); +} + +///////////////////////////////// +template +inline void +basic_chset::swap(basic_chset& x) +{ rr.swap(x.rr); } + +///////////////////////////////// +template +inline basic_chset& +basic_chset::operator|=(basic_chset const& x) +{ + typedef typename utility::impl::range_run::const_iterator const_iterator; + for (const_iterator iter = x.rr.begin(); iter != x.rr.end(); ++iter) + rr.set(*iter); + return *this; +} + +///////////////////////////////// +template +inline basic_chset& +basic_chset::operator&=(basic_chset const& x) +{ + basic_chset inv; + inv.set( + (std::numeric_limits::min)(), + (std::numeric_limits::max)() + ); + inv -= x; + *this -= inv; + return *this; +} + +///////////////////////////////// +template +inline basic_chset& +basic_chset::operator-=(basic_chset const& x) +{ + typedef typename utility::impl::range_run::const_iterator const_iterator; + for (const_iterator iter = x.rr.begin(); iter != x.rr.end(); ++iter) + rr.clear(*iter); + return *this; +} + +///////////////////////////////// +template +inline basic_chset& +basic_chset::operator^=(basic_chset const& x) +{ + basic_chset bma = x; + bma -= *this; + *this -= x; + *this |= bma; + return *this; +} + +#if (CHAR_BIT == 8) + +/////////////////////////////////////////////////////////////////////////////// +// +// basic_chset: specializations for 8 bit chars using std::bitset +// +/////////////////////////////////////////////////////////////////////////////// +template +inline basic_chset_8bit::basic_chset_8bit() {} + +///////////////////////////////// +template +inline basic_chset_8bit::basic_chset_8bit(basic_chset_8bit const& arg_) +: bset(arg_.bset) {} + +///////////////////////////////// +template +inline bool +basic_chset_8bit::test(CharT v) const +{ return bset.test((unsigned char)v); } + +///////////////////////////////// +template +inline void +basic_chset_8bit::set(CharT from, CharT to) +{ + for (int i = from; i <= to; ++i) + bset.set((unsigned char)i); +} + +///////////////////////////////// +template +inline void +basic_chset_8bit::set(CharT c) +{ bset.set((unsigned char)c); } + +///////////////////////////////// +template +inline void +basic_chset_8bit::clear(CharT from, CharT to) +{ + for (int i = from; i <= to; ++i) + bset.reset((unsigned char)i); +} + +///////////////////////////////// +template +inline void +basic_chset_8bit::clear(CharT c) +{ bset.reset((unsigned char)c); } + +///////////////////////////////// +template +inline void +basic_chset_8bit::clear() +{ bset.reset(); } + +///////////////////////////////// +template +inline void +basic_chset_8bit::inverse() +{ bset.flip(); } + +///////////////////////////////// +template +inline void +basic_chset_8bit::swap(basic_chset_8bit& x) +{ std::swap(bset, x.bset); } + +///////////////////////////////// +template +inline basic_chset_8bit& +basic_chset_8bit::operator|=(basic_chset_8bit const& x) +{ + bset |= x.bset; + return *this; +} + +///////////////////////////////// +template +inline basic_chset_8bit& +basic_chset_8bit::operator&=(basic_chset_8bit const& x) +{ + bset &= x.bset; + return *this; +} + +///////////////////////////////// +template +inline basic_chset_8bit& +basic_chset_8bit::operator-=(basic_chset_8bit const& x) +{ + bset &= ~x.bset; + return *this; +} + +///////////////////////////////// +template +inline basic_chset_8bit& +basic_chset_8bit::operator^=(basic_chset_8bit const& x) +{ + bset ^= x.bset; + return *this; +} + +#endif + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/range_run.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/range_run.hpp new file mode 100644 index 0000000..579bcae --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/range_run.hpp @@ -0,0 +1,127 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_RANGE_RUN_HPP +#define BOOST_SPIRIT_RANGE_RUN_HPP + +/////////////////////////////////////////////////////////////////////////////// +#include + +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +namespace utility { namespace impl { + + /////////////////////////////////////////////////////////////////////////// + // + // range class + // + // Implements a closed range of values. This class is used in + // the implementation of the range_run class. + // + // { Low level implementation detail } + // { Not to be confused with BOOST_SPIRIT_CLASSIC_NS::range } + // + /////////////////////////////////////////////////////////////////////////// + template + struct range { + + range(CharT first, CharT last); + + bool is_valid() const; + bool includes(CharT v) const; + bool includes(range const& r) const; + bool overlaps(range const& r) const; + void merge(range const& r); + + CharT first; + CharT last; + }; + + ////////////////////////////////// + template + struct range_char_compare { + + bool operator()(range const& x, const CharT y) const + { return x.first < y; } + + bool operator()(const CharT x, range const& y) const + { return x < y.first; } + + // This additional operator is required for the checked STL shipped + // with VC8 testing the ordering of the iterators passed to the + // std::lower_bound algo this range_char_compare<> predicate is passed + // to. + bool operator()(range const& x, range const& y) const + { return x.first < y.first; } + }; + + ////////////////////////////////// + template + struct range_compare { + + bool operator()(range const& x, range const& y) const + { return x.first < y.first; } + }; + + /////////////////////////////////////////////////////////////////////////// + // + // range_run + // + // An implementation of a sparse bit (boolean) set. The set uses + // a sorted vector of disjoint ranges. This class implements the + // bare minimum essentials from which the full range of set + // operators can be implemented. The set is constructed from + // ranges. Internally, adjacent or overlapping ranges are + // coalesced. + // + // range_runs are very space-economical in situations where there + // are lots of ranges and a few individual disjoint values. + // Searching is O(log n) where n is the number of ranges. + // + // { Low level implementation detail } + // + /////////////////////////////////////////////////////////////////////////// + template + class range_run { + + public: + + typedef range range_t; + typedef std::vector run_t; + typedef typename run_t::iterator iterator; + typedef typename run_t::const_iterator const_iterator; + + void swap(range_run& rr); + bool test(CharT v) const; + void set(range_t const& r); + void clear(range_t const& r); + void clear(); + + const_iterator begin() const; + const_iterator end() const; + + private: + + void merge(iterator iter, range_t const& r); + + run_t run; + }; + +}} + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace BOOST_SPIRIT_CLASSIC_NS::utility::impl + +#endif + +#include diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/range_run.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/range_run.ipp new file mode 100644 index 0000000..ede1567 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset/range_run.ipp @@ -0,0 +1,218 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_RANGE_RUN_IPP +#define BOOST_SPIRIT_RANGE_RUN_IPP + +/////////////////////////////////////////////////////////////////////////////// +#include // for std::lower_bound +#include // for BOOST_SPIRIT_ASSERT +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + + namespace utility { namespace impl { + + /////////////////////////////////////////////////////////////////////// + // + // range class implementation + // + /////////////////////////////////////////////////////////////////////// + template + inline range::range(CharT first_, CharT last_) + : first(first_), last(last_) {} + + ////////////////////////////////// + template + inline bool + range::is_valid() const + { return first <= last; } + + ////////////////////////////////// + template + inline bool + range::includes(range const& r) const + { return (first <= r.first) && (last >= r.last); } + + ////////////////////////////////// + template + inline bool + range::includes(CharT v) const + { return (first <= v) && (last >= v); } + + ////////////////////////////////// + template + inline bool + range::overlaps(range const& r) const + { + CharT decr_first = + first == (std::numeric_limits::min)() ? first : first-1; + CharT incr_last = + last == (std::numeric_limits::max)() ? last : last+1; + + return (decr_first <= r.last) && (incr_last >= r.first); + } + + ////////////////////////////////// + template + inline void + range::merge(range const& r) + { + first = (std::min)(first, r.first); + last = (std::max)(last, r.last); + } + + /////////////////////////////////////////////////////////////////////// + // + // range_run class implementation + // + /////////////////////////////////////////////////////////////////////// + template + inline bool + range_run::test(CharT v) const + { + if (!run.empty()) + { + const_iterator iter = + std::lower_bound( + run.begin(), run.end(), v, + range_char_compare() + ); + + if (iter != run.end() && iter->includes(v)) + return true; + if (iter != run.begin()) + return (--iter)->includes(v); + } + return false; + } + + ////////////////////////////////// + template + inline void + range_run::swap(range_run& rr) + { run.swap(rr.run); } + + ////////////////////////////////// + template + void + range_run::merge(iterator iter, range const& r) + { + iter->merge(r); + iterator i = iter + 1; + + while (i != run.end() && iter->overlaps(*i)) + iter->merge(*i++); + + run.erase(iter+1, i); + } + + ////////////////////////////////// + template + void + range_run::set(range const& r) + { + BOOST_SPIRIT_ASSERT(r.is_valid()); + if (!run.empty()) + { + iterator iter = + std::lower_bound( + run.begin(), run.end(), r, + range_compare() + ); + + if ((iter != run.end() && iter->includes(r)) || + ((iter != run.begin()) && (iter - 1)->includes(r))) + return; + + if (iter != run.begin() && (iter - 1)->overlaps(r)) + merge(--iter, r); + + else if (iter != run.end() && iter->overlaps(r)) + merge(iter, r); + + else + run.insert(iter, r); + } + else + { + run.push_back(r); + } + } + + ////////////////////////////////// + template + void + range_run::clear(range const& r) + { + BOOST_SPIRIT_ASSERT(r.is_valid()); + if (!run.empty()) + { + iterator iter = + std::lower_bound( + run.begin(), run.end(), r, + range_compare() + ); + + iterator left_iter; + + if ((iter != run.begin()) && + (left_iter = (iter - 1))->includes(r.first)) + { + if (left_iter->last > r.last) + { + CharT save_last = left_iter->last; + left_iter->last = r.first-1; + run.insert(iter, range(r.last+1, save_last)); + return; + } + else + { + left_iter->last = r.first-1; + } + } + + iterator i = iter; + while (i != run.end() && r.includes(*i)) + i++; + if (i != run.end() && i->includes(r.last)) + i->first = r.last+1; + run.erase(iter, i); + } + } + + ////////////////////////////////// + template + inline void + range_run::clear() + { run.clear(); } + + ////////////////////////////////// + template + inline typename range_run::const_iterator + range_run::begin() const + { return run.begin(); } + + ////////////////////////////////// + template + inline typename range_run::const_iterator + range_run::end() const + { return run.end(); } + + }} // namespace utility::impl + +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset_operators.ipp b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset_operators.ipp new file mode 100644 index 0000000..4319c9b --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/utility/impl/chset_operators.ipp @@ -0,0 +1,666 @@ +/*============================================================================= + Copyright (c) 2001-2003 Joel de Guzman + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_CHSET_OPERATORS_IPP +#define BOOST_SPIRIT_CHSET_OPERATORS_IPP + +/////////////////////////////////////////////////////////////////////////////// +#include + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace spirit { + +BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +// +// chset free operators implementation +// +/////////////////////////////////////////////////////////////////////////////// +template +inline chset +operator|(chset const& a, chset const& b) +{ + return chset(a) |= b; +} + +////////////////////////////////// +template +inline chset +operator-(chset const& a, chset const& b) +{ + return chset(a) -= b; +} + +////////////////////////////////// +template +inline chset +operator~(chset const& a) +{ + return chset(a).inverse(); +} + +////////////////////////////////// +template +inline chset +operator&(chset const& a, chset const& b) +{ + return chset(a) &= b; +} + +////////////////////////////////// +template +inline chset +operator^(chset const& a, chset const& b) +{ + return chset(a) ^= b; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// range <--> chset free operators implementation +// +/////////////////////////////////////////////////////////////////////////////// +template +inline chset +operator|(chset const& a, range const& b) +{ + chset a_(a); + a_.set(b); + return a_; +} + +////////////////////////////////// +template +inline chset +operator&(chset const& a, range const& b) +{ + chset a_(a); + if(b.first != (std::numeric_limits::min)()) { + a_.clear(range((std::numeric_limits::min)(), b.first - 1)); + } + if(b.last != (std::numeric_limits::max)()) { + a_.clear(range(b.last + 1, (std::numeric_limits::max)())); + } + return a_; +} + +////////////////////////////////// +template +inline chset +operator-(chset const& a, range const& b) +{ + chset a_(a); + a_.clear(b); + return a_; +} + +////////////////////////////////// +template +inline chset +operator^(chset const& a, range const& b) +{ + return a ^ chset(b); +} + +////////////////////////////////// +template +inline chset +operator|(range const& a, chset const& b) +{ + chset b_(b); + b_.set(a); + return b_; +} + +////////////////////////////////// +template +inline chset +operator&(range const& a, chset const& b) +{ + chset b_(b); + if(a.first != (std::numeric_limits::min)()) { + b_.clear(range((std::numeric_limits::min)(), a.first - 1)); + } + if(a.last != (std::numeric_limits::max)()) { + b_.clear(range(a.last + 1, (std::numeric_limits::max)())); + } + return b_; +} + +////////////////////////////////// +template +inline chset +operator-(range const& a, chset const& b) +{ + return chset(a) - b; +} + +////////////////////////////////// +template +inline chset +operator^(range const& a, chset const& b) +{ + return chset(a) ^ b; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// literal primitives <--> chset free operators implementation +// +/////////////////////////////////////////////////////////////////////////////// +template +inline chset +operator|(chset const& a, CharT b) +{ + return a | chset(b); +} + +////////////////////////////////// +template +inline chset +operator&(chset const& a, CharT b) +{ + return a & chset(b); +} + +////////////////////////////////// +template +inline chset +operator-(chset const& a, CharT b) +{ + return a - chset(b); +} + +////////////////////////////////// +template +inline chset +operator^(chset const& a, CharT b) +{ + return a ^ chset(b); +} + +////////////////////////////////// +template +inline chset +operator|(CharT a, chset const& b) +{ + return chset(a) | b; +} + +////////////////////////////////// +template +inline chset +operator&(CharT a, chset const& b) +{ + return chset(a) & b; +} + +////////////////////////////////// +template +inline chset +operator-(CharT a, chset const& b) +{ + return chset(a) - b; +} + +////////////////////////////////// +template +inline chset +operator^(CharT a, chset const& b) +{ + return chset(a) ^ b; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// chlit <--> chset free operators implementation +// +/////////////////////////////////////////////////////////////////////////////// +template +inline chset +operator|(chset const& a, chlit const& b) +{ + return a | chset(b.ch); +} + +////////////////////////////////// +template +inline chset +operator&(chset const& a, chlit const& b) +{ + return a & chset(b.ch); +} + +////////////////////////////////// +template +inline chset +operator-(chset const& a, chlit const& b) +{ + return a - chset(b.ch); +} + +////////////////////////////////// +template +inline chset +operator^(chset const& a, chlit const& b) +{ + return a ^ chset(b.ch); +} + +////////////////////////////////// +template +inline chset +operator|(chlit const& a, chset const& b) +{ + return chset(a.ch) | b; +} + +////////////////////////////////// +template +inline chset +operator&(chlit const& a, chset const& b) +{ + return chset(a.ch) & b; +} + +////////////////////////////////// +template +inline chset +operator-(chlit const& a, chset const& b) +{ + return chset(a.ch) - b; +} + +////////////////////////////////// +template +inline chset +operator^(chlit const& a, chset const& b) +{ + return chset(a.ch) ^ b; +} + +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +/////////////////////////////////////////////////////////////////////////////// +// +// negated_char_parser <--> chset free operators implementation +// +/////////////////////////////////////////////////////////////////////////////// +template +inline chset +operator|(chset const& a, negated_char_parser const& b) +{ + return a | chset(b); +} + +////////////////////////////////// +template +inline chset +operator&(chset const& a, negated_char_parser const& b) +{ + return a & chset(b); +} + +////////////////////////////////// +template +inline chset +operator-(chset const& a, negated_char_parser const& b) +{ + return a - chset(b); +} + +////////////////////////////////// +template +inline chset +operator^(chset const& a, negated_char_parser const& b) +{ + return a ^ chset(b); +} + +////////////////////////////////// +template +inline chset +operator|(negated_char_parser const& a, chset const& b) +{ + return chset(a) | b; +} + +////////////////////////////////// +template +inline chset +operator&(negated_char_parser const& a, chset const& b) +{ + return chset(a) & b; +} + +////////////////////////////////// +template +inline chset +operator-(negated_char_parser const& a, chset const& b) +{ + return chset(a) - b; +} + +////////////////////////////////// +template +inline chset +operator^(negated_char_parser const& a, chset const& b) +{ + return chset(a) ^ b; +} + +#else // BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +/////////////////////////////////////////////////////////////////////////////// +// +// negated_char_parser <--> chset free operators implementation +// +/////////////////////////////////////////////////////////////////////////////// +template +inline chset +operator|(chset const& a, negated_char_parser > const& b) +{ + return a | chset(b); +} + +////////////////////////////////// +template +inline chset +operator&(chset const& a, negated_char_parser > const& b) +{ + return a & chset(b); +} + +////////////////////////////////// +template +inline chset +operator-(chset const& a, negated_char_parser > const& b) +{ + return a - chset(b); +} + +////////////////////////////////// +template +inline chset +operator^(chset const& a, negated_char_parser > const& b) +{ + return a ^ chset(b); +} + +////////////////////////////////// +template +inline chset +operator|(negated_char_parser > const& a, chset const& b) +{ + return chset(a) | b; +} + +////////////////////////////////// +template +inline chset +operator&(negated_char_parser > const& a, chset const& b) +{ + return chset(a) & b; +} + +////////////////////////////////// +template +inline chset +operator-(negated_char_parser > const& a, chset const& b) +{ + return chset(a) - b; +} + +////////////////////////////////// +template +inline chset +operator^(negated_char_parser > const& a, chset const& b) +{ + return chset(a) ^ b; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// negated_char_parser <--> chset free operators implementation +// +/////////////////////////////////////////////////////////////////////////////// +template +inline chset +operator|(chset const& a, negated_char_parser > const& b) +{ + return a | chset(b); +} + +////////////////////////////////// +template +inline chset +operator&(chset const& a, negated_char_parser > const& b) +{ + return a & chset(b); +} + +////////////////////////////////// +template +inline chset +operator-(chset const& a, negated_char_parser > const& b) +{ + return a - chset(b); +} + +////////////////////////////////// +template +inline chset +operator^(chset const& a, negated_char_parser > const& b) +{ + return a ^ chset(b); +} + +////////////////////////////////// +template +inline chset +operator|(negated_char_parser > const& a, chset const& b) +{ + return chset(a) | b; +} + +////////////////////////////////// +template +inline chset +operator&(negated_char_parser > const& a, chset const& b) +{ + return chset(a) & b; +} + +////////////////////////////////// +template +inline chset +operator-(negated_char_parser > const& a, chset const& b) +{ + return chset(a) - b; +} + +////////////////////////////////// +template +inline chset +operator^(negated_char_parser > const& a, chset const& b) +{ + return chset(a) ^ b; +} + +#endif // BOOST_WORKAROUND(BOOST_MSVC, < 1300) + +/////////////////////////////////////////////////////////////////////////////// +// +// anychar_parser <--> chset free operators +// +// Where a is chset and b is a anychar_parser, and vice-versa, implements: +// +// a | b, a & b, a - b, a ^ b +// +/////////////////////////////////////////////////////////////////////////////// +namespace impl { + + template + inline BOOST_SPIRIT_CLASSIC_NS::range const& + full() + { + static BOOST_SPIRIT_CLASSIC_NS::range full_( + (std::numeric_limits::min)(), + (std::numeric_limits::max)()); + return full_; + } + + template + inline BOOST_SPIRIT_CLASSIC_NS::range const& + empty() + { + static BOOST_SPIRIT_CLASSIC_NS::range empty_; + return empty_; + } +} + +////////////////////////////////// +template +inline chset +operator|(chset const&, anychar_parser) +{ + return chset(impl::full()); +} + +////////////////////////////////// +template +inline chset +operator&(chset const& a, anychar_parser) +{ + return a; +} + +////////////////////////////////// +template +inline chset +operator-(chset const&, anychar_parser) +{ + return chset(); +} + +////////////////////////////////// +template +inline chset +operator^(chset const& a, anychar_parser) +{ + return ~a; +} + +////////////////////////////////// +template +inline chset +operator|(anychar_parser, chset const& /*b*/) +{ + return chset(impl::full()); +} + +////////////////////////////////// +template +inline chset +operator&(anychar_parser, chset const& b) +{ + return b; +} + +////////////////////////////////// +template +inline chset +operator-(anychar_parser, chset const& b) +{ + return ~b; +} + +////////////////////////////////// +template +inline chset +operator^(anychar_parser, chset const& b) +{ + return ~b; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// nothing_parser <--> chset free operators implementation +// +/////////////////////////////////////////////////////////////////////////////// +template +inline chset +operator|(chset const& a, nothing_parser) +{ + return a; +} + +////////////////////////////////// +template +inline chset +operator&(chset const& /*a*/, nothing_parser) +{ + return impl::empty(); +} + +////////////////////////////////// +template +inline chset +operator-(chset const& a, nothing_parser) +{ + return a; +} + +////////////////////////////////// +template +inline chset +operator^(chset const& a, nothing_parser) +{ + return a; +} + +////////////////////////////////// +template +inline chset +operator|(nothing_parser, chset const& b) +{ + return b; +} + +////////////////////////////////// +template +inline chset +operator&(nothing_parser, chset const& /*b*/) +{ + return impl::empty(); +} + +////////////////////////////////// +template +inline chset +operator-(nothing_parser, chset const& /*b*/) +{ + return impl::empty(); +} + +////////////////////////////////// +template +inline chset +operator^(nothing_parser, chset const& b) +{ + return b; +} + +/////////////////////////////////////////////////////////////////////////////// +BOOST_SPIRIT_CLASSIC_NAMESPACE_END + +}} // namespace boost::spirit + +#endif + diff --git a/3rdParty/Boost/src/boost/spirit/home/classic/version.hpp b/3rdParty/Boost/src/boost/spirit/home/classic/version.hpp new file mode 100644 index 0000000..77371ed --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/classic/version.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2003 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#if !defined(SPIRIT_CLASSIC_VERSION_HPP) +#define SPIRIT_CLASSIC_VERSION_HPP + +/////////////////////////////////////////////////////////////////////////////// +// +// This checks, whether the used Boost library is at least V1.32.0 +// +/////////////////////////////////////////////////////////////////////////////// +#include + +#if BOOST_VERSION < 103200 +#error "Spirit v1.8.x needs at least Boost V1.32.0 to compile successfully." +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// This is the version of the current Spirit distribution +// +/////////////////////////////////////////////////////////////////////////////// +#define SPIRIT_VERSION 0x1806 +#define SPIRIT_PIZZA_VERSION SPIRIT_MEGA_VEGGI // :-) + +#endif // defined(SPIRIT_VERSION_HPP) diff --git a/3rdParty/Boost/src/boost/spirit/include/classic_actions.hpp b/3rdParty/Boost/src/boost/spirit/include/classic_actions.hpp new file mode 100644 index 0000000..a37d631 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/include/classic_actions.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2008 Joel de Guzman + Copyright (c) 2001-2008 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_CLASSIC_ACTIONS +#define BOOST_SPIRIT_INCLUDE_CLASSIC_CLASSIC_ACTIONS +#include +#endif diff --git a/3rdParty/Boost/src/boost/spirit/include/classic_chset.hpp b/3rdParty/Boost/src/boost/spirit/include/classic_chset.hpp new file mode 100644 index 0000000..2f8df49 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/include/classic_chset.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2008 Joel de Guzman + Copyright (c) 2001-2008 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_CHSET +#define BOOST_SPIRIT_INCLUDE_CLASSIC_CHSET +#include +#endif diff --git a/3rdParty/Boost/src/boost/spirit/include/classic_numerics.hpp b/3rdParty/Boost/src/boost/spirit/include/classic_numerics.hpp new file mode 100644 index 0000000..75f7c05 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/include/classic_numerics.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2008 Joel de Guzman + Copyright (c) 2001-2008 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_NUMERICS +#define BOOST_SPIRIT_INCLUDE_CLASSIC_NUMERICS +#include +#endif diff --git a/3rdParty/Boost/src/boost/spirit/include/classic_operators.hpp b/3rdParty/Boost/src/boost/spirit/include/classic_operators.hpp new file mode 100644 index 0000000..c05d947 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/include/classic_operators.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2008 Joel de Guzman + Copyright (c) 2001-2008 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_OPERATORS +#define BOOST_SPIRIT_INCLUDE_CLASSIC_OPERATORS +#include +#endif diff --git a/3rdParty/Boost/src/boost/spirit/include/classic_rule.hpp b/3rdParty/Boost/src/boost/spirit/include/classic_rule.hpp new file mode 100644 index 0000000..c2e0df1 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/include/classic_rule.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2008 Joel de Guzman + Copyright (c) 2001-2008 Hartmut Kaiser + http://spirit.sourceforge.net/ + + Distributed under 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) +=============================================================================*/ +#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_RULE +#define BOOST_SPIRIT_INCLUDE_CLASSIC_RULE +#include +#endif diff --git a/3rdParty/Boost/src/libs/serialization/src/archive_exception.cpp b/3rdParty/Boost/src/libs/serialization/src/archive_exception.cpp new file mode 100644 index 0000000..50d326a --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/archive_exception.cpp @@ -0,0 +1,114 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// archive_exception.cpp: + +// (C) Copyright 2009 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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include +#include + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +archive_exception::archive_exception( + exception_code c, + const char * e1, + const char * e2 +) : + code(c) +{ + m_msg = "programming error"; + switch(code){ + case no_exception: + m_msg = "uninitialized exception"; + break; + case unregistered_class: + m_msg = "unregistered class"; + if(NULL != e1){ + m_msg += " - "; + m_msg += e1; + } + break; + case invalid_signature: + m_msg = "invalid signature"; + break; + case unsupported_version: + m_msg = "unsupported version"; + break; + case pointer_conflict: + m_msg = "pointer conflict"; + break; + case incompatible_native_format: + m_msg = "incompatible native format"; + if(NULL != e1){ + m_msg += " - "; + m_msg += e1; + } + break; + case array_size_too_short: + m_msg = "array size too short"; + break; + case input_stream_error: + m_msg = "input stream error"; + break; + case invalid_class_name: + m_msg = "class name too long"; + break; + case unregistered_cast: + m_msg = "unregistered void cast "; + m_msg += (NULL != e1) ? e1 : "?"; + m_msg += "<-"; + m_msg += (NULL != e2) ? e2 : "?"; + break; + case unsupported_class_version: + m_msg = "class version "; + m_msg += (NULL != e1) ? e1 : ""; + break; + case other_exception: + // if get here - it indicates a derived exception + // was sliced by passing by value in catch + m_msg = "unknown derived exception"; + break; + case multiple_code_instantiation: + m_msg = "code instantiated in more than one module"; + if(NULL != e1){ + m_msg += " - "; + m_msg += e1; + } + break; + case output_stream_error: + m_msg = "output stream error"; + break; + default: + BOOST_ASSERT(false); + break; + } +} +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +archive_exception::~archive_exception() throw () {} + +BOOST_ARCHIVE_DECL(const char *) +archive_exception::what( ) const throw() +{ + return m_msg.c_str(); +} +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +archive_exception::archive_exception() : + code(no_exception) +{} + +} // archive +} // boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_archive.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_archive.cpp new file mode 100644 index 0000000..23e5702 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_archive.cpp @@ -0,0 +1,80 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_archive.cpp: + +// (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. + +////////////////////////////////////////////////////////////////////// +// +// objects are stored as +// +// class_id* // -1 for a null pointer +// if a new class id +// [ +// exported key - class name* +// tracking level - always/never +// class version +// ] +// +// if tracking +// [ +// object_id +// ] +// +// [ // if a new object id +// data... +// ] +// +// * required only for pointers - optional for objects + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { + +/////////////////////////////////////////////////////////////////////// +// constants used in archive signature +//This should never ever change. note that is not an std::string +// string. +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_SIGNATURE(){ + return "serialization::archive"; +} + +// this should change if the capabilities are added to the library +// such that archives can be created which can't be read by previous +// versions of this library +// 1 - initial version +// 2 - made address tracking optional +// 3 - numerous changes - can't guarentee compatibility with previous versions +// 4 - Boost 1.34 +// added item_version to properly support versioning for collections +// 5 - Boost 1.36 +// changed serialization of collections: adding version even for primitive +// types caused backwards compatibility breaking change in 1.35 +// 6 - Boost 1.41 17 Nov 2009 +// serializing collection sizes as std::size_t +// 7 Boost 1.42 2 Feb 2010 +// error - changed binary version to 16 bits w/o changing library version # +// That is - binary archives are recorded with #6 even though they are +// different from the previous versions. This means that binary archives +// created with versions 1.42 and 1.43 will have to be fixed with a special +// program which fixes the library version # in the header +// Boost 1.43 6 May 2010 +// no change +// 8 - Boost 1.44 +// separated version_type into library_version_type and class_version_type +// changed version_type to be stored as 8 bits. + +BOOST_ARCHIVE_DECL(library_version_type) +BOOST_ARCHIVE_VERSION(){ + return library_version_type(9); +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_iarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_iarchive.cpp new file mode 100644 index 0000000..e9baddd --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_iarchive.cpp @@ -0,0 +1,576 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_archive.cpp: + +// (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 // msvc 6.0 needs this to suppress warnings + +#include +#include +#include +#include +#include // size_t, NULL + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include + +#define BOOST_ARCHIVE_SOURCE +// include this to prevent linker errors when the +// same modules are marked export and import. +#define BOOST_SERIALIZATION_SOURCE + +#include + +#include +#include +#include +#include +#include + +#include + +using namespace boost::serialization; + +namespace boost { +namespace archive { +namespace detail { + +class basic_iarchive_impl { + friend class basic_iarchive; + library_version_type m_archive_library_version; + unsigned int m_flags; + + ////////////////////////////////////////////////////////////////////// + // information about each serialized object loaded + // indexed on object_id + struct aobject + { + void * address; + bool loaded_as_pointer; + class_id_type class_id; + aobject( + void *a, + class_id_type class_id_ + ) : + address(a), + loaded_as_pointer(false), + class_id(class_id_) + {} + aobject() : + address(NULL), + loaded_as_pointer(false), + class_id(-2) + {} + }; + typedef std::vector object_id_vector_type; + object_id_vector_type object_id_vector; + + ////////////////////////////////////////////////////////////////////// + // used to implement the reset_object_address operation. + object_id_type moveable_objects_start; + object_id_type moveable_objects_end; + object_id_type moveable_objects_recent; + + void reset_object_address( + const void * new_address, + const void *old_address + ); + + ////////////////////////////////////////////////////////////////////// + // used by load object to look up class id given basic_serializer + struct cobject_type + { + const basic_iserializer * m_bis; + const class_id_type m_class_id; + cobject_type( + std::size_t class_id, + const basic_iserializer & bis + ) : + m_bis(& bis), + m_class_id(class_id) + {} + cobject_type(const cobject_type & rhs) : + m_bis(rhs.m_bis), + m_class_id(rhs.m_class_id) + {} + // the following cannot be defined because of the const + // member. This will generate a link error if an attempt + // is made to assign. This should never be necessary + cobject_type & operator=(const cobject_type & rhs); + bool operator<(const cobject_type &rhs) const + { + return *m_bis < *(rhs.m_bis); + } + }; + typedef std::set cobject_info_set_type; + cobject_info_set_type cobject_info_set; + + ////////////////////////////////////////////////////////////////////// + // information about each serialized class indexed on class_id + class cobject_id + { + public: + cobject_id & operator=(const cobject_id & rhs){ + bis_ptr = rhs.bis_ptr; + bpis_ptr = rhs.bpis_ptr; + file_version = rhs.file_version; + tracking_level = rhs.tracking_level; + initialized = rhs.initialized; + return *this; + } + const basic_iserializer * bis_ptr; + const basic_pointer_iserializer * bpis_ptr; + version_type file_version; + tracking_type tracking_level; + bool initialized; + + cobject_id(const basic_iserializer & bis_) : + bis_ptr(& bis_), + bpis_ptr(NULL), + file_version(0), + tracking_level(track_never), + initialized(false) + {} + cobject_id(const cobject_id &rhs): + bis_ptr(rhs.bis_ptr), + bpis_ptr(rhs.bpis_ptr), + file_version(rhs.file_version), + tracking_level(rhs.tracking_level), + initialized(rhs.initialized) + {} + }; + typedef std::vector cobject_id_vector_type; + cobject_id_vector_type cobject_id_vector; + + ////////////////////////////////////////////////////////////////////// + // address of the most recent object serialized as a poiner + // whose data itself is now pending serialization + void * pending_object; + const basic_iserializer * pending_bis; + version_type pending_version; + + basic_iarchive_impl(unsigned int flags) : + m_archive_library_version(BOOST_ARCHIVE_VERSION()), + m_flags(flags), + moveable_objects_start(0), + moveable_objects_end(0), + moveable_objects_recent(0), + pending_object(NULL), + pending_bis(NULL), + pending_version(0) + {} + ~basic_iarchive_impl(){} + void set_library_version(library_version_type archive_library_version){ + m_archive_library_version = archive_library_version; + } + bool + track( + basic_iarchive & ar, + void * & t + ); + void + load_preamble( + basic_iarchive & ar, + cobject_id & co + ); + class_id_type register_type( + const basic_iserializer & bis + ); + + // redirect through virtual functions to load functions for this archive + template + void load(basic_iarchive & ar, T & t){ + ar.vload(t); + } + +//public: + void + next_object_pointer(void * t){ + pending_object = t; + } + void delete_created_pointers(); + class_id_type register_type( + const basic_pointer_iserializer & bpis + ); + void load_object( + basic_iarchive & ar, + void * t, + const basic_iserializer & bis + ); + const basic_pointer_iserializer * load_pointer( + basic_iarchive & ar, + void * & t, + const basic_pointer_iserializer * bpis, + const basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & type + ) + + ); +}; + +inline void +basic_iarchive_impl::reset_object_address( + const void * new_address, + const void *old_address +){ + // this code handles a couple of situations. + // a) where reset_object_address is applied to an untracked object. + // In such a case the call is really superfluous and its really an + // an error. But we don't have access to the types here so we can't + // know that. However, this code will effectively turn this situation + // into a no-op and every thing will work fine - albeat with a small + // execution time penalty. + // b) where the call to reset_object_address doesn't immediatly follow + // the << operator to which it corresponds. This would be a bad idea + // but the code may work anyway. Naturally, a bad practice on the part + // of the programmer but we can't detect it - as above. So maybe we + // can save a few more people from themselves as above. + object_id_type i; + for(i = moveable_objects_recent; i < moveable_objects_end; ++i){ + if(old_address == object_id_vector[i].address) + break; + } + for(; i < moveable_objects_end; ++i){ + + // calculate displacement from this level + // warning - pointer arithmetic on void * is in herently non-portable + // but expected to work on all platforms in current usage + if(object_id_vector[i].address > old_address){ + std::size_t member_displacement + = reinterpret_cast(object_id_vector[i].address) + - reinterpret_cast(old_address); + object_id_vector[i].address = reinterpret_cast( + reinterpret_cast(new_address) + member_displacement + ); + } + else{ + std::size_t member_displacement + = reinterpret_cast(old_address) + - reinterpret_cast(object_id_vector[i].address); + object_id_vector[i].address = reinterpret_cast( + reinterpret_cast(new_address) - member_displacement + ); + } + } +} + +inline void +basic_iarchive_impl::delete_created_pointers() +{ + object_id_vector_type::iterator i; + for( + i = object_id_vector.begin(); + i != object_id_vector.end(); + ++i + ){ + if(i->loaded_as_pointer){ + // borland complains without this minor hack + const int j = i->class_id; + const cobject_id & co = cobject_id_vector[j]; + //const cobject_id & co = cobject_id_vector[i->class_id]; + // with the appropriate input serializer, + // delete the indicated object + co.bis_ptr->destroy(i->address); + } + } +} + +inline class_id_type +basic_iarchive_impl::register_type( + const basic_iserializer & bis +){ + class_id_type cid(cobject_info_set.size()); + cobject_type co(cid, bis); + std::pair + result = cobject_info_set.insert(co); + + if(result.second){ + cobject_id_vector.push_back(cobject_id(bis)); + BOOST_ASSERT(cobject_info_set.size() == cobject_id_vector.size()); + } + cid = result.first->m_class_id; + // borland complains without this minor hack + const int tid = cid; + cobject_id & coid = cobject_id_vector[tid]; + coid.bpis_ptr = bis.get_bpis_ptr(); + return cid; +} + +void +basic_iarchive_impl::load_preamble( + basic_iarchive & ar, + cobject_id & co +){ + if(! co.initialized){ + if(co.bis_ptr->class_info()){ + class_id_optional_type cid(class_id_type(0)); + load(ar, cid); // to be thrown away + load(ar, co.tracking_level); + load(ar, co.file_version); + } + else{ + // override tracking with indicator from class information + co.tracking_level = co.bis_ptr->tracking(m_flags); + co.file_version = version_type( + co.bis_ptr->version() + ); + } + co.initialized = true; + } +} + +bool +basic_iarchive_impl::track( + basic_iarchive & ar, + void * & t +){ + object_id_type oid; + load(ar, oid); + + // if its a reference to a old object + if(object_id_type(object_id_vector.size()) > oid){ + // we're done + t = object_id_vector[oid].address; + return false; + } + return true; +} + +inline void +basic_iarchive_impl::load_object( + basic_iarchive & ar, + void * t, + const basic_iserializer & bis +){ + // if its been serialized through a pointer and the preamble's been done + if(t == pending_object && & bis == pending_bis){ + // read data + (bis.load_object_data)(ar, t, pending_version); + return; + } + + const class_id_type cid = register_type(bis); + const int i = cid; + cobject_id & co = cobject_id_vector[i]; + + load_preamble(ar, co); + + // save the current move stack position in case we want to truncate it + boost::serialization::state_saver w(moveable_objects_start); + + // note: extra line used to evade borland issue + const bool tracking = co.tracking_level; + + object_id_type this_id; + moveable_objects_start = + this_id = object_id_type(object_id_vector.size()); + + // if we tracked this object when the archive was saved + if(tracking){ + // if it was already read + if(!track(ar, t)) + // we're done + return; + // add a new enty into the tracking list + object_id_vector.push_back(aobject(t, cid)); + // and add an entry for this object + moveable_objects_end = object_id_type(object_id_vector.size()); + } + // read data + (bis.load_object_data)(ar, t, co.file_version); + moveable_objects_recent = this_id; +} + +inline const basic_pointer_iserializer * +basic_iarchive_impl::load_pointer( + basic_iarchive &ar, + void * & t, + const basic_pointer_iserializer * bpis_ptr, + const basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & type_ + ) + +){ + class_id_type cid; + load(ar, cid); + + if(NULL_POINTER_TAG == cid){ + t = NULL; + return bpis_ptr; + } + + // if its a new class type - i.e. never been registered + if(class_id_type(cobject_info_set.size()) <= cid){ + // if its either abstract + if(NULL == bpis_ptr + // or polymorphic + || bpis_ptr->get_basic_serializer().is_polymorphic()){ + // is must have been exported + char key[BOOST_SERIALIZATION_MAX_KEY_SIZE]; + class_name_type class_name(key); + load(ar, class_name); + // if it has a class name + const serialization::extended_type_info *eti = NULL; + if(0 != key[0]) + eti = serialization::extended_type_info::find(key); + if(NULL == eti) + boost::serialization::throw_exception( + archive_exception(archive_exception::unregistered_class) + ); + bpis_ptr = (*finder)(*eti); + } + BOOST_ASSERT(NULL != bpis_ptr); + class_id_type new_cid = register_type(bpis_ptr->get_basic_serializer()); + int i = cid; + cobject_id_vector[i].bpis_ptr = bpis_ptr; + BOOST_ASSERT(new_cid == cid); + } + int i = cid; + cobject_id & co = cobject_id_vector[i]; + bpis_ptr = co.bpis_ptr; + + load_preamble(ar, co); + + // extra line to evade borland issue + const bool tracking = co.tracking_level; + // if we're tracking and the pointer has already been read + if(tracking && ! track(ar, t)) + // we're done + return bpis_ptr; + + // save state + serialization::state_saver w_start(moveable_objects_start); + + if(! tracking){ + bpis_ptr->load_object_ptr(ar, t, co.file_version); + } + else{ + serialization::state_saver x(pending_object); + serialization::state_saver y(pending_bis); + serialization::state_saver z(pending_version); + + pending_bis = & bpis_ptr->get_basic_serializer(); + pending_version = co.file_version; + + // predict next object id to be created + const unsigned int ui = object_id_vector.size(); + + serialization::state_saver w_end(moveable_objects_end); + + // because the following operation could move the items + // don't use co after this + // add to list of serialized objects so that we can properly handle + // cyclic strucures + object_id_vector.push_back(aobject(t, cid)); + + bpis_ptr->load_object_ptr( + ar, + object_id_vector[ui].address, + co.file_version + ); + t = object_id_vector[ui].address; + object_id_vector[ui].loaded_as_pointer = true; + BOOST_ASSERT(NULL != t); + } + + return bpis_ptr; +} + +} // namespace detail +} // namespace archive +} // namespace boost + +////////////////////////////////////////////////////////////////////// +// implementation of basic_iarchive functions +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::next_object_pointer(void *t){ + pimpl->next_object_pointer(t); +} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_iarchive::basic_iarchive(unsigned int flags) : + pimpl(new basic_iarchive_impl(flags)) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_iarchive::~basic_iarchive() +{ + delete pimpl; +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::set_library_version(library_version_type archive_library_version){ + pimpl->set_library_version(archive_library_version); +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::reset_object_address( + const void * new_address, + const void * old_address +){ + pimpl->reset_object_address(new_address, old_address); +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::load_object( + void *t, + const basic_iserializer & bis +){ + pimpl->load_object(*this, t, bis); +} + +// load a pointer object +BOOST_ARCHIVE_DECL(const basic_pointer_iserializer *) +basic_iarchive::load_pointer( + void * &t, + const basic_pointer_iserializer * bpis_ptr, + const basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & type_ + ) + +){ + return pimpl->load_pointer(*this, t, bpis_ptr, finder); +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::register_basic_serializer(const basic_iserializer & bis){ + pimpl->register_type(bis); +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::delete_created_pointers() +{ + pimpl->delete_created_pointers(); +} + +BOOST_ARCHIVE_DECL(boost::archive::library_version_type) +basic_iarchive::get_library_version() const{ + return pimpl->m_archive_library_version; +} + +BOOST_ARCHIVE_DECL(unsigned int) +basic_iarchive::get_flags() const{ + return pimpl->m_flags; +} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_iserializer.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_iserializer.cpp new file mode 100644 index 0000000..e18e16f --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_iserializer.cpp @@ -0,0 +1,33 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_iserializer.cpp: + +// (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 // NULL + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_iserializer::basic_iserializer( + const boost::serialization::extended_type_info & eti +) : + basic_serializer(eti), + m_bpis(NULL) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_iserializer::~basic_iserializer(){} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_oarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_oarchive.cpp new file mode 100644 index 0000000..33f33f8 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_oarchive.cpp @@ -0,0 +1,459 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_oarchive.cpp: + +// (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 // msvc 6.0 needs this for warning suppression + +#include +#include +#include // NULL + +#include +#include +#include + +// including this here to work around an ICC in intel 7.0 +// normally this would be part of basic_oarchive.hpp below. +#define BOOST_ARCHIVE_SOURCE +// include this to prevent linker errors when the +// same modules are marked export and import. +#define BOOST_SERIALIZATION_SOURCE + +#include +#include +#include +#include +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275) +#endif + +using namespace boost::serialization; + +namespace boost { +namespace archive { +namespace detail { + +class basic_oarchive_impl { + friend class basic_oarchive; + unsigned int m_flags; + + ////////////////////////////////////////////////////////////////////// + // information about each serialized object saved + // keyed on address, class_id + struct aobject + { + const void * address; + class_id_type class_id; + object_id_type object_id; + + bool operator<(const aobject &rhs) const + { + BOOST_ASSERT(NULL != address); + BOOST_ASSERT(NULL != rhs.address); + if( address < rhs.address ) + return true; + if( address > rhs.address ) + return false; + return class_id < rhs.class_id; + } + aobject & operator=(const aobject & rhs) + { + address = rhs.address; + class_id = rhs.class_id; + object_id = rhs.object_id; + return *this; + } + aobject( + const void *a, + class_id_type class_id_, + object_id_type object_id_ + ) : + address(a), + class_id(class_id_), + object_id(object_id_) + {} + aobject() : address(NULL){} + }; + // keyed on class_id, address + typedef std::set object_set_type; + object_set_type object_set; + + ////////////////////////////////////////////////////////////////////// + // information about each serialized class saved + // keyed on type_info + struct cobject_type + { + const basic_oserializer * m_bos_ptr; + const class_id_type m_class_id; + bool m_initialized; + cobject_type( + std::size_t class_id, + const basic_oserializer & bos + ) : + m_bos_ptr(& bos), + m_class_id(class_id), + m_initialized(false) + {} + cobject_type(const basic_oserializer & bos) + : m_bos_ptr(& bos) + {} + cobject_type( + const cobject_type & rhs + ) : + m_bos_ptr(rhs.m_bos_ptr), + m_class_id(rhs.m_class_id), + m_initialized(rhs.m_initialized) + {} + // the following cannot be defined because of the const + // member. This will generate a link error if an attempt + // is made to assign. This should never be necessary + // use this only for lookup argument + cobject_type & operator=(const cobject_type &rhs); + bool operator<(const cobject_type &rhs) const { + return *m_bos_ptr < *(rhs.m_bos_ptr); + } + }; + // keyed on type_info + typedef std::set cobject_info_set_type; + cobject_info_set_type cobject_info_set; + + // list of objects initially stored as pointers - used to detect errors + // keyed on object id + std::set stored_pointers; + + // address of the most recent object serialized as a poiner + // whose data itself is now pending serialization + const void * pending_object; + const basic_oserializer * pending_bos; + + basic_oarchive_impl(unsigned int flags) : + m_flags(flags), + pending_object(NULL), + pending_bos(NULL) + {} + + const cobject_type & + find(const basic_oserializer & bos); + const basic_oserializer * + find(const serialization::extended_type_info &ti) const; + +//public: + const cobject_type & + register_type(const basic_oserializer & bos); + void save_object( + basic_oarchive & ar, + const void *t, + const basic_oserializer & bos + ); + void save_pointer( + basic_oarchive & ar, + const void * t, + const basic_pointer_oserializer * bpos + ); +}; + +////////////////////////////////////////////////////////////////////// +// basic_oarchive implementation functions + +// given a type_info - find its bos +// return NULL if not found +inline const basic_oserializer * +basic_oarchive_impl::find(const serialization::extended_type_info & ti) const { + #ifdef BOOST_MSVC + # pragma warning(push) + # pragma warning(disable : 4511 4512) + #endif + class bosarg : + public basic_oserializer + { + bool class_info() const { + BOOST_ASSERT(false); + return false; + } + // returns true if objects should be tracked + bool tracking(const unsigned int) const { + BOOST_ASSERT(false); + return false; + } + // returns class version + version_type version() const { + BOOST_ASSERT(false); + return version_type(0); + } + // returns true if this class is polymorphic + bool is_polymorphic() const{ + BOOST_ASSERT(false); + return false; + } + void save_object_data( + basic_oarchive & /*ar*/, const void * /*x*/ + ) const { + BOOST_ASSERT(false); + } + public: + bosarg(const serialization::extended_type_info & eti) : + boost::archive::detail::basic_oserializer(eti) + {} + }; + #ifdef BOOST_MSVC + #pragma warning(pop) + #endif + bosarg bos(ti); + cobject_info_set_type::const_iterator cit + = cobject_info_set.find(cobject_type(bos)); + // it should already have been "registered" - see below + if(cit == cobject_info_set.end()){ + // if an entry is not found in the table it is because a pointer + // of a derived class has been serialized through its base class + // but the derived class hasn't been "registered" + return NULL; + } + // return pointer to the real class + return cit->m_bos_ptr; +} + +inline const basic_oarchive_impl::cobject_type & +basic_oarchive_impl::find(const basic_oserializer & bos) +{ + std::pair cresult = + cobject_info_set.insert(cobject_type(cobject_info_set.size(), bos)); + return *(cresult.first); +} + +inline const basic_oarchive_impl::cobject_type & +basic_oarchive_impl::register_type( + const basic_oserializer & bos +){ + cobject_type co(cobject_info_set.size(), bos); + std::pair + result = cobject_info_set.insert(co); + return *(result.first); +} + +inline void +basic_oarchive_impl::save_object( + basic_oarchive & ar, + const void *t, + const basic_oserializer & bos +){ + // if its been serialized through a pointer and the preamble's been done + if(t == pending_object && pending_bos == & bos){ + // just save the object data + ar.end_preamble(); + (bos.save_object_data)(ar, t); + return; + } + + // get class information for this object + const cobject_type & co = register_type(bos); + if(bos.class_info()){ + if( ! co.m_initialized){ + ar.vsave(class_id_optional_type(co.m_class_id)); + ar.vsave(tracking_type(bos.tracking(m_flags))); + ar.vsave(version_type(bos.version())); + (const_cast(co)).m_initialized = true; + } + } + + // we're not tracking this type of object + if(! bos.tracking(m_flags)){ + // just windup the preamble - no object id to write + ar.end_preamble(); + // and save the data + (bos.save_object_data)(ar, t); + return; + } + + // look for an existing object id + object_id_type oid(object_set.size()); + // lookup to see if this object has already been written to the archive + basic_oarchive_impl::aobject ao(t, co.m_class_id, oid); + std::pair + aresult = object_set.insert(ao); + oid = aresult.first->object_id; + + // if its a new object + if(aresult.second){ + // write out the object id + ar.vsave(oid); + ar.end_preamble(); + // and data + (bos.save_object_data)(ar, t); + return; + } + + // check that it wasn't originally stored through a pointer + if(stored_pointers.end() != stored_pointers.find(oid)){ + // this has to be a user error. loading such an archive + // would create duplicate objects + boost::serialization::throw_exception( + archive_exception(archive_exception::pointer_conflict) + ); + } + // just save the object id + ar.vsave(object_reference_type(oid)); + ar.end_preamble(); + return; +} + +// save a pointer to an object instance +inline void +basic_oarchive_impl::save_pointer( + basic_oarchive & ar, + const void * t, + const basic_pointer_oserializer * bpos_ptr +){ + const basic_oserializer & bos = bpos_ptr->get_basic_serializer(); + std::size_t original_count = cobject_info_set.size(); + const cobject_type & co = register_type(bos); + if(! co.m_initialized){ + ar.vsave(co.m_class_id); + // if its a previously unregistered class + if((cobject_info_set.size() > original_count)){ + if(bos.is_polymorphic()){ + const serialization::extended_type_info *eti = & bos.get_eti(); + const char * key = NULL; + if(NULL != eti) + key = eti->get_key(); + if(NULL != key){ + // the following is required by IBM C++ compiler which + // makes a copy when passing a non-const to a const. This + // is permitted by the standard but rarely seen in practice + const class_name_type cn(key); + // write out the external class identifier + ar.vsave(cn); + } + else + // without an external class name + // we won't be able to de-serialize it so bail now + boost::serialization::throw_exception( + archive_exception(archive_exception::unregistered_class) + ); + } + } + if(bos.class_info()){ + ar.vsave(tracking_type(bos.tracking(m_flags))); + ar.vsave(version_type(bos.version())); + } + (const_cast(co)).m_initialized = true; + } + else{ + ar.vsave(class_id_reference_type(co.m_class_id)); + } + + // if we're not tracking + if(! bos.tracking(m_flags)){ + // just save the data itself + ar.end_preamble(); + serialization::state_saver x(pending_object); + serialization::state_saver y(pending_bos); + pending_object = t; + pending_bos = & bpos_ptr->get_basic_serializer(); + bpos_ptr->save_object_ptr(ar, t); + return; + } + + object_id_type oid(object_set.size()); + // lookup to see if this object has already been written to the archive + basic_oarchive_impl::aobject ao(t, co.m_class_id, oid); + std::pair + aresult = object_set.insert(ao); + oid = aresult.first->object_id; + // if the saved object already exists + if(! aresult.second){ + // append the object id to he preamble + ar.vsave(object_reference_type(oid)); + // and windup. + ar.end_preamble(); + return; + } + + // append id of this object to preamble + ar.vsave(oid); + ar.end_preamble(); + + // and save the object itself + serialization::state_saver x(pending_object); + serialization::state_saver y(pending_bos); + pending_object = t; + pending_bos = & bpos_ptr->get_basic_serializer(); + bpos_ptr->save_object_ptr(ar, t); + // add to the set of object initially stored through pointers + stored_pointers.insert(oid); +} + +} // namespace detail +} // namespace archive +} // namespace boost + +////////////////////////////////////////////////////////////////////// +// implementation of basic_oarchive functions + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_oarchive::basic_oarchive(unsigned int flags) + : pimpl(new basic_oarchive_impl(flags)) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_oarchive::~basic_oarchive() +{ + delete pimpl; +} + +BOOST_ARCHIVE_DECL(void) +basic_oarchive::save_object( + const void *x, + const basic_oserializer & bos +){ + pimpl->save_object(*this, x, bos); +} + +BOOST_ARCHIVE_DECL(void) +basic_oarchive::save_pointer( + const void * t, + const basic_pointer_oserializer * bpos_ptr +){ + pimpl->save_pointer(*this, t, bpos_ptr); +} + +BOOST_ARCHIVE_DECL(void) +basic_oarchive::register_basic_serializer(const basic_oserializer & bos){ + pimpl->register_type(bos); +} + +BOOST_ARCHIVE_DECL(library_version_type) +basic_oarchive::get_library_version() const{ + return BOOST_ARCHIVE_VERSION(); +} + +BOOST_ARCHIVE_DECL(unsigned int) +basic_oarchive::get_flags() const{ + return pimpl->m_flags; +} + +BOOST_ARCHIVE_DECL(void) +basic_oarchive::end_preamble(){ +} + +} // namespace detail +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_oserializer.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_oserializer.cpp new file mode 100644 index 0000000..0e21806 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_oserializer.cpp @@ -0,0 +1,33 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_oserializer.cpp: + +// (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 // NULL + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_oserializer::basic_oserializer( + const boost::serialization::extended_type_info & eti +) : + basic_serializer(eti), + m_bpos(NULL) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_oserializer::~basic_oserializer(){} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_pointer_iserializer.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_pointer_iserializer.cpp new file mode 100644 index 0000000..fac766f --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_pointer_iserializer.cpp @@ -0,0 +1,30 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_pointer_iserializer.cpp: + +// (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. + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_pointer_iserializer::basic_pointer_iserializer( + const boost::serialization::extended_type_info & eti +) : + basic_serializer(eti) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_pointer_iserializer::~basic_pointer_iserializer() {} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_pointer_oserializer.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_pointer_oserializer.cpp new file mode 100644 index 0000000..9e9f1dd --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_pointer_oserializer.cpp @@ -0,0 +1,30 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_pointer_oserializer.cpp: + +// (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. + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_pointer_oserializer::basic_pointer_oserializer( + const boost::serialization::extended_type_info & eti +) : + basic_serializer(eti) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_pointer_oserializer::~basic_pointer_oserializer() {} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_serializer_map.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_serializer_map.cpp new file mode 100644 index 0000000..80e805f --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_serializer_map.cpp @@ -0,0 +1,111 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// serializer_map.cpp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include + +#define BOOST_ARCHIVE_SOURCE +// include this to prevent linker errors when the +// same modules are marked export and import. +#define BOOST_SERIALIZATION_SOURCE + +#include +#include + +#include +#include + +namespace boost { + namespace serialization { + class extended_type_info; + } +namespace archive { +namespace detail { + +bool +basic_serializer_map::type_info_pointer_compare::operator()( + const basic_serializer * lhs, const basic_serializer * rhs +) const { + return *lhs < *rhs; +} + +BOOST_ARCHIVE_DECL(bool) +basic_serializer_map::insert(const basic_serializer * bs){ + // attempt to insert serializer into it's map + const std::pair result = + m_map.insert(bs); + // the following is commented out - rather than being just + // deleted as a reminder not to try this. + + // At first it seemed like a good idea. It enforced the + // idea that a type be exported from at most one code module + // (DLL or mainline). This would enforce a "one definition rule" + // across code modules. This seems a good idea to me. + // But it seems that it's just too hard for many users to implement. + + // Ideally, I would like to make this exception a warning - + // but there isn't anyway to do that. + + // if this fails, it's because it's been instantiated + // in multiple modules - DLLS - a recipe for problems. + // So trap this here + // if(!result.second){ + // boost::serialization::throw_exception( + // archive_exception( + // archive_exception::multiple_code_instantiation, + // bs->get_debug_info() + // ) + // ); + // } + return true; +} + +BOOST_ARCHIVE_DECL(void) +basic_serializer_map::erase(const basic_serializer * bs){ + map_type::iterator it = m_map.begin(); + map_type::iterator it_end = m_map.end(); + + while(it != it_end){ + // note item 9 from Effective STL !!! it++ + if(*it == bs) + m_map.erase(it++); + else + it++; + } + // note: we can't do this since some of the eti records + // we're pointing to might be expired and the comparison + // won't work. Leave this as a reminder not to "optimize" this. + //it = m_map.find(bs); + //assert(it != m_map.end()); + //if(*it == bs) + // m_map.erase(it); +} +BOOST_ARCHIVE_DECL(const basic_serializer *) +basic_serializer_map::find( + const boost::serialization::extended_type_info & eti +) const { + const basic_serializer_arg bs(eti); + map_type::const_iterator it; + it = m_map.find(& bs); + if(it == m_map.end()){ + BOOST_ASSERT(false); + return 0; + } + return *it; +} + +} // namespace detail +} // namespace archive +} // namespace boost + diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_text_iprimitive.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_text_iprimitive.cpp new file mode 100644 index 0000000..c67a942 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_text_iprimitive.cpp @@ -0,0 +1,28 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_iprimitive.cpp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +namespace boost { +namespace archive { + +// explicitly instantiate for this type of text stream +template class basic_text_iprimitive ; + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_text_oprimitive.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_text_oprimitive.cpp new file mode 100644 index 0000000..d8d98d6 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_text_oprimitive.cpp @@ -0,0 +1,28 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_oprimitive.cpp: + +// (C) Copyright 2004 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for updates, documentation, and revision history. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +namespace boost { +namespace archive { + +// explicitly instantiate for this type of text stream +template class basic_text_oprimitive ; + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_text_wiprimitive.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_text_wiprimitive.cpp new file mode 100644 index 0000000..4797485 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_text_wiprimitive.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_wiprimitive.cpp: + +// (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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +namespace boost { +namespace archive { + +template class basic_text_iprimitive ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_text_woprimitive.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_text_woprimitive.cpp new file mode 100644 index 0000000..e13294e --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_text_woprimitive.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_woprimitive.cpp: + +// (C) Copyright 2004 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for updates, documentation, and revision history. + +#include + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +namespace boost { +namespace archive { + +template class basic_text_oprimitive ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_xml_archive.cpp b/3rdParty/Boost/src/libs/serialization/src/basic_xml_archive.cpp new file mode 100644 index 0000000..e71aaef --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_xml_archive.cpp @@ -0,0 +1,51 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_archive.cpp: + +// (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. + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { + +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_OBJECT_ID(){ + return "object_id"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_OBJECT_REFERENCE(){ + return "object_id_reference"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_CLASS_ID(){ + return "class_id"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(){ + return "class_id_reference"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_CLASS_NAME(){ + return "class_name"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_TRACKING(){ + return "tracking_level"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_VERSION(){ + return "version"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_SIGNATURE(){ + return "signature"; +} + +}// namespace archive +}// namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/basic_xml_grammar.ipp b/3rdParty/Boost/src/libs/serialization/src/basic_xml_grammar.ipp new file mode 100644 index 0000000..011bba7 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/basic_xml_grammar.ipp @@ -0,0 +1,468 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_grammar.ipp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include +#include // BOOST_DEDUCED_TYPENAME + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +// spirit stuff +#include +#include +#include + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +// for head_iterator test +//#include +#include +#include + +#include +#include +#include +#include +#include +#include + +using namespace boost::spirit::classic; + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// template code for basic_xml_grammar of both wchar_t and char types + +namespace xml { // anonymous + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +template +struct assign_impl { + T & t; + void operator()(const T t_) const { + t = t_; + } + assign_impl(T & t_) + : t(t_) + {} +}; + +template<> +struct assign_impl { + std::string & t; + void operator()( + std::string::const_iterator b, + std::string::const_iterator e + ) const { + t.resize(0); + while(b != e){ + t += * b; + ++b; + } + } + assign_impl & operator=( + assign_impl & rhs + ); + assign_impl(std::string & t_) + : t(t_) + {} +}; + +#ifndef BOOST_NO_STD_WSTRING +template<> +struct assign_impl { + std::wstring & t; + void operator()( + std::wstring::const_iterator b, + std::wstring::const_iterator e + ) const { + t.resize(0); + while(b != e){ + t += * b; + ++b; + } + } + assign_impl(std::wstring & t_) + : t(t_) + {} +}; +#endif + +template +assign_impl assign_object(T &t){ + return assign_impl(t); +} + +struct assign_level { + tracking_type & tracking_level; + void operator()(const unsigned int tracking_level_) const { + tracking_level = (0 == tracking_level_) ? false : true; + } + assign_level(tracking_type & tracking_level_) + : tracking_level(tracking_level_) + {} +}; + +template +struct append_string { + String & contents; + void operator()(Iterator start, Iterator end) const { + #if 0 + typedef boost::archive::iterators::xml_unescape translator; + contents.append( + translator(BOOST_MAKE_PFTO_WRAPPER(start)), + translator(BOOST_MAKE_PFTO_WRAPPER(end)) + ); + #endif + contents.append(start, end); + } + append_string(String & contents_) + : contents(contents_) + {} +}; + +template +struct append_char { + String & contents; + void operator()(const unsigned int char_value) const { + const BOOST_DEDUCED_TYPENAME String::value_type z = char_value; + contents += z; + } + append_char(String & contents_) + : contents(contents_) + {} +}; + +template +struct append_lit { + String & contents; + template + void operator()(const X & /*x*/, const Y & /*y*/) const { + const BOOST_DEDUCED_TYPENAME String::value_type z = c; + contents += z; + } + append_lit(String & contents_) + : contents(contents_) + {} +}; + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +} // namespace anonymous + +template +bool basic_xml_grammar::my_parse( + BOOST_DEDUCED_TYPENAME basic_xml_grammar::IStream & is, + const rule_t & rule_, + CharType delimiter +) const { + if(is.fail()){ + boost::serialization::throw_exception( + archive_exception(archive_exception::input_stream_error) + ); + } + + boost::io::ios_flags_saver ifs(is); + is >> std::noskipws; + + std::basic_string arg; + + CharType val; + do{ + BOOST_DEDUCED_TYPENAME basic_xml_grammar::IStream::int_type + result = is.get(); + if(is.fail()) + return false; + val = static_cast(result); + arg += val; + } + while(val != delimiter); + + // read just one more character. This will be the newline after the tag + // this is so that the next operation will return fail if the archive + // is terminated. This will permit the archive to be used for debug + // and transaction data logging in the standard way. + + parse_info::iterator> + result = boost::spirit::classic::parse(arg.begin(), arg.end(), rule_); + return result.hit; +} + +template +bool basic_xml_grammar::parse_start_tag( + BOOST_DEDUCED_TYPENAME basic_xml_grammar::IStream & is +){ + rv.class_name.resize(0); + return my_parse(is, STag); +} + +template +bool basic_xml_grammar::parse_end_tag(IStream & is) const { + return my_parse(is, ETag); +} + +template +bool basic_xml_grammar::parse_string(IStream & is, StringType & s){ + rv.contents.resize(0); + bool result = my_parse(is, content, '<'); + // note: unget caused a problem with dinkumware. replace with + // is.unget(); + // putback another dilimiter instead + is.putback('<'); + if(result) + s = rv.contents; + return result; +} + +template +basic_xml_grammar::basic_xml_grammar(){ + init_chset(); + + S = + +(Sch) + ; + + // refactoring to workaround template depth on darwin + NameHead = (Letter | '_' | ':'); + NameTail = *NameChar ; + Name = + NameHead >> NameTail + ; + + Eq = + !S >> '=' >> !S + ; + + AttributeList = + *(S >> Attribute) + ; + + STag = + !S + >> '<' + >> Name [xml::assign_object(rv.object_name)] + >> AttributeList + >> !S + >> '>' + ; + + ETag = + !S + >> "> Name [xml::assign_object(rv.object_name)] + >> !S + >> '>' + ; + + // refactoring to workaround template depth on darwin + CharDataChars = +(anychar_p - chset_p(L"&<")); + CharData = + CharDataChars [ + xml::append_string< + StringType, + BOOST_DEDUCED_TYPENAME std::basic_string::const_iterator + >(rv.contents) + ] + ; + + // slight factoring works around ICE in msvc 6.0 + CharRef1 = + str_p(L"&#") >> uint_p [xml::append_char(rv.contents)] >> L';' + ; + CharRef2 = + str_p(L"&#x") >> hex_p [xml::append_char(rv.contents)] >> L';' + ; + CharRef = CharRef1 | CharRef2 ; + + AmpRef = str_p(L"&")[xml::append_lit(rv.contents)]; + LTRef = str_p(L"<")[xml::append_lit(rv.contents)]; + GTRef = str_p(L">")[xml::append_lit'>(rv.contents)]; + AposRef = str_p(L"'")[xml::append_lit(rv.contents)]; + QuoteRef = str_p(L""")[xml::append_lit(rv.contents)]; + + Reference = + AmpRef + | LTRef + | GTRef + | AposRef + | QuoteRef + | CharRef + ; + + content = + L"<" // should be end_p + | +(Reference | CharData) >> L"<" + ; + + ClassIDAttribute = + str_p(BOOST_ARCHIVE_XML_CLASS_ID()) >> NameTail + >> Eq + >> L'"' + >> int_p [xml::assign_object(rv.class_id)] + >> L'"' + ; + + ObjectIDAttribute = ( + str_p(BOOST_ARCHIVE_XML_OBJECT_ID()) + | + str_p(BOOST_ARCHIVE_XML_OBJECT_REFERENCE()) + ) + >> NameTail + >> Eq + >> L'"' + >> L'_' + >> uint_p [xml::assign_object(rv.object_id)] + >> L'"' + ; + + AmpName = str_p(L"&")[xml::append_lit(rv.class_name)]; + LTName = str_p(L"<")[xml::append_lit(rv.class_name)]; + GTName = str_p(L">")[xml::append_lit'>(rv.class_name)]; + ClassNameChar = + AmpName + | LTName + | GTName + | (anychar_p - chset_p(L"\"")) [xml::append_char(rv.class_name)] + ; + + ClassName = + * ClassNameChar + ; + + ClassNameAttribute = + str_p(BOOST_ARCHIVE_XML_CLASS_NAME()) + >> Eq + >> L'"' + >> ClassName + >> L'"' + ; + + TrackingAttribute = + str_p(BOOST_ARCHIVE_XML_TRACKING()) + >> Eq + >> L'"' + >> uint_p [xml::assign_level(rv.tracking_level)] + >> L'"' + ; + + VersionAttribute = + str_p(BOOST_ARCHIVE_XML_VERSION()) + >> Eq + >> L'"' + >> uint_p [xml::assign_object(rv.version)] + >> L'"' + ; + + UnusedAttribute = + Name + >> Eq + >> L'"' + >> !CharData + >> L'"' + ; + + Attribute = + ClassIDAttribute + | ObjectIDAttribute + | ClassNameAttribute + | TrackingAttribute + | VersionAttribute + | UnusedAttribute + ; + + XMLDeclChars = *(anychar_p - chset_p(L"?>")); + XMLDecl = + !S + >> str_p(L"> S + >> str_p(L"version") + >> Eq + >> str_p(L"\"1.0\"") + >> XMLDeclChars + >> !S + >> str_p(L"?>") + ; + + DocTypeDeclChars = *(anychar_p - chset_p(L">")); + DocTypeDecl = + !S + >> str_p(L"> DocTypeDeclChars + >> L'>' + ; + + SignatureAttribute = + str_p(L"signature") + >> Eq + >> L'"' + >> Name [xml::assign_object(rv.class_name)] + >> L'"' + ; + + SerializationWrapper = + !S + >> str_p(L"> S + >> ( (SignatureAttribute >> S >> VersionAttribute) + | (VersionAttribute >> S >> SignatureAttribute) + ) + >> !S + >> L'>' + ; +} + +template +void basic_xml_grammar::init(IStream & is){ + init_chset(); + if(! my_parse(is, XMLDecl)) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + if(! my_parse(is, DocTypeDecl)) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + if(! my_parse(is, SerializationWrapper)) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + if(! std::equal(rv.class_name.begin(), rv.class_name.end(), BOOST_ARCHIVE_SIGNATURE())) + boost::serialization::throw_exception( + archive_exception(archive_exception::invalid_signature) + ); +} + +template +void basic_xml_grammar::windup(IStream & is){ + if(is.fail()) + return; + // uh-oh - don't throw exception from code called by a destructor ! + // so just ignore any failure. + my_parse(is, ETag); +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/binary_iarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/binary_iarchive.cpp new file mode 100644 index 0000000..7bb0435 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/binary_iarchive.cpp @@ -0,0 +1,53 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_iarchive.cpp: + +// (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 + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +#include +#include +#include + +namespace boost { +namespace archive { + +// explicitly instantiate for this type of stream +template class detail::archive_serializer_map; +template class basic_binary_iprimitive< + naked_binary_iarchive, + std::istream::char_type, + std::istream::traits_type +>; +template class basic_binary_iarchive ; +template class binary_iarchive_impl< + naked_binary_iarchive, + std::istream::char_type, + std::istream::traits_type +>; + +// explicitly instantiate for this type of stream +template class detail::archive_serializer_map; +template class basic_binary_iprimitive< + binary_iarchive, + std::istream::char_type, + std::istream::traits_type +>; +template class basic_binary_iarchive ; +template class binary_iarchive_impl< + binary_iarchive, + std::istream::char_type, + std::istream::traits_type +>; + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/binary_oarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/binary_oarchive.cpp new file mode 100644 index 0000000..e7ab904 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/binary_oarchive.cpp @@ -0,0 +1,39 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_oarchive.cpp: + +// (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 + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of binary stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_binary_oprimitive< + binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type +>; +template class basic_binary_oarchive ; +template class binary_oarchive_impl< + binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type +>; + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/binary_wiarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/binary_wiarchive.cpp new file mode 100644 index 0000000..a6135c8 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/binary_wiarchive.cpp @@ -0,0 +1,60 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_wiarchive.cpp: + +// (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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_binary_iprimitive< + naked_binary_wiarchive, + wchar_t, + std::char_traits +>; +template class basic_binary_iarchive ; +template class binary_iarchive_impl< + naked_binary_wiarchive, + wchar_t, + std::char_traits +>; + +// explicitly instantiate for this type of text stream +template class detail::archive_serializer_map; +template class basic_binary_iprimitive< + binary_wiarchive, + wchar_t, + std::char_traits +>; +template class basic_binary_iarchive ; +template class binary_iarchive_impl< + binary_wiarchive, + wchar_t, + std::char_traits +>; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF + diff --git a/3rdParty/Boost/src/libs/serialization/src/binary_woarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/binary_woarchive.cpp new file mode 100644 index 0000000..905a319 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/binary_woarchive.cpp @@ -0,0 +1,44 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_woarchive.cpp: + +// (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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_binary_oprimitive< + binary_woarchive, + wchar_t, + std::char_traits +>; +template class basic_binary_oarchive ; +template class binary_oarchive_impl< + binary_woarchive, + wchar_t, + std::char_traits +>; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/3rdParty/Boost/src/libs/serialization/src/codecvt_null.cpp b/3rdParty/Boost/src/libs/serialization/src/codecvt_null.cpp new file mode 100644 index 0000000..80ba2a3 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/codecvt_null.cpp @@ -0,0 +1,83 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// codecvt_null.cpp + +// Copyright (c) 2004 Robert Ramey, Indiana University (garcia@osl.iu.edu) +// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). +// 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) + +#define BOOST_WARCHIVE_SOURCE +#include + +// codecvt implementation for passing wchar_t objects to char output +// without any translation whatever. Used to implement binary output +// of wchar_t objects. + +namespace boost { +namespace archive { + +BOOST_WARCHIVE_DECL(std::codecvt_base::result) +codecvt_null::do_out( + std::mbstate_t & /*state*/, + const wchar_t * first1, + const wchar_t * last1, + const wchar_t * & next1, + char * first2, + char * last2, + char * & next2 +) const { + while(first1 != last1){ + // Per std::22.2.1.5.2/2, we can store no more that + // last2-first2 characters. If we need to more encode + // next internal char type, return 'partial'. + if(static_cast(sizeof(wchar_t)) > (last2 - first2)){ + next1 = first1; + next2 = first2; + return std::codecvt_base::partial; + } + * reinterpret_cast(first2) = * first1++; + first2 += sizeof(wchar_t); + + } + next1 = first1; + next2 = first2; + return std::codecvt_base::ok; +} + +BOOST_WARCHIVE_DECL(std::codecvt_base::result) +codecvt_null::do_in( + std::mbstate_t & /*state*/, + const char * first1, + const char * last1, + const char * & next1, + wchar_t * first2, + wchar_t * last2, + wchar_t * & next2 +) const { + // Process input characters until we've run of them, + // or the number of remaining characters is not + // enough to construct another output character, + // or we've run out of place for output characters. + while(first2 != last2){ + // Have we converted all input characters? + // Return with 'ok', if so. + if (first1 == last1) + break; + // Do we have less input characters than needed + // for a single output character? + if(static_cast(sizeof(wchar_t)) > (last1 - first1)){ + next1 = first1; + next2 = first2; + return std::codecvt_base::partial; + } + *first2++ = * reinterpret_cast(first1); + first1 += sizeof(wchar_t); + } + next1 = first1; + next2 = first2; + return std::codecvt_base::ok; +} + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/extended_type_info.cpp b/3rdParty/Boost/src/libs/serialization/src/extended_type_info.cpp new file mode 100644 index 0000000..2efbefc --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/extended_type_info.cpp @@ -0,0 +1,188 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// extended_type_info.cpp: implementation for portable version of type_info + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include +#include +#include +#include // NULL + +#include // msvc needs this to suppress warning + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ using ::strcmp; } +#endif + +#include +#include +#include + +#define BOOST_SERIALIZATION_SOURCE +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace serialization { +namespace detail { + +struct key_compare +{ + bool + operator()( + const extended_type_info * lhs, + const extended_type_info * rhs + ) const { + // performance shortcut + if(lhs == rhs) + return false; + const char * l = lhs->get_key(); + BOOST_ASSERT(NULL != l); + const char * r = rhs->get_key(); + BOOST_ASSERT(NULL != r); + // performance shortcut + // shortcut to exploit string pooling + if(l == r) + return false; + // for exported types, use the string key so that + // multiple instances in different translation units + // can be matched up + return std::strcmp(l, r) < 0; + } +}; + +typedef std::multiset ktmap; + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +class extended_type_info_arg : public extended_type_info +{ + virtual bool + is_less_than(const extended_type_info & /*rhs*/) const { + BOOST_ASSERT(false); + return false; + }; + virtual bool + is_equal(const extended_type_info & /*rhs*/) const { + BOOST_ASSERT(false); + return false; + }; + virtual const char * get_debug_info() const { + return get_key(); + } + virtual void * construct(unsigned int /*count*/, ...) const{ + BOOST_ASSERT(false); + return NULL; + } + virtual void destroy(void const * const /*p*/) const { + BOOST_ASSERT(false); + } +public: + extended_type_info_arg(const char * key) : + extended_type_info(0, key) + {} + + ~extended_type_info_arg(){ + } +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +} // namespace detail + +BOOST_SERIALIZATION_DECL(void) +extended_type_info::key_register() const{ + if(NULL == get_key()) + return; + singleton::get_mutable_instance().insert(this); +} + +BOOST_SERIALIZATION_DECL(void) +extended_type_info::key_unregister() const{ + if(NULL == get_key()) + return; + if(! singleton::is_destroyed()){ + detail::ktmap & x = singleton::get_mutable_instance(); + detail::ktmap::iterator start = x.lower_bound(this); + detail::ktmap::iterator end = x.upper_bound(this); + // remove entry in map which corresponds to this type + for(;start != end; ++start){ + if(this == *start){ + x.erase(start); + break; + } + } + } +} + +BOOST_SERIALIZATION_DECL(const extended_type_info *) +extended_type_info::find(const char *key) { + BOOST_ASSERT(NULL != key); + const detail::ktmap & k = singleton::get_const_instance(); + const detail::extended_type_info_arg eti_key(key); + const detail::ktmap::const_iterator it = k.find(& eti_key); + if(k.end() == it) + return NULL; + return *(it); +} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info::extended_type_info( + const unsigned int type_info_key, + const char * key +) : + m_type_info_key(type_info_key), + m_key(key) +{ +} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info::~extended_type_info(){ +} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info::operator<(const extended_type_info &rhs) const { + // short cut for a common cases + if(this == & rhs) + return false; + if(m_type_info_key == rhs.m_type_info_key){ + return is_less_than(rhs); + } + if(m_type_info_key < rhs.m_type_info_key) + return true; + return false; +} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info::operator==(const extended_type_info &rhs) const { + // short cut for a common cases + if(this == & rhs) + return true; + if(m_type_info_key != rhs.m_type_info_key){ + return false; + } + return is_equal(rhs); +} + +} // namespace serialization +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/extended_type_info_no_rtti.cpp b/3rdParty/Boost/src/libs/serialization/src/extended_type_info_no_rtti.cpp new file mode 100644 index 0000000..3b2a888 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/extended_type_info_no_rtti.cpp @@ -0,0 +1,85 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// extended_type_info_no_rtti.cpp: specific implementation of type info +// that is NOT based on typeid + +// (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 +#include // NULL +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ using ::strcmp; } +#endif + +#define BOOST_SERIALIZATION_SOURCE +#include + +#define EXTENDED_TYPE_INFO_NO_RTTI_KEY 2 + +namespace boost { +namespace serialization { +namespace no_rtti_system { + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info_no_rtti_0::extended_type_info_no_rtti_0( + const char * key +) : + extended_type_info(EXTENDED_TYPE_INFO_NO_RTTI_KEY, key) +{} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info_no_rtti_0::is_less_than( + const boost::serialization::extended_type_info &rhs) const +{ + // shortcut for common case + if(this == & rhs) + return false; + const char * l = get_key(); + const char * r = rhs.get_key(); + // if this assertion is triggered, it could mean one of the following + // a) This class was never exported - make sure all calls which use + // this method of type id are in fact exported. + // b) This class was used (e.g. serialized through a pointer) before + // it was exported. Make sure that classes which use this method + // of type id are NOT "automatically" registered by serializating + // through a pointer to the to most derived class. OR make sure + // that the BOOST_CLASS_EXPORT is included in every file + // which does this. + BOOST_ASSERT(NULL != l); + BOOST_ASSERT(NULL != r); + return std::strcmp(l, r) < 0; +} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info_no_rtti_0::is_equal( + const boost::serialization::extended_type_info &rhs) const +{ + // shortcut for common case + if(this == & rhs) + return true; + // null keys don't match with anything + const char * l = get_key(); + BOOST_ASSERT(NULL != l); + if(NULL == l) + return false; + const char * r = rhs.get_key(); + BOOST_ASSERT(NULL != r); + if(NULL == r) + return false; + return 0 == std::strcmp(l, r); +} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info_no_rtti_0::~extended_type_info_no_rtti_0() +{} + +} // namespece detail +} // namespace serialization +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/extended_type_info_typeid.cpp b/3rdParty/Boost/src/libs/serialization/src/extended_type_info_typeid.cpp new file mode 100644 index 0000000..463287a --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/extended_type_info_typeid.cpp @@ -0,0 +1,161 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// extended_type_info_typeid.cpp: specific implementation of type info +// that is based on typeid + +// (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 +#include +#include +#include +#include // NULL + +#include + +#include + +#define BOOST_SERIALIZATION_SOURCE +#include + +namespace boost { +namespace serialization { +namespace typeid_system { + +#define EXTENDED_TYPE_INFO_TYPE_KEY 1 + +struct type_compare +{ + bool + operator()( + const extended_type_info_typeid_0 * lhs, + const extended_type_info_typeid_0 * rhs + ) const { + return lhs->is_less_than(*rhs); + } +}; + +typedef std::multiset< + const extended_type_info_typeid_0 *, + type_compare +> tkmap; + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info_typeid_0::is_less_than( + const boost::serialization::extended_type_info & rhs +) const { + // shortcut for common case + if(this == & rhs) + return false; + return 0 != m_ti->before( + *(static_cast(rhs).m_ti) + ); +} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info_typeid_0::is_equal( + const boost::serialization::extended_type_info & rhs +) const { + return + // note: std::type_info == operator returns an int !!! + // the following permits conversion to bool without a warning. + ! ( + * m_ti + != *(static_cast(rhs).m_ti) + ) + ; +} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info_typeid_0::extended_type_info_typeid_0( + const char * key +) : + extended_type_info(EXTENDED_TYPE_INFO_TYPE_KEY, key), + m_ti(NULL) +{} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info_typeid_0::~extended_type_info_typeid_0() +{} + +BOOST_SERIALIZATION_DECL(void) +extended_type_info_typeid_0::type_register(const std::type_info & ti){ + m_ti = & ti; + singleton::get_mutable_instance().insert(this); +} + +BOOST_SERIALIZATION_DECL(void) +extended_type_info_typeid_0::type_unregister() +{ + if(NULL != m_ti){ + if(! singleton::is_destroyed()){ + tkmap & x = singleton::get_mutable_instance(); + tkmap::iterator start = x.lower_bound(this); + tkmap::iterator end = x.upper_bound(this); + BOOST_ASSERT(start != end); + + // remove entry in map which corresponds to this type + do{ + if(this == *start) + x.erase(start++); + else + ++start; + }while(start != end); + } + } + m_ti = NULL; +} + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +// this derivation is used for creating search arguments +class extended_type_info_typeid_arg : + public extended_type_info_typeid_0 +{ + virtual void * construct(unsigned int /*count*/, ...) const{ + BOOST_ASSERT(false); + return NULL; + } + virtual void destroy(void const * const /*p*/) const { + BOOST_ASSERT(false); + } +public: + extended_type_info_typeid_arg(const std::type_info & ti) : + extended_type_info_typeid_0(NULL) + { + // note absense of self register and key as this is used only as + // search argument given a type_info reference and is not to + // be added to the map. + m_ti = & ti; + } + ~extended_type_info_typeid_arg(){ + m_ti = NULL; + } +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +BOOST_SERIALIZATION_DECL(const extended_type_info *) +extended_type_info_typeid_0::get_extended_type_info( + const std::type_info & ti +) const { + typeid_system::extended_type_info_typeid_arg etia(ti); + const tkmap & t = singleton::get_const_instance(); + const tkmap::const_iterator it = t.find(& etia); + if(t.end() == it) + return NULL; + return *(it); +} + +} // namespace detail +} // namespace serialization +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/polymorphic_iarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/polymorphic_iarchive.cpp new file mode 100644 index 0000000..5e8c986 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/polymorphic_iarchive.cpp @@ -0,0 +1,29 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_iarchive.cpp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include + +#include +#include + +namespace boost { +namespace archive { +namespace detail { + +template class archive_serializer_map; + +} // detail +} // archive +} // boost diff --git a/3rdParty/Boost/src/libs/serialization/src/polymorphic_oarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/polymorphic_oarchive.cpp new file mode 100644 index 0000000..b85895e --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/polymorphic_oarchive.cpp @@ -0,0 +1,29 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_oarchive.cpp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include + +#include +#include + +namespace boost { +namespace archive { +namespace detail { + +template class archive_serializer_map; + +} // detail +} // archive +} // boost diff --git a/3rdParty/Boost/src/libs/serialization/src/shared_ptr_helper.cpp b/3rdParty/Boost/src/libs/serialization/src/shared_ptr_helper.cpp new file mode 100644 index 0000000..b155cd9 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/shared_ptr_helper.cpp @@ -0,0 +1,138 @@ +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// shared_ptr_helper.hpp: serialization for boost shared pointern + +// (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo +// 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 +#include +#include +#include // NULL + +#define BOOST_ARCHIVE_SOURCE +// include this to prevent linker errors when the +// same modules are marked export and import. +#define BOOST_SERIALIZATION_SOURCE + +#include +#include +#include +#include +#include + +namespace boost { +namespace archive{ +namespace detail { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// a common class for holding various types of shared pointers + +// returns pointer to object and an indicator whether this is a +// new entry (true) or a previous one (false) +BOOST_ARCHIVE_DECL(shared_ptr) +shared_ptr_helper::get_od( + const void * t, + const boost::serialization::extended_type_info * true_type, + const boost::serialization::extended_type_info * this_type +){ + // get void pointer to the most derived type + // this uniquely identifies the object referred to + const void * od = void_downcast( + *true_type, + *this_type, + t + ); + if(NULL == od) + boost::serialization::throw_exception( + archive_exception( + archive_exception::unregistered_cast, + true_type->get_debug_info(), + this_type->get_debug_info() + ) + ); + + // make tracking array if necessary + if(NULL == m_pointers) + m_pointers = new collection_type; + + //shared_ptr sp(od, null_deleter()); + shared_ptr sp(od, null_deleter()); + collection_type::iterator i = m_pointers->find(sp); + + if(i == m_pointers->end()){ + shared_ptr np; + return np; + } + od = void_upcast( + *true_type, + *this_type, + i->get() + ); + if(NULL == od) + boost::serialization::throw_exception( + archive_exception( + archive_exception::unregistered_cast, + true_type->get_debug_info(), + this_type->get_debug_info() + ) + ); + + return shared_ptr( + const_pointer_cast(*i), + const_cast(od) + ); +} + +BOOST_ARCHIVE_DECL(void) +shared_ptr_helper::append(const boost::shared_ptr &sp){ + // make tracking array if necessary + if(NULL == m_pointers) + m_pointers = new collection_type; + + collection_type::iterator i = m_pointers->find(sp); + + if(i == m_pointers->end()){ + std::pair result; + result = m_pointers->insert(sp); + BOOST_ASSERT(result.second); + } +} + +// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP +BOOST_ARCHIVE_DECL(void) +shared_ptr_helper::append(const boost_132::shared_ptr & t){ + if(NULL == m_pointers_132) + m_pointers_132 = new std::list >; + m_pointers_132->push_back(t); +} +// #endif +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +shared_ptr_helper::shared_ptr_helper() : + m_pointers(NULL) + #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP + , m_pointers_132(NULL) + #endif +{} +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +shared_ptr_helper::~shared_ptr_helper(){ + if(NULL != m_pointers) + delete m_pointers; + #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP + if(NULL != m_pointers_132) + delete m_pointers_132; + #endif +} + +} // namespace detail +} // namespace serialization +} // namespace boost + diff --git a/3rdParty/Boost/src/libs/serialization/src/stl_port.cpp b/3rdParty/Boost/src/libs/serialization/src/stl_port.cpp new file mode 100644 index 0000000..e5378bc --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/stl_port.cpp @@ -0,0 +1,43 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// stl_port.cpp: implementation of run-time casting of void pointers + +// (C) Copyright 2005 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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +// this befuddles the msvc 6 compiler so we can't use it +#if ! ((defined _MSC_VER) && (_MSC_VER <= 1300)) \ +&& ! defined(__BORLANDC__) + +#include + +#if defined(__SGI_STL_PORT) && (__SGI_STL_PORT < 0x500) + +#include + +// explicit instantiation + +namespace std { + +template +locale::locale( + const locale& __loc, boost::archive::codecvt_null * __f +); + +template +locale::locale( + const locale& __loc, boost::archive::codecvt_null * __f +); + +} // namespace std + +#endif + +#endif diff --git a/3rdParty/Boost/src/libs/serialization/src/text_iarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/text_iarchive.cpp new file mode 100644 index 0000000..cb9017f --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/text_iarchive.cpp @@ -0,0 +1,36 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_iarchive.cpp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_text_iarchive ; +template class text_iarchive_impl ; + +template class detail::archive_serializer_map; +template class basic_text_iarchive ; +template class text_iarchive_impl ; + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/text_oarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/text_oarchive.cpp new file mode 100644 index 0000000..19165d6 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/text_oarchive.cpp @@ -0,0 +1,33 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_oarchive.cpp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +//template class basic_text_oprimitive ; +template class detail::archive_serializer_map; +template class basic_text_oarchive ; +template class text_oarchive_impl ; + +} // namespace serialization +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/text_wiarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/text_wiarchive.cpp new file mode 100644 index 0000000..a6630c0 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/text_wiarchive.cpp @@ -0,0 +1,41 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_wiarchive.cpp: + +// (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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_text_iarchive ; +template class text_wiarchive_impl ; + +template class detail::archive_serializer_map; +template class basic_text_iarchive ; +template class text_wiarchive_impl ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF + diff --git a/3rdParty/Boost/src/libs/serialization/src/text_woarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/text_woarchive.cpp new file mode 100644 index 0000000..54b4a0d --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/text_woarchive.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_woarchive.cpp: + +// (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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_text_oarchive ; +template class text_woarchive_impl ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/3rdParty/Boost/src/libs/serialization/src/utf8_codecvt_facet.cpp b/3rdParty/Boost/src/libs/serialization/src/utf8_codecvt_facet.cpp new file mode 100644 index 0000000..d064c63 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/utf8_codecvt_facet.cpp @@ -0,0 +1,21 @@ +// Copyright Vladimir Prus 2004. +// Distributed under 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) + +#include +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_UTF8_BEGIN_NAMESPACE \ + namespace boost { namespace archive { namespace detail { +#define BOOST_UTF8_DECL +#define BOOST_UTF8_END_NAMESPACE }}} +#include +#undef BOOST_UTF8_END_NAMESPACE +#undef BOOST_UTF8_DECL +#undef BOOST_UTF8_BEGIN_NAMESPACE + +#endif // BOOST_NO_STD_WSTREAMBUF + diff --git a/3rdParty/Boost/src/libs/serialization/src/void_cast.cpp b/3rdParty/Boost/src/libs/serialization/src/void_cast.cpp new file mode 100644 index 0000000..df31235 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/void_cast.cpp @@ -0,0 +1,360 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// void_cast.cpp: implementation of run-time casting of void pointers + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include // NULL +#ifdef BOOST_SERIALIZATION_LOG +#include +#endif + +// STL +#include +#include +#include +#include + +// BOOST +#define BOOST_SERIALIZATION_SOURCE +#include +#include +#include + +namespace boost { +namespace serialization { +namespace void_cast_detail { + +// note that void_casters are keyed on value of +// member extended type info records - NOT their +// addresses. This is necessary in order for the +// void cast operations to work across dll and exe +// module boundries. +bool void_caster::operator<(const void_caster & rhs) const { + // include short cut to save time and eliminate + // problems when when base class aren't virtual + if(m_derived != rhs.m_derived){ + if(*m_derived < *rhs.m_derived) + return true; + if(*rhs.m_derived < *m_derived) + return false; + } + // m_derived == rhs.m_derived + if(m_base != rhs.m_base) + return *m_base < *rhs.m_base; + else + return false; +} + +struct void_caster_compare { + bool operator()(const void_caster * lhs, const void_caster * rhs) const { + return *lhs < *rhs; + } +}; + +typedef std::set set_type; +typedef boost::serialization::singleton void_caster_registry; + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +// implementation of shortcut void caster +class void_caster_shortcut : public void_caster +{ + bool m_includes_virtual_base; + + void const * + vbc_upcast( + void const * const t + ) const; + void const * + vbc_downcast( + void const * const t + ) const; + virtual void const * + upcast(void const * const t) const{ + if(m_includes_virtual_base) + return vbc_upcast(t); + return static_cast ( t ) - m_difference; + } + virtual void const * + downcast(void const * const t) const{ + if(m_includes_virtual_base) + return vbc_downcast(t); + return static_cast ( t ) + m_difference; + } + virtual bool is_shortcut() const { + return true; + } + virtual bool has_virtual_base() const { + return m_includes_virtual_base; + } +public: + void_caster_shortcut( + extended_type_info const * derived, + extended_type_info const * base, + std::ptrdiff_t difference, + bool includes_virtual_base, + void_caster const * const parent + ) : + void_caster(derived, base, difference, parent), + m_includes_virtual_base(includes_virtual_base) + { + recursive_register(includes_virtual_base); + } + virtual ~void_caster_shortcut(){ + recursive_unregister(); + } +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +void const * +void_caster_shortcut::vbc_downcast( + void const * const t +) const { + // try to find a chain that gives us what we want + const void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_const_instance(); + void_cast_detail::set_type::const_iterator it; + for(it = s.begin(); it != s.end(); ++it){ + // if the current candidate casts to the desired target type + if ((*it)->m_derived == m_derived){ + // and if it's not us + if ((*it)->m_base != m_base){ + // try to cast from the candidate base to our base + const void * t_new; + t_new = void_downcast(*(*it)->m_base, *m_base, t); + // if we were successful + if(NULL != t_new){ + // recast to our derived + const void_caster * vc = *it; + return vc->downcast(t_new); + } + } + } + } + return NULL; +} + +void const * +void_caster_shortcut::vbc_upcast( + void const * const t +) const { + // try to find a chain that gives us what we want + const void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_const_instance(); + void_cast_detail::set_type::const_iterator it; + for(it = s.begin(); it != s.end(); ++it){ + // if the current candidate casts from the desired base type + if((*it)->m_base == m_base){ + // and if it's not us + if ((*it)->m_derived != m_derived){ + // try to cast from the candidate derived to our our derived + const void * t_new; + t_new = void_upcast(*m_derived, *(*it)->m_derived, t); + if(NULL != t_new) + return (*it)->upcast(t_new); + } + } + } + return NULL; +} + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +// just used as a search key +class void_caster_argument : public void_caster +{ + virtual void const * + upcast(void const * const /*t*/) const { + BOOST_ASSERT(false); + return NULL; + } + virtual void const * + downcast( void const * const /*t*/) const { + BOOST_ASSERT(false); + return NULL; + } + virtual bool has_virtual_base() const { + BOOST_ASSERT(false); + return false; + } +public: + void_caster_argument( + extended_type_info const * derived, + extended_type_info const * base + ) : + void_caster(derived, base) + {} + virtual ~void_caster_argument(){}; +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +// implementation of void caster base class +BOOST_SERIALIZATION_DECL(void) +void_caster::recursive_register(bool includes_virtual_base) const { + void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_mutable_instance(); + + #ifdef BOOST_SERIALIZATION_LOG + std::clog << "recursive_register\n"; + std::clog << m_derived->get_debug_info(); + std::clog << "<-"; + std::clog << m_base->get_debug_info(); + std::clog << "\n"; + #endif + + std::pair result; + // comment this out for now. + result = s.insert(this); + //assert(result.second); + + // generate all implied void_casts. + void_cast_detail::set_type::const_iterator it; + for(it = s.begin(); it != s.end(); ++it){ + if(* m_derived == * (*it)->m_base){ + const void_caster_argument vca( + (*it)->m_derived, + m_base + ); + void_cast_detail::set_type::const_iterator i; + i = s.find(& vca); + if(i == s.end()){ + new void_caster_shortcut( + (*it)->m_derived, + m_base, + m_difference + (*it)->m_difference, + (*it)->has_virtual_base() || includes_virtual_base, + this + ); + } + } + if(* (*it)->m_derived == * m_base){ + const void_caster_argument vca( + m_derived, + (*it)->m_base + ); + void_cast_detail::set_type::const_iterator i; + i = s.find(& vca); + if(i == s.end()){ + new void_caster_shortcut( + m_derived, + (*it)->m_base, + m_difference + (*it)->m_difference, + (*it)->has_virtual_base() || includes_virtual_base, + this + ); + } + } + } +} + +BOOST_SERIALIZATION_DECL(void) +void_caster::recursive_unregister() const { + if(void_caster_registry::is_destroyed()) + return; + + #ifdef BOOST_SERIALIZATION_LOG + std::clog << "recursive_unregister\n"; + std::clog << m_derived->get_debug_info(); + std::clog << "<-"; + std::clog << m_base->get_debug_info(); + std::clog << "\n"; + #endif + + void_cast_detail::set_type & s + = void_caster_registry::get_mutable_instance(); + + // delete all shortcuts which use this primitive + void_cast_detail::set_type::iterator it; + for(it = s.begin(); it != s.end();){ + const void_caster * vc = *it; + if(vc == this){ + s.erase(it++); + } + else + if(vc->m_parent == this){ + s.erase(it); + delete vc; + it = s.begin(); + } + else + it++; + } +} + +} // namespace void_cast_detail + +// Given a void *, assume that it really points to an instance of one type +// and alter it so that it would point to an instance of a related type. +// Return the altered pointer. If there exists no sequence of casts that +// can transform from_type to to_type, return a NULL. +BOOST_SERIALIZATION_DECL(void const *) +void_upcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const t +){ + // same types - trivial case + if (derived == base) + return t; + + // check to see if base/derived pair is found in the registry + const void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_const_instance(); + const void_cast_detail::void_caster_argument ca(& derived, & base); + + void_cast_detail::set_type::const_iterator it; + it = s.find(& ca); + if (s.end() != it) + return (*it)->upcast(t); + + return NULL; +} + +BOOST_SERIALIZATION_DECL(void const *) +void_downcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const t +){ + // same types - trivial case + if (derived == base) + return t; + + // check to see if base/derived pair is found in the registry + const void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_const_instance(); + const void_cast_detail::void_caster_argument ca(& derived, & base); + + void_cast_detail::set_type::const_iterator it; + it = s.find(&ca); + if (s.end() != it) + return(*it)->downcast(t); + + return NULL; +} + +} // namespace serialization +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/xml_archive_exception.cpp b/3rdParty/Boost/src/libs/serialization/src/xml_archive_exception.cpp new file mode 100644 index 0000000..ea78916 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/xml_archive_exception.cpp @@ -0,0 +1,56 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_archive_exception.cpp: + +// (C) Copyright 2009 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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + + +#include +#include +#include + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +xml_archive_exception::xml_archive_exception( + exception_code c, + const char * e1, + const char * e2 + ) : + archive_exception(other_exception, e1, e2) + { + m_msg = "programming error"; + switch(c){ + case xml_archive_parsing_error: + m_msg = "unrecognized XML syntax"; + break; + case xml_archive_tag_mismatch: + m_msg = "XML start/end tag mismatch"; + if(NULL != e1){ + m_msg += " - "; + m_msg += e1; + } + break; + case xml_archive_tag_name_error: + m_msg = "Invalid XML tag name"; + break; + default: + BOOST_ASSERT(false); + break; + } + } + +} // archive +} // boost diff --git a/3rdParty/Boost/src/libs/serialization/src/xml_grammar.cpp b/3rdParty/Boost/src/libs/serialization/src/xml_grammar.cpp new file mode 100644 index 0000000..05904f4 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/xml_grammar.cpp @@ -0,0 +1,73 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_grammar.cpp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include + +using namespace boost::spirit::classic; + +#include + +// fixup for borland +// The following code will be put into Boost.Config in a later revision +#if ! defined(__SGI_STL_PORT) \ +&& defined(BOOST_RWSTD_VER) && BOOST_RWSTD_VER<=0x020101 +#include +namespace std { + template<> + inline string & + string::replace ( + char * first1, + char * last1, + const char * first2, + const char * last2 + ){ + replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2); + return *this; + } +} // namespace std +#endif + +namespace boost { +namespace archive { + +typedef basic_xml_grammar xml_grammar; + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// specific definitions for char based XML + +template<> +void xml_grammar::init_chset(){ + Char = chset_t("\x9\xA\xD\x20-\x7f\x80\x81-\xFF"); + Letter = chset_t("\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF"); + Digit = chset_t("0-9"); + Extender = chset_t('\xB7'); + Sch = chset_t("\x20\x9\xD\xA"); + NameChar = Letter | Digit | chset_p("._:-") | Extender ; +} + +} // namespace archive +} // namespace boost + +#include "basic_xml_grammar.ipp" + +namespace boost { +namespace archive { + +// explicit instantiation of xml for 8 bit characters +template class basic_xml_grammar; + +} // namespace archive +} // namespace boost + diff --git a/3rdParty/Boost/src/libs/serialization/src/xml_iarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/xml_iarchive.cpp new file mode 100644 index 0000000..6d0de77 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/xml_iarchive.cpp @@ -0,0 +1,46 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_iarchive.cpp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE + +// the following works around an issue between spirit 1.61 and borland. +// it turns out the the certain spirit stuff must be defined before +// certain parts of mpl. including this here makes sure that happens +#include +#include +#if BOOST_WORKAROUND(__BORLANDC__, <= 0x560 ) +#include +#endif + +#include +#include + +// explicitly instantiate for this type of xml stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_xml_iarchive ; +template class xml_iarchive_impl ; + +template class detail::archive_serializer_map; +template class basic_xml_iarchive ; +template class xml_iarchive_impl ; + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/xml_oarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/xml_oarchive.cpp new file mode 100644 index 0000000..88bcdd6 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/xml_oarchive.cpp @@ -0,0 +1,32 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_oarchive.cpp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of xml stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_xml_oarchive ; +template class xml_oarchive_impl ; + +} // namespace archive +} // namespace boost diff --git a/3rdParty/Boost/src/libs/serialization/src/xml_wgrammar.cpp b/3rdParty/Boost/src/libs/serialization/src/xml_wgrammar.cpp new file mode 100644 index 0000000..d3dd844 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/xml_wgrammar.cpp @@ -0,0 +1,157 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_wgrammar.cpp: + +// (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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include + +using namespace boost::spirit::classic; + +// fixup for RogueWave +#include +#if ! defined(__SGI_STL_PORT) \ +&& defined(BOOST_RWSTD_VER) && BOOST_RWSTD_VER<=0x020101 +#include +namespace std { + template<> + inline wstring & + wstring::replace ( + wchar_t * first1, + wchar_t * last1, + const wchar_t * first2, + const wchar_t * last2 + ){ + replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2); + return *this; + } +} // namespace std +#endif + +namespace boost { +namespace archive { + +typedef basic_xml_grammar xml_wgrammar; + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// specific definitions for wchar_t based XML + +template<> +void xml_wgrammar::init_chset(){ + Char = chset_t( + #if defined(__GNUC__) && defined(linux) + L"\x9\xA\xD\x20-\xD7FF\xE000-\xFFFD\x10000-\x10FFFF" + #else + L"\x9\xA\xD\x20-\xD7FF\xE000-\xFFFD" + #endif + ); + + Sch = chset_t(L"\x20\x9\xD\xA"); + + BaseChar = chset_t( + L"\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF\x100-\x131\x134-\x13E" + L"\x141-\x148\x14A-\x17E\x180-\x1C3\x1CD-\x1F0\x1F4-\x1F5\x1FA-\x217" + L"\x250-\x2A8\x2BB-\x2C1\x386\x388-\x38A\x38C\x38E-\x3A1\x3A3-\x3CE" + L"\x3D0-\x3D6\x3DA\x3DC\x3DE\x3E0\x3E2-\x3F3\x401-\x40C\x40E-\x44F" + L"\x451-\x45C\x45E-\x481\x490-\x4C4\x4C7-\x4C8\x4CB-\x4CC\x4D0-\x4EB" + L"\x4EE-\x4F5\x4F8-\x4F9\x531-\x556\x559\x561-\x586\x5D0-\x5EA" + L"\x5F0-\x5F2\x621-\x63A\x641-\x64A\x671-\x6B7\x6BA-\x6BE\x6C0-\x6CE" + L"\x6D0-\x6D3\x6D5\x6E5-\x6E6\x905-\x939\x93D\x958-\x961\x985-\x98C" + L"\x98F-\x990\x993-\x9A8\x9AA-\x9B0\x9B2\x9B6-\x9B9\x9DC-\x9DD" + L"\x9DF-\x9E1\x9F0-\x9F1\xA05-\xA0A\xA0F-\xA10\xA13-\xA28\xA2A-\xA30" + L"\xA32-\xA33\xA35-\xA36\xA38-\xA39\xA59-\xA5C\xA5E\xA72-\xA74" + L"\xA85-\xA8B\xA8D\xA8F-\xA91\xA93-\xAA8\xAAA-\xAB0\xAB2-\xAB3" + L"\xAB5-\xAB9\xABD\xAE0\xB05-\xB0C\xB0F-\xB10\xB13-\xB28\xB2A-\xB30" + L"\xB32-\xB33\xB36-\xB39\xB3D\xB5C-\xB5D\xB5F-\xB61\xB85-\xB8A" + L"\xB8E-\xB90\xB92-\xB95\xB99-\xB9A\xB9C\xB9E-\xB9F\xBA3-\xBA4" + L"\xBA8-\xBAA\xBAE-\xBB5\xBB7-\xBB9\xC05-\xC0C\xC0E-\xC10\xC12-\xC28" + L"\xC2A-\xC33\xC35-\xC39\xC60-\xC61\xC85-\xC8C\xC8E-\xC90\xC92-\xCA8" + L"\xCAA-\xCB3\xCB5-\xCB9\xCDE\xCE0-\xCE1\xD05-\xD0C\xD0E-\xD10" + L"\xD12-\xD28\xD2A-\xD39\xD60-\xD61\xE01-\xE2E\xE30\xE32-\xE33" + L"\xE40-\xE45\xE81-\xE82\xE84\xE87-\xE88\xE8A\xE8D\xE94-\xE97" + L"\xE99-\xE9F\xEA1-\xEA3\xEA5\xEA7\xEAA-\xEAB\xEAD-\xEAE\xEB0" + L"\xEB2-\xEB3\xEBD\xEC0-\xEC4\xF40-\xF47\xF49-\xF69\x10A0-\x10C5" + L"\x10D0-\x10F6\x1100\x1102-\x1103\x1105-\x1107\x1109\x110B-\x110C" + L"\x110E-\x1112\x113C\x113E\x1140\x114C\x114E\x1150\x1154-\x1155" + L"\x1159\x115F-\x1161\x1163\x1165\x1167\x1169\x116D-\x116E" + L"\x1172-\x1173\x1175\x119E\x11A8\x11AB\x11AE-\x11AF\x11B7-\x11B8" + L"\x11BA\x11BC-\x11C2\x11EB\x11F0\x11F9\x1E00-\x1E9B\x1EA0-\x1EF9" + L"\x1F00-\x1F15\x1F18-\x1F1D\x1F20-\x1F45\x1F48-\x1F4D\x1F50-\x1F57" + L"\x1F59\x1F5B\x1F5D\x1F5F-\x1F7D\x1F80-\x1FB4\x1FB6-\x1FBC\x1FBE" + L"\x1FC2-\x1FC4\x1FC6-\x1FCC\x1FD0-\x1FD3\x1FD6-\x1FDB\x1FE0-\x1FEC" + L"\x1FF2-\x1FF4\x1FF6-\x1FFC\x2126\x212A-\x212B\x212E\x2180-\x2182" + L"\x3041-\x3094\x30A1-\x30FA\x3105-\x312C\xAC00-\xD7A3" + ); + + Ideographic = chset_t(L"\x4E00-\x9FA5\x3007\x3021-\x3029"); + + Letter = BaseChar | Ideographic; + + CombiningChar = chset_t( + L"\x0300-\x0345\x0360-\x0361\x0483-\x0486\x0591-\x05A1\x05A3-\x05B9" + L"\x05BB-\x05BD\x05BF\x05C1-\x05C2\x05C4\x064B-\x0652\x0670" + L"\x06D6-\x06DC\x06DD-\x06DF\x06E0-\x06E4\x06E7-\x06E8\x06EA-\x06ED" + L"\x0901-\x0903\x093C\x093E-\x094C\x094D\x0951-\x0954\x0962-\x0963" + L"\x0981-\x0983\x09BC\x09BE\x09BF\x09C0-\x09C4\x09C7-\x09C8" + L"\x09CB-\x09CD\x09D7\x09E2-\x09E3\x0A02\x0A3C\x0A3E\x0A3F" + L"\x0A40-\x0A42\x0A47-\x0A48\x0A4B-\x0A4D\x0A70-\x0A71\x0A81-\x0A83" + L"\x0ABC\x0ABE-\x0AC5\x0AC7-\x0AC9\x0ACB-\x0ACD\x0B01-\x0B03\x0B3C" + L"\x0B3E-\x0B43\x0B47-\x0B48\x0B4B-\x0B4D\x0B56-\x0B57\x0B82-\x0B83" + L"\x0BBE-\x0BC2\x0BC6-\x0BC8\x0BCA-\x0BCD\x0BD7\x0C01-\x0C03" + L"\x0C3E-\x0C44\x0C46-\x0C48\x0C4A-\x0C4D\x0C55-\x0C56\x0C82-\x0C83" + L"\x0CBE-\x0CC4\x0CC6-\x0CC8\x0CCA-\x0CCD\x0CD5-\x0CD6\x0D02-\x0D03" + L"\x0D3E-\x0D43\x0D46-\x0D48\x0D4A-\x0D4D\x0D57\x0E31\x0E34-\x0E3A" + L"\x0E47-\x0E4E\x0EB1\x0EB4-\x0EB9\x0EBB-\x0EBC\x0EC8-\x0ECD" + L"\x0F18-\x0F19\x0F35\x0F37\x0F39\x0F3E\x0F3F\x0F71-\x0F84" + L"\x0F86-\x0F8B\x0F90-\x0F95\x0F97\x0F99-\x0FAD\x0FB1-\x0FB7\x0FB9" + L"\x20D0-\x20DC\x20E1\x302A-\x302F\x3099\x309A" + ); + + Digit = chset_t( + L"\x0030-\x0039\x0660-\x0669\x06F0-\x06F9\x0966-\x096F\x09E6-\x09EF" + L"\x0A66-\x0A6F\x0AE6-\x0AEF\x0B66-\x0B6F\x0BE7-\x0BEF\x0C66-\x0C6F" + L"\x0CE6-\x0CEF\x0D66-\x0D6F\x0E50-\x0E59\x0ED0-\x0ED9\x0F20-\x0F29" + ); + + Extender = chset_t( + L"\x00B7\x02D0\x02D1\x0387\x0640\x0E46\x0EC6\x3005\x3031-\x3035" + L"\x309D-\x309E\x30FC-\x30FE" + ); + + NameChar = + Letter + | Digit + | L'.' + | L'-' + | L'_' + | L':' + | CombiningChar + | Extender + ; +} +} // namespace archive +} // namespace boost + +#include "basic_xml_grammar.ipp" + +namespace boost { +namespace archive { + +// explicit instantiation of xml for wide characters +template class basic_xml_grammar; + +} // namespace archive +} // namespace boost + +#endif diff --git a/3rdParty/Boost/src/libs/serialization/src/xml_wiarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/xml_wiarchive.cpp new file mode 100644 index 0000000..2e10947 --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/xml_wiarchive.cpp @@ -0,0 +1,53 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_wiarchive.cpp: + +// (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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_WARCHIVE_SOURCE + +// the following works around an issue between spirit 1.61 and borland. +// it turns out the the certain spirit stuff must be defined before +// certain parts of mpl. including this here makes sure that happens +#if BOOST_WORKAROUND(__BORLANDC__, <= 0x560 ) +#include +#endif + +#include +#include + +// explicitly instantiate for this type of xml stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_xml_iarchive ; +template class xml_wiarchive_impl ; + +template class detail::archive_serializer_map; +template class basic_xml_iarchive ; +template class xml_wiarchive_impl ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/3rdParty/Boost/src/libs/serialization/src/xml_woarchive.cpp b/3rdParty/Boost/src/libs/serialization/src/xml_woarchive.cpp new file mode 100644 index 0000000..e71daaf --- /dev/null +++ b/3rdParty/Boost/src/libs/serialization/src/xml_woarchive.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_woarchive.cpp: + +// (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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_xml_oarchive ; +template class xml_woarchive_impl ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/3rdParty/Boost/update.sh b/3rdParty/Boost/update.sh index 2231f35..87119ac 100755 --- a/3rdParty/Boost/update.sh +++ b/3rdParty/Boost/update.sh @@ -12,6 +12,8 @@ fi ./bcp --boost="$1" \ tools/bcp \ algorithm/string.hpp \ + archive/text_iarchive.hpp \ + archive/text_oarchive.hpp \ asio.hpp \ assign/list_of.hpp \ bind.hpp \ @@ -37,6 +39,13 @@ fi regex.hpp \ shared_ptr.hpp \ smart_ptr/make_shared.hpp \ + serialization/serialization.hpp \ + serialization/vector.hpp \ + serialization/list.hpp \ + serialization/shared_ptr.hpp \ + serialization/string.hpp \ + serialization/version.hpp \ + serialization/split_member.hpp \ signals.hpp \ thread.hpp \ unordered_map.hpp \ @@ -51,7 +60,7 @@ cp $1/LICENSE_1_0.txt $TARGET_DIR rm -rf $TARGET_DIR/libs/config rm -rf $TARGET_DIR/libs/smart_ptr -LIBS="date_time regex system thread signals filesystem program_options" +LIBS="date_time regex system thread signals filesystem program_options serialization archive" for lib in $LIBS; do rm -rf $TARGET_DIR/libs/$lib/build $TARGET_DIR/libs/$lib/*.doc $TARGET_DIR/libs/$lib/src/*.doc $TARGET_DIR/libs/$lib/src/CMakeLists.txt $TARGET_DIR/libs/$lib/test done -- cgit v0.10.2-6-g49f6