sl@0: #ifndef BOOST_ARCHIVE_BASIC_ARCHIVE_HPP sl@0: #define BOOST_ARCHIVE_BASIC_ARCHIVE_HPP sl@0: sl@0: // MS compatible compilers support #pragma once sl@0: #if defined(_MSC_VER) && (_MSC_VER >= 1020) sl@0: # pragma once sl@0: #endif sl@0: sl@0: /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 sl@0: // basic_archive.hpp: sl@0: sl@0: // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . sl@0: // Use, modification and distribution is subject to the Boost Software sl@0: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: // See http://www.boost.org for updates, documentation, and revision history. sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: #include // must be the last header sl@0: sl@0: namespace boost { sl@0: namespace archive { sl@0: sl@0: BOOST_STRONG_TYPEDEF(unsigned int, version_type) sl@0: BOOST_STRONG_TYPEDEF(int, class_id_type) sl@0: BOOST_STRONG_TYPEDEF(int, class_id_optional_type) sl@0: BOOST_STRONG_TYPEDEF(int, class_id_reference_type) sl@0: BOOST_STRONG_TYPEDEF(unsigned int, object_id_type) sl@0: BOOST_STRONG_TYPEDEF(unsigned int, object_reference_type) sl@0: sl@0: struct tracking_type { sl@0: typedef bool value_type; sl@0: bool t; sl@0: explicit tracking_type(const bool t_ = false) sl@0: : t(t_) sl@0: {}; sl@0: tracking_type(const tracking_type & t_) sl@0: : t(t_.t) sl@0: {} sl@0: operator bool () const { sl@0: return t; sl@0: }; sl@0: operator bool & () { sl@0: return t; sl@0: }; sl@0: tracking_type & operator=(const bool t_){ sl@0: t = t_; sl@0: return *this; sl@0: } sl@0: bool operator==(const tracking_type & rhs) const { sl@0: return t == rhs.t; sl@0: } sl@0: bool operator==(const bool & rhs) const { sl@0: return t == rhs; sl@0: } sl@0: tracking_type & operator=(const tracking_type & rhs){ sl@0: t = rhs.t; sl@0: return *this; sl@0: } sl@0: }; sl@0: sl@0: struct class_name_type : private boost::noncopyable { sl@0: char *t; sl@0: operator const char * & () const { sl@0: return const_cast(t); sl@0: } sl@0: operator char * () { sl@0: return t; sl@0: } sl@0: explicit class_name_type(const char *key_) sl@0: : t(const_cast(key_)){} sl@0: explicit class_name_type(char *key_) sl@0: : t(key_){} sl@0: class_name_type & operator=(const class_name_type & rhs){ sl@0: t = rhs.t; sl@0: return *this; sl@0: } sl@0: }; sl@0: sl@0: enum archive_flags { sl@0: no_header = 1, // suppress archive header info sl@0: no_codecvt = 2, // suppress alteration of codecvt facet sl@0: no_xml_tag_checking = 4, // suppress checking of xml tags sl@0: no_tracking = 8 // suppress ALL tracking sl@0: // no_object_creation = 16 // don't create any new objects sl@0: }; sl@0: sl@0: #define NULL_POINTER_TAG class_id_type(-1) sl@0: sl@0: BOOST_ARCHIVE_DECL(const char *) sl@0: ARCHIVE_SIGNATURE(); sl@0: sl@0: BOOST_ARCHIVE_DECL(unsigned char) sl@0: ARCHIVE_VERSION(); sl@0: sl@0: }// namespace archive sl@0: }// namespace boost sl@0: sl@0: #include // pops abi_suffix.hpp pragmas sl@0: sl@0: #include sl@0: sl@0: // set implementation level to primitive for all types sl@0: // used internally by the serialization library sl@0: sl@0: BOOST_CLASS_IMPLEMENTATION(boost::archive::version_type, primitive_type) sl@0: BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_type, primitive_type) sl@0: BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_reference_type, primitive_type) sl@0: BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_optional_type, primitive_type) sl@0: BOOST_CLASS_IMPLEMENTATION(boost::archive::class_name_type, primitive_type) sl@0: BOOST_CLASS_IMPLEMENTATION(boost::archive::object_id_type, primitive_type) sl@0: BOOST_CLASS_IMPLEMENTATION(boost::archive::object_reference_type, primitive_type) sl@0: BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type, primitive_type) sl@0: sl@0: /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 sl@0: // Make sure that the export.hpp header isn't included before any archive header sl@0: // Doing so would inhibit construction of correct mpl list of known archive sl@0: // types which in turn would inhibit instantiation of all combinations of sl@0: // serialization/archive types. sl@0: sl@0: #ifdef BOOST_SERIALIZATION_EXPORT_HPP sl@0: #error "export.hpp must not be included before any archive header" sl@0: #endif sl@0: sl@0: #endif //BOOST_ARCHIVE_BASIC_ARCHIVE_HPP