basic_array_sourcebasic_array_sinkbasic_array类模板 basic_array_source、basic_array_sink 和 basic_array 提供对内存中字符序列的访问。数组设备不管理底层字符序列的生命周期。
数组设备实现为 Direct 设备,以提供对底层字符序列的高效无缓冲访问。
<boost/iostreams/device/array.hpp>basic_array_source模型 Source,提供对内存中字符序列的只读访问。
namespace boost { namespace iostreams { template<typename Ch> class basic_array_source { public: typedef Ch char_type; typedef source_tag category; template<int N> basic_array_source(char_type (&)[N]); basic_array_source(const char_type* begin, const char_type* end); basic_array_source(const char_type* begin, std::size_t length); ... }; typedef basic_array_source<char> array_source; typedef basic_array_source<wchar_t> warray_source; } } // End namespace boost::io
| Ch | - | 字符类型。 |
basic_array_source::basic_array_sourcetemplate<int N> basic_array_source(char_type (&)[N]); basic_array_source(const char_type* begin, const char_type* end); basic_array_source(const char_type* begin, std::size_t length);
构造一个 basic_array_source 以从指定的字符序列读取。
basic_array_sink模型 Sink,提供对内存中字符序列的只写访问。
namespace boost { namespace iostreams { template<typename Ch> class basic_array_sink { public: typedef Ch char_type; typedef sink_tag category; template<int N> basic_array_sink(char_type (&)[N]); basic_array_sink(char_type* begin, char_type* end); basic_array_sink(char_type* begin, std::size_t length); // Additional nember functions }; typedef basic_array_sink<char> array_sink; typedef basic_array_sink<wchar_t> warray_sink; } } // End namespace boost::io
| Ch | - | 字符类型。 |
basic_array_sink::basic_array_sinktemplate<int N> basic_array_sink(char_type (&)[N]); basic_array_sink(char_type* begin, char_type* end); basic_array_sink(char_type* begin, std::size_t length);
构造一个 basic_array_sink 以写入指定的字符序列。
basic_array模型 SeekableDevice,提供对内存中字符序列的读写访问。
namespace boost { namespace iostreams { template<typename Ch> class basic_array { public: typedef Ch char_type; typedef seekable_device_tag category; template<int N> basic_array(char_type (&)[N]); basic_array(char_type* begin, char_type* end); basic_array(char_type* begin, std::size_t length); // Additional nember functions }; typedef basic_array<char> array; typedef basic_array<wchar_t> warray; } } // End namespace boost::io
| Ch | - | 字符类型。 |
array::arraytemplate<int N> basic_array(char_type (&)[N]); basic_array(char_type* begin, char_type* end); basic_array(char_type* begin, std::size_t length);
构造一个 basic_array 以访问指定的字符序列。
提供对字符序列无缓冲访问的设备的概念是由 Daryle Walker 的 array_stream 模板提出的。
© Copyright 2008 CodeRage, LLC
© Copyright 2004-2007 Jonathan Turkanis
根据Boost软件许可证,版本1.0分发(请参阅随附的LICENSE_1_0.txt文件或访问https://boost.ac.cn/LICENSE_1_0.txt获取副本)