|
Index
C++ Code Documentation
base::LineStream
File: BASE/base/LineStream.H
Writes to a stream with linebreaking.
Example:
LineStream out( std::cout );
out << "Hello ";
out.mark_linebreak();
out << "12345 ";
out.mark_linebreak();
...
public:
- LineStream( std::ostream &o, int linewidth = 79 );
 | Constructor. 'o' is the stream to write to. 'linewidth' is the maximum line length (>=2). 'linewidth'==0 means don't split lines. | |
- ~LineStream();
 | destructor | |
- void mark_linebreak();
 | As you are writing to the LineStream, call this whenever a legal place to break the line occurs | |
- LineStream &put( char c );
- LineStream &put( char unsigned c );
- LineStream &write( char const *s, int n );
- LineStream &write( char unsigned const *s, int n );
- LineStream &operator<<( char );
- LineStream &operator<<( char unsigned );
- LineStream &operator<<( signed short );
- LineStream &operator<<( unsigned short );
- LineStream &operator<<( signed int );
- LineStream &operator<<( unsigned int );
- LineStream &operator<<( signed long );
- LineStream &operator<<( unsigned long );
- LineStream &operator<<( float );
- LineStream &operator<<( double );
- LineStream &operator<<( long double );
- LineStream &operator<<( void * );
- LineStream &operator<<( char const * );
- LineStream &operator<<( char unsigned const * );
- LineStream &operator<<( base::String const & );
protected:
private:
- char *_buffer;
 | Rotating buffer. | |
- size_t _buf_start, _buf_end;
 | Buffer positions. | |
- size_t _buf_len;
 | Buffer length. | |
- size_t _linebreak;
- std::ostream *_ostream;
- inline void _inc( size_t & );
- inline void _dec( size_t & );
- void _flush();
- static char const SPACE;
- static char const NEWLINE;
- static size_t const NPOS;
|