![]() |
hamigaki::iostreams::tiny_restriction —
tiny_restriction
はboost::iostreams::restriction
の退化した変種であり、単に読み書きの文字数を制限する。
template<typename Device> class tiny_restriction { public: // types typedef boost::iostreams::char_type_of<Device>::type char_type; // construct/copy/destruct tiny_restriction(const Device&, boost::iostreams::stream_offset = -1); // Boost.Iostreams implementation std::streamsize read(char_type*, std::streamsize); std::streamsize write(const char_type*, std::streamsize); }; // creation template<typename Device> tiny_restriction<Device> tiny_restrict(const Device&, boost::iostreams::stream_offset = -1);
意味上は、オフセット=0のboost::iostreams::restriction
に相当するが、オフセット移動に用いられるget()/seek()操作を必要としない。get()操作はstd::char_traitsの文字型に対する特殊化を要求するため、floatなどの標準で特殊化されない文字型を使用する場合に役に立つ。
tiny_restriction
creationtemplate<typename Device> tiny_restriction<Device> tiny_restrict(const Device& dev, boost::iostreams::stream_offset len = -1);
Returns: |
tiny_restriction<Device>(dev, len)
|
製作著作 © 2006, 2007 Takeshi Mouri |