Ticket #5174: code_converter-flushable.diff

File code_converter-flushable.diff, 1.6 KB (added by eddie@…, 12 years ago)

Patch to boost trunk

  • boost/iostreams/code_converter.hpp

     
    191191        if (which == BOOST_IOS::out && (flags_ & f_output_closed) == 0) {
    192192            flags_ |= f_output_closed;
    193193            detail::execute_all(
    194                 detail::flush_buffer(buf_.second(), dev(), can_write::value),
    195194                detail::call_close(dev(), BOOST_IOS::out),
    196195                detail::call_reset(dev_),
    197196                detail::call_reset(buf_.first()),
    … …  
    200199        }
    201200    }
    202201
     202    bool flush()
     203    {
     204        detail::execute_all(
     205            detail::flush_buffer(buf_.second(), dev(), can_write::value)
     206        );
     207        return true;
     208    }
     209
    203210    bool is_open() const { return (flags_ & f_open) != 0;}
    204211
    205212    device_type& dev() { return **dev_; }
    … …  
    254261public:
    255262    typedef intern_type                                             char_type;   
    256263    struct category
    257         : impl_type::mode, device_tag, closable_tag, localizable_tag
     264        : impl_type::mode, device_tag, closable_tag, localizable_tag, flushable_tag
    258265        { };
    259266    BOOST_STATIC_ASSERT((
    260267        is_same<
    … …  
    286293
    287294    std::streamsize read(char_type*, std::streamsize);
    288295    std::streamsize write(const char_type*, std::streamsize);
     296    bool flush() { return impl().flush(); }
    289297    void imbue(const std::locale& loc) { impl().cvt_.imbue(loc); }
    290298
    291299        // Direct device access.