// file : cutl/compiler/code-stream.txx // copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file namespace cutl { namespace compiler { // code_stream // template code_stream::~code_stream () { } // from_streambuf_adapter // template void from_streambuf_adapter:: put (C c) { int_type i (stream_.sputc (c)); if (i == traits_type::eof ()) throw eof (); } template void from_streambuf_adapter:: unbuffer () { if (stream_.pubsync () != 0) throw sync (); } // to_streambuf_adapter // template typename to_streambuf_adapter::int_type to_streambuf_adapter:: overflow (int_type i) { try { stream_.put (traits_type::to_char_type (i)); return i; } catch (typename from_streambuf_adapter::eof const&) { return traits_type::eof (); } } template int to_streambuf_adapter:: sync () { return 0; } // ostream_filter // template