Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48787 - in trunk/boost/archive: impl iterators
From: ramey_at_[hidden]
Date: 2008-09-15 02:08:20


Author: ramey
Date: 2008-09-15 02:08:19 EDT (Mon, 15 Sep 2008)
New Revision: 48787
URL: http://svn.boost.org/trac/boost/changeset/48787

Log:
Fixed bas64 for text files
Text files modified:
   trunk/boost/archive/impl/basic_text_iprimitive.ipp | 11 +++++++++--
   trunk/boost/archive/impl/basic_text_oprimitive.ipp | 6 +++---
   trunk/boost/archive/iterators/binary_from_base64.hpp | 2 +-
   3 files changed, 13 insertions(+), 6 deletions(-)

Modified: trunk/boost/archive/impl/basic_text_iprimitive.ipp
==============================================================================
--- trunk/boost/archive/impl/basic_text_iprimitive.ipp (original)
+++ trunk/boost/archive/impl/basic_text_iprimitive.ipp 2008-09-15 02:08:19 EDT (Mon, 15 Sep 2008)
@@ -102,8 +102,15 @@
     }
     *caddr++ = static_cast<char>(*ti_begin);
     
- while(! is_whitespace(*ti_begin))
- ++ti_begin;
+ iterators::istream_iterator<CharType> i;
+ for(;;){
+ CharType c;
+ c = is.get();
+ if(is.eof())
+ break;
+ if(is_whitespace(c))
+ break;
+ }
 }
 
 template<class IStream>

Modified: trunk/boost/archive/impl/basic_text_oprimitive.ipp
==============================================================================
--- trunk/boost/archive/impl/basic_text_oprimitive.ipp (original)
+++ trunk/boost/archive/impl/basic_text_oprimitive.ipp 2008-09-15 02:08:19 EDT (Mon, 15 Sep 2008)
@@ -66,11 +66,11 @@
     );
     
     std::size_t tail = count % 3;
- if(tail > 0)
- *oi = '=';
+ if(tail > 0){
+ *oi++ = '=';
         if(tail < 2)
             *oi = '=';
-
+ }
 }
 
 template<class OStream>

Modified: trunk/boost/archive/iterators/binary_from_base64.hpp
==============================================================================
--- trunk/boost/archive/iterators/binary_from_base64.hpp (original)
+++ trunk/boost/archive/iterators/binary_from_base64.hpp 2008-09-15 02:08:19 EDT (Mon, 15 Sep 2008)
@@ -43,7 +43,7 @@
             -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,
+ 52,53,54,55,56,57,58,59,60,61,-1,-1,-1, 0,-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,


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