template<typename OTLStream,typename OutputIterator>otl_read_from_stream can be used with std::back_inserter, or std::inserter template functions. otl_write_to_stream can be used with begin() / end() member or global template functions defined in STL containers like std::vector, std::set/multiset, std::map/multimap, etc. These functions should be used as a replacement for less efficient, STL-compliant stream iterator based code, if performance is a concern. Conversion from the STL-compliant stream iterators to calls to otl_read_from_stream / otl_write_to_stream is straightforward.
void otl_read_from_stream
(OTLStream& s,
OutputIterator result,
size_t max_number_of_rows_to_read=0);
template<typename OTLStream,typename InputIterator>
void otl_write_to_stream(InputIterator first, InputIterator last, OTLStream &s);
Copyright © 1996-2024, Sergei Kuchin, email: skuchin@gmail.com, skuchin@gmail.com .
Permission to use, copy, modify and redistribute this document for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.