// file : xsd/cxx/zc-istream.txx // copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file namespace xsd { namespace cxx { // zc_streambuf // template zc_streambuf:: zc_streambuf (const ro_string& str) : str_ (str.data (), str.size ()) { init (); } template zc_streambuf:: zc_streambuf (const std::basic_string& str) : str_ (str) { init (); } template void zc_streambuf:: init () { C* b (const_cast (str_.data ())); C* e (b + str_.size ()); this->setg (b, b, e); } template std::streamsize zc_streambuf:: showmanyc () { return static_cast ( this->egptr () - this->gptr ()); } template typename zc_streambuf::int_type zc_streambuf:: underflow () { int_type r = traits_type::eof (); if (this->gptr () < this->egptr ()) r = traits_type::to_int_type (*this->gptr ()); return r; } // zc_istream_base // template zc_istream_base:: zc_istream_base (const ro_string& str) : buf_ (str) { } template zc_istream_base:: zc_istream_base (const std::basic_string& str) : buf_ (str) { } // zc_istream // template zc_istream:: zc_istream (const ro_string& str) : zc_istream_base (str), std::basic_istream (&this->buf_) { } template zc_istream:: zc_istream (const std::basic_string& str) : zc_istream_base (str), std::basic_istream (&this->buf_) { } } }