9 ////////////////////////////////////////////////////////////////
13 ////////////////////////////////////////////////////////////////
16 class TexStreamBuffer : public TexStreamBase
19 TexStreamBuffer(TexStreamBase * sbuf, TexRow * texrow);
20 int line() const { return line_; }
21 int column() const { return column_; }
28 TexStreamBase * sbuf_;
35 TexStreamBuffer::TexStreamBuffer(TexStreamBase *sb, TexRow * texrow)
36 : sbuf_(sb), texrow_(texrow), line_(0)
42 int TexStreamBuffer::overflow(int c)
54 int TexStreamBuffer::sync()
61 ////////////////////////////////////////////////////////////////
65 ////////////////////////////////////////////////////////////////
67 TexStream::TexStream(TexStreamBase * sbuf, TexRow * texrow)
68 : std::basic_ostream<char_type>(sbuf_ = new TexStreamBuffer(sbuf, texrow))
72 TexStream::~TexStream()
78 int TexStream::line() const
84 ////////////////////////////////////////////////////////////////
88 ////////////////////////////////////////////////////////////////
92 int main(int argc, char *argv[])
94 TexStream out(std::cout.rdbuf());
100 std::cout << "line count: " << out.line() << std::endl;