~ubuntu-branches/ubuntu/dapper/boost/dapper

« back to all changes in this revision

Viewing changes to boost/iostreams/detail/streambuf/direct_streambuf.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli, Christophe Prud'homme, Domenico Andreoli
  • Date: 2006-01-11 11:11:42 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060111111142-xy6z1i5himlgu8iw
Tags: 1.33.1-2
[ Christophe Prud'homme ]
* Bug fix: "libboost-wave-dev: Dependency on libboost-filesystem-dev
  missing", thanks to Martin v . Löwis (Closes: #346367).

[ Domenico Andreoli ]
* boost/graph/topological_sort.hpp: removed name of unused parameter
  to prevent long compiler warning.  Closes: #347519.
* Applied patch from upstream CVS to fix parsing of valid options
  with a common root.  Closes: #345714.
* libboost-python-dev now correctly depends on python2.4-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <boost/iostreams/detail/streambuf/linked_streambuf.hpp>
25
25
#include <boost/iostreams/detail/error.hpp>
26
26
#include <boost/iostreams/operations.hpp>
 
27
#include <boost/iostreams/positioning.hpp>
27
28
#include <boost/iostreams/traits.hpp>
28
29
 
29
30
// Must come last.
52
53
            )                                             streambuf_type;
53
54
public: // stream needs access.
54
55
    void open(const T& t, int buffer_size, int pback_size);
55
 
    bool is_open();
 
56
    bool is_open() const;
56
57
    void close();
57
58
    bool auto_close() const { return auto_close_; }
58
59
    void set_auto_close(bool close) { auto_close_ = close; }
85
86
                      BOOST_IOS::openmode which );
86
87
    pos_type seekpos(pos_type sp, BOOST_IOS::openmode which);
87
88
private:
88
 
    pos_type seek_impl( off_type off, BOOST_IOS::seekdir way,
 
89
    pos_type seek_impl( stream_offset off, BOOST_IOS::seekdir way,
89
90
                        BOOST_IOS::openmode which );
90
91
    void init_input(any_tag) { }
91
92
    void init_input(input);
118
119
}
119
120
 
120
121
template<typename T, typename Tr>
121
 
bool direct_streambuf<T, Tr>::is_open() { return ibeg_ != 0 && !obeg_ != 0; }
 
122
bool direct_streambuf<T, Tr>::is_open() const 
 
123
{ return ibeg_ != 0 && !obeg_ != 0; }
122
124
 
123
125
template<typename T, typename Tr>
124
126
void direct_streambuf<T, Tr>::close() 
185
187
inline typename direct_streambuf<T, Tr>::pos_type
186
188
direct_streambuf<T, Tr>::seekpos
187
189
    (pos_type sp, BOOST_IOS::openmode)
188
 
{ return seek_impl(sp, BOOST_IOS::beg, BOOST_IOS::in | BOOST_IOS::out); }
 
190
 
191
    return seek_impl( position_to_offset(sp), BOOST_IOS::beg, 
 
192
                      BOOST_IOS::in | BOOST_IOS::out );
 
193
}
189
194
 
190
195
template<typename T, typename Tr>
191
196
void direct_streambuf<T, Tr>::close(BOOST_IOS::openmode which)
204
209
 
205
210
template<typename T, typename Tr>
206
211
typename direct_streambuf<T, Tr>::pos_type direct_streambuf<T, Tr>::seek_impl
207
 
    (off_type off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which)
 
212
    (stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which)
208
213
{
209
214
    using namespace std;
210
215
    BOOST_IOS::openmode both = BOOST_IOS::in | BOOST_IOS::out;
211
216
    if (two_head() && (which & both) == both)
212
217
        throw bad_seek();
213
 
    off_type result = -1;
 
218
    stream_offset result = -1;
214
219
    bool one = one_head();
215
220
    if (one && (pptr() != 0 || gptr()== 0))
216
221
        init_get_area(); // Switch to input mode, for code reuse.
242
247
        pbump(static_cast<int>(next - (pptr() - obeg_)));
243
248
        result = next;
244
249
    }
245
 
    return result;
 
250
    return offset_to_position(result);
246
251
}
247
252
 
248
253
template<typename T, typename Tr>