2 * \file TexStream.cpp
\r
3 * This file is part of LyX, the document processor.
\r
4 * Licence details can be found in the file COPYING.
\r
6 * Full author contact details are available in file CREDITS.
\r
11 #include "TexStream.h"
19 ////////////////////////////////////////////////////////////////
23 ////////////////////////////////////////////////////////////////
26 class TexStreamBuffer : public TexStreamBase
29 TexStreamBuffer(TexStreamBase * sbuf, TexRow * texrow);
30 int line() const { return line_; }
31 int column() const { return column_; }
38 TexStreamBase * sbuf_;
45 TexStreamBuffer::TexStreamBuffer(TexStreamBase *sb, TexRow * texrow)
46 : sbuf_(sb), texrow_(texrow), line_(0)
52 int TexStreamBuffer::overflow(int c)
64 int TexStreamBuffer::sync()
71 ////////////////////////////////////////////////////////////////
75 ////////////////////////////////////////////////////////////////
77 TexStream::TexStream(TexStreamBase * sbuf, TexRow * texrow)
78 : std::basic_ostream<char_type>(sbuf_ = new TexStreamBuffer(sbuf, texrow))
82 TexStream::~TexStream()
88 int TexStream::line() const
94 ////////////////////////////////////////////////////////////////
98 ////////////////////////////////////////////////////////////////
102 int main(int argc, char *argv[])
104 TexStream out(std::cout.rdbuf());
110 std::cout << "line count: " << out.line() << std::endl;