Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64101 - branches/release/boost/archive
From: ramey_at_[hidden]
Date: 2010-07-17 12:03:09


Author: ramey
Date: 2010-07-17 12:03:07 EDT (Sat, 17 Jul 2010)
New Revision: 64101
URL: http://svn.boost.org/trac/boost/changeset/64101

Log:
Merge corrections to text based archives for version_type and item_version_type
Properties modified:
   branches/release/boost/archive/ (props changed)
Text files modified:
   branches/release/boost/archive/basic_archive.hpp | 2 +-
   branches/release/boost/archive/text_iarchive.hpp | 11 +++++++++++
   branches/release/boost/archive/text_oarchive.hpp | 7 +++++++
   branches/release/boost/archive/xml_iarchive.hpp | 13 +++++++++++++
   branches/release/boost/archive/xml_oarchive.hpp | 10 +++++++++-
   5 files changed, 41 insertions(+), 2 deletions(-)

Modified: branches/release/boost/archive/basic_archive.hpp
==============================================================================
--- branches/release/boost/archive/basic_archive.hpp (original)
+++ branches/release/boost/archive/basic_archive.hpp 2010-07-17 12:03:07 EDT (Sat, 17 Jul 2010)
@@ -74,7 +74,7 @@
 
 class version_type {
 private:
- typedef uint_least8_t base_type;
+ typedef unsigned int base_type;
     base_type t;
     version_type(): t(0) {};
 public:

Modified: branches/release/boost/archive/text_iarchive.hpp
==============================================================================
--- branches/release/boost/archive/text_iarchive.hpp (original)
+++ branches/release/boost/archive/text_iarchive.hpp 2010-07-17 12:03:07 EDT (Sat, 17 Jul 2010)
@@ -23,6 +23,7 @@
 #include <boost/archive/basic_text_iprimitive.hpp>
 #include <boost/archive/basic_text_iarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
+#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
@@ -51,6 +52,16 @@
     void load(T & t){
         basic_text_iprimitive<std::istream>::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

Modified: branches/release/boost/archive/text_oarchive.hpp
==============================================================================
--- branches/release/boost/archive/text_oarchive.hpp (original)
+++ branches/release/boost/archive/text_oarchive.hpp 2010-07-17 12:03:07 EDT (Sat, 17 Jul 2010)
@@ -30,6 +30,7 @@
 #include <boost/archive/basic_text_oprimitive.hpp>
 #include <boost/archive/basic_text_oarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
+#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
@@ -59,6 +60,12 @@
         this->newtoken();
         basic_text_oprimitive<std::ostream>::save(t);
     }
+ void save(const version_type & t){
+ save(static_cast<const unsigned int>(t));
+ }
+ void save(const boost::serialization::item_version_type & t){
+ save(static_cast<const unsigned int>(t));
+ }
     BOOST_ARCHIVE_DECL(void)
     save(const char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T

Modified: branches/release/boost/archive/xml_iarchive.hpp
==============================================================================
--- branches/release/boost/archive/xml_iarchive.hpp (original)
+++ branches/release/boost/archive/xml_iarchive.hpp 2010-07-17 12:03:07 EDT (Sat, 17 Jul 2010)
@@ -23,6 +23,7 @@
 #include <boost/archive/basic_text_iprimitive.hpp>
 #include <boost/archive/basic_xml_iarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
+#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
@@ -63,6 +64,18 @@
     void load(T & t){
         basic_text_iprimitive<std::istream>::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

Modified: branches/release/boost/archive/xml_oarchive.hpp
==============================================================================
--- branches/release/boost/archive/xml_oarchive.hpp (original)
+++ branches/release/boost/archive/xml_oarchive.hpp 2010-07-17 12:03:07 EDT (Sat, 17 Jul 2010)
@@ -30,6 +30,7 @@
 #include <boost/archive/basic_text_oprimitive.hpp>
 #include <boost/archive/basic_xml_oarchive.hpp>
 #include <boost/archive/detail/register_archive.hpp>
+#include <boost/serialization/item_version_type.hpp>
 
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
@@ -61,7 +62,14 @@
     void save(const T & t){
         basic_text_oprimitive<std::ostream>::save(t);
     }
-
+ void
+ save(const version_type & t){
+ save(static_cast<const unsigned int>(t));
+ }
+ void
+ save(const boost::serialization::item_version_type & t){
+ save(static_cast<const unsigned int>(t));
+ }
     BOOST_ARCHIVE_DECL(void)
     save(const char * t);
     #ifndef BOOST_NO_INTRINSIC_WCHAR_T


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