x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
invert.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\iostreams\invert.hpp
Girar
Efecto
Propiedad
Historial
// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) // (C) Copyright 2003-2007 Jonathan Turkanis // Distributed under 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/libs/iostreams for documentation. #ifndef BOOST_IOSTREAMS_INVERT_HPP_INCLUDED #define BOOST_IOSTREAMS_INVERT_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
// copy, min. #include
#include
// BOOST_DEDUCED_TYPENAME. #include
// default_filter_buffer_size. #include
#include
#include
#include
#include
#include
#include
#include
// clear_flags, call_reset #include
#include
#include
#include
// Must come last. #include
// MSVC. namespace boost { namespace iostreams { // // Template name: inverse. // Template paramters: // Filter - A model of InputFilter or OutputFilter. // Description: Generates an InputFilter from an OutputFilter or // vice versa. // template
class inverse { private: typedef typename category_of
::type base_category; typedef reference_wrapper
filter_ref; public: typedef typename char_type_of
::type char_type; typedef typename int_type_of
::type int_type; typedef char_traits
traits_type; typedef typename mpl::if_< is_convertible< base_category, input >, output, input >::type mode; struct category : mode, filter_tag, multichar_tag, closable_tag { }; explicit inverse( const Filter& filter, std::streamsize buffer_size = default_filter_buffer_size) : pimpl_(new impl(filter, buffer_size)) { } template
std::streamsize read(Source& src, char* s, std::streamsize n) { typedef detail::counted_array_sink
array_sink; typedef composite
filtered_array_sink; assert((flags() & f_write) == 0); if (flags() == 0) { flags() = f_read; buf().set(0, 0); } filtered_array_sink snk(filter(), array_sink(s, n)); int_type status; for ( status = traits_type::good(); snk.second().count() < n && status == traits_type::good(); ) { status = buf().fill(src); buf().flush(snk); } return snk.second().count() == 0 && status == traits_type::eof() ? -1 : snk.second().count(); } template
std::streamsize write(Sink& dest, const char* s, std::streamsize n) { typedef detail::counted_array_source
array_source; typedef composite
filtered_array_source; assert((flags() & f_read) == 0); if (flags() == 0) { flags() = f_write; buf().set(0, 0); } filtered_array_source src(filter(), array_source(s, n)); for (bool good = true; src.second().count() < n && good; ) { buf().fill(src); good = buf().flush(dest); } return src.second().count(); } template
void close(Device& dev) { detail::execute_all( detail::flush_buffer(buf(), dev, (flags() & f_write) != 0), detail::call_close_all(pimpl_->filter_, dev), detail::clear_flags(flags()) ); } private: filter_ref filter() { return boost::ref(pimpl_->filter_); } detail::buffer
& buf() { return pimpl_->buf_; } int& flags() { return pimpl_->flags_; } enum flags_ { f_read = 1, f_write = 2 }; struct impl { impl(const Filter& filter, std::streamsize n) : filter_(filter), buf_(n), flags_(0) { buf_.set(0, 0); } Filter filter_; detail::buffer
buf_; int flags_; }; shared_ptr
pimpl_; }; // // Template name: invert. // Template paramters: // Filter - A model of InputFilter or OutputFilter. // Description: Returns an instance of an appropriate specialization of inverse. // template
inverse
invert(const Filter& f) { return inverse
(f); } //----------------------------------------------------------------------------// } } // End namespaces iostreams, boost. #include
// MSVC. #endif // #ifndef BOOST_IOSTREAMS_INVERT_HPP_INCLUDED
invert.hpp
Dirección de la página
Dirección del archivo
Anterior
18/37
Siguiente
Descargar
( 5 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.