|
Boost-Commit : |
From: ramey_at_[hidden]
Date: 2007-12-24 19:07:31
Author: ramey
Date: 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
New Revision: 42279
URL: http://svn.boost.org/trac/boost/changeset/42279
Log:
Adjustments for trak tickets - ready for upload as version 1.36.0
Added:
branches/serialization_next_release/boost/boost/archive/xml_archive_exception.hpp (contents, props changed)
Text files modified:
branches/serialization_next_release/boost/boost/archive/basic_binary_iprimitive.hpp | 11 ++++++++---
branches/serialization_next_release/boost/boost/archive/basic_binary_oprimitive.hpp | 12 ++++++++++--
branches/serialization_next_release/boost/boost/archive/basic_text_iarchive.hpp | 10 ----------
branches/serialization_next_release/boost/boost/archive/basic_xml_archive.hpp | 35 -----------------------------------
branches/serialization_next_release/boost/boost/archive/detail/basic_oarchive.hpp | 7 +++----
branches/serialization_next_release/boost/boost/archive/detail/interface_iarchive.hpp | 2 +-
branches/serialization_next_release/boost/boost/archive/detail/interface_oarchive.hpp | 2 +-
branches/serialization_next_release/boost/boost/archive/impl/basic_binary_iprimitive.ipp | 3 ++-
branches/serialization_next_release/boost/boost/archive/impl/basic_xml_oarchive.ipp | 3 ++-
branches/serialization_next_release/boost/boost/archive/impl/text_iarchive_impl.ipp | 3 ++-
branches/serialization_next_release/boost/boost/archive/impl/xml_iarchive_impl.ipp | 2 +-
branches/serialization_next_release/boost/boost/archive/impl/xml_wiarchive_impl.ipp | 2 +-
12 files changed, 31 insertions(+), 61 deletions(-)
Modified: branches/serialization_next_release/boost/boost/archive/basic_binary_iprimitive.hpp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/basic_binary_iprimitive.hpp (original)
+++ branches/serialization_next_release/boost/boost/archive/basic_binary_iprimitive.hpp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -53,7 +53,7 @@
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
#include <boost/mpl/placeholders.hpp>
-#include <boost/type_traits/is_fundamental.hpp>
+#include <boost/serialization/is_bitwise_serializable.hpp>
#include <boost/serialization/array.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
@@ -120,7 +120,12 @@
~basic_binary_iprimitive();
public:
// we provide an optimized load for all fundamental types
- typedef is_fundamental<mpl::_1> use_array_optimization;
+ //typedef serialization::is_bitwise_serializable<mpl::_1>
+ // use_array_optimization;
+ struct use_array_optimization {
+ template <class T>
+ struct apply : public serialization::is_bitwise_serializable<T> {};
+ };
// the optimized load_array dispatches to load_binary
template <class ValueType>
@@ -145,7 +150,7 @@
static_cast<Elem *>(address),
s
);
- if(scount != s)
+ if(scount != static_cast<std::streamsize>(s))
boost::throw_exception(
archive_exception(archive_exception::stream_error)
);
Modified: branches/serialization_next_release/boost/boost/archive/basic_binary_oprimitive.hpp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/basic_binary_oprimitive.hpp (original)
+++ branches/serialization_next_release/boost/boost/archive/basic_binary_oprimitive.hpp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -46,7 +46,7 @@
#include <boost/archive/basic_streambuf_locale_saver.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/archive/detail/auto_link_archive.hpp>
-#include <boost/type_traits/is_fundamental.hpp>
+#include <boost/serialization/is_bitwise_serializable.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/serialization/array.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
@@ -113,8 +113,16 @@
BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY())
~basic_binary_oprimitive();
public:
+
// we provide an optimized save for all fundamental types
- typedef is_fundamental<mpl::_1> use_array_optimization;
+ // typedef serialization::is_bitwise_serializable<mpl::_1>
+ // use_array_optimization;
+ // workaround without using mpl lambdas
+ struct use_array_optimization {
+ template <class T>
+ struct apply : public serialization::is_bitwise_serializable<T> {};
+ };
+
// the optimized save_array dispatches to save_binary
template <class ValueType>
Modified: branches/serialization_next_release/boost/boost/archive/basic_text_iarchive.hpp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/basic_text_iarchive.hpp (original)
+++ branches/serialization_next_release/boost/boost/archive/basic_text_iarchive.hpp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -61,16 +61,6 @@
{
this->detail_common_iarchive::load_override(t, 0);
}
-#if 0
- // Borland compilers has a problem with strong type. Try to fix this here
- #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
- void load_override(version_type & t, int){
- unsigned int x;
- * this->This() >> x;
- t.t = version_type(x);
- }
- #endif
-#endif
// text file don't include the optional information
void load_override(class_id_optional_type & /*t*/, int){}
Modified: branches/serialization_next_release/boost/boost/archive/basic_xml_archive.hpp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/basic_xml_archive.hpp (original)
+++ branches/serialization_next_release/boost/boost/archive/basic_xml_archive.hpp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -24,41 +24,6 @@
namespace boost {
namespace archive {
-//////////////////////////////////////////////////////////////////////
-// exceptions thrown by xml archives
-//
-class xml_archive_exception :
- public virtual 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)
- {}
- virtual const char *what( ) const throw( )
- {
- const char *msg;
- switch(code){
- case xml_archive_parsing_error:
- msg = "unrecognized XML syntax";
- break;
- case xml_archive_tag_mismatch:
- msg = "XML start/end tag mismatch";
- break;
- case xml_archive_tag_name_error:
- msg = "Invalid XML tag name";
- break;
- default:
- msg = archive_exception::what();
- break;
- }
- return msg;
- }
-};
-
// constant strings used in xml i/o
extern
Modified: branches/serialization_next_release/boost/boost/archive/detail/basic_oarchive.hpp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/detail/basic_oarchive.hpp (original)
+++ branches/serialization_next_release/boost/boost/archive/detail/basic_oarchive.hpp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -68,16 +68,15 @@
public:
// note: NOT part of the public interface
void register_basic_serializer(
- const /* BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) */ basic_oserializer & bos
+ const basic_oserializer & bos
);
void save_object(
const void *x,
- const /* BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) */ basic_oserializer & bos
+ const basic_oserializer & bos
);
void save_pointer(
const void * t,
- const /* BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) */
- basic_pointer_oserializer * bpos_ptr
+ const basic_pointer_oserializer * bpos_ptr
);
void save_null_pointer(){
vsave(NULL_POINTER_TAG);
Modified: branches/serialization_next_release/boost/boost/archive/detail/interface_iarchive.hpp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/detail/interface_iarchive.hpp (original)
+++ branches/serialization_next_release/boost/boost/archive/detail/interface_iarchive.hpp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -27,7 +27,7 @@
namespace archive {
namespace detail {
-class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
+class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer;
template<class Archive>
class interface_iarchive
Modified: branches/serialization_next_release/boost/boost/archive/detail/interface_oarchive.hpp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/detail/interface_oarchive.hpp (original)
+++ branches/serialization_next_release/boost/boost/archive/detail/interface_oarchive.hpp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -29,7 +29,7 @@
namespace archive {
namespace detail {
-class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
+class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
template<class Archive>
class interface_oarchive
Modified: branches/serialization_next_release/boost/boost/archive/impl/basic_binary_iprimitive.ipp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/impl/basic_binary_iprimitive.ipp (original)
+++ branches/serialization_next_release/boost/boost/archive/impl/basic_binary_iprimitive.ipp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -95,7 +95,8 @@
#endif
s.resize(l);
// note breaking a rule here - could be a problem on some platform
- load_binary(const_cast<char *>(s.data()), l);
+ if(0 < l)
+ load_binary(&(*s.begin()), l);
}
#ifndef BOOST_NO_CWCHAR
Modified: branches/serialization_next_release/boost/boost/archive/impl/basic_xml_oarchive.ipp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/impl/basic_xml_oarchive.ipp (original)
+++ branches/serialization_next_release/boost/boost/archive/impl/basic_xml_oarchive.ipp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -18,6 +18,7 @@
#include <boost/archive/basic_xml_archive.hpp>
#include <boost/archive/basic_xml_oarchive.hpp>
+#include <boost/archive/xml_archive_exception.hpp>
#include <boost/detail/no_exceptions_support.hpp>
namespace boost {
@@ -78,7 +79,7 @@
this->This()->put(' ');
this->This()->put(attribute_name);
this->This()->put("=\"");
- this->This()->put(key);
+ this->This()->save(key);
this->This()->put('"');
}
Modified: branches/serialization_next_release/boost/boost/archive/impl/text_iarchive_impl.ipp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/impl/text_iarchive_impl.ipp (original)
+++ branches/serialization_next_release/boost/boost/archive/impl/text_iarchive_impl.ipp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -53,7 +53,8 @@
if(NULL != s.data())
#endif
s.resize(size);
- is.read(const_cast<char *>(s.data()), size);
+ if(0 < size)
+ is.read(&(*s.begin()), size);
}
#ifndef BOOST_NO_CWCHAR
Modified: branches/serialization_next_release/boost/boost/archive/impl/xml_iarchive_impl.ipp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/impl/xml_iarchive_impl.ipp (original)
+++ branches/serialization_next_release/boost/boost/archive/impl/xml_iarchive_impl.ipp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -32,7 +32,7 @@
#include <boost/detail/no_exceptions_support.hpp>
-#include <boost/archive/archive_exception.hpp>
+#include <boost/archive/xml_archive_exception.hpp>
#include <boost/archive/iterators/dataflow_exception.hpp>
#include <boost/archive/basic_xml_archive.hpp>
#include <boost/archive/xml_iarchive.hpp>
Modified: branches/serialization_next_release/boost/boost/archive/impl/xml_wiarchive_impl.ipp
==============================================================================
--- branches/serialization_next_release/boost/boost/archive/impl/xml_wiarchive_impl.ipp (original)
+++ branches/serialization_next_release/boost/boost/archive/impl/xml_wiarchive_impl.ipp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -34,7 +34,7 @@
#include <boost/serialization/string.hpp>
#include <boost/archive/add_facet.hpp>
-#include <boost/archive/archive_exception.hpp>
+#include <boost/archive/xml_archive_exception.hpp>
#include <boost/archive/detail/utf8_codecvt_facet.hpp>
#include <boost/archive/iterators/mb_from_wchar.hpp>
Added: branches/serialization_next_release/boost/boost/archive/xml_archive_exception.hpp
==============================================================================
--- (empty file)
+++ branches/serialization_next_release/boost/boost/archive/xml_archive_exception.hpp 2007-12-24 19:07:30 EST (Mon, 24 Dec 2007)
@@ -0,0 +1,65 @@
+#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 <exception>
+#include <cassert>
+
+#include <boost/archive/archive_exception.hpp>
+
+namespace boost {
+namespace archive {
+
+//////////////////////////////////////////////////////////////////////
+// exceptions thrown by xml archives
+//
+class xml_archive_exception :
+ public virtual 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)
+ {}
+ virtual const char *what( ) const throw( )
+ {
+ const char *msg;
+ switch(code){
+ case xml_archive_parsing_error:
+ msg = "unrecognized XML syntax";
+ break;
+ case xml_archive_tag_mismatch:
+ msg = "XML start/end tag mismatch";
+ break;
+ case xml_archive_tag_name_error:
+ msg = "Invalid XML tag name";
+ break;
+ default:
+ msg = archive_exception::what();
+ break;
+ }
+ return msg;
+ }
+};
+
+}// namespace archive
+}// namespace boost
+
+#endif //BOOST_XML_ARCHIVE_ARCHIVE_EXCEPTION_HPP
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk