Jive reference manual
|
Provides an interface for writing text-based output. More...
#include <jem/io/TextOutput.h>
Public Member Functions | |
virtual void | write (int c)=0 |
Writes a single character to this output stream. More... | |
virtual void | write (int c, int n)=0 |
Writes multiple copies of a character to this output stream. More... | |
virtual void | write (const char *buf, int n)=0 |
Writes an array of characters to this output stream. More... | |
virtual void | printByte (byte b)=0 |
Prints a formatted byte to this output stream. More... | |
virtual void | printBool (bool b)=0 |
Prints a formatted bool to this output stream. More... | |
virtual void | printInt (long i)=0 |
Prints a formatted integer to this output stream. More... | |
virtual void | printFloat (double d)=0 |
Prints a formatted double to this output stream. More... | |
Related Functions | |
(Note that these are not member functions.) | |
TextOutput & | operator<< (TextOutput &out, bool b) |
Prints a boolean to a text output stream. More... | |
TextOutput & | operator<< (TextOutput &out, byte b) |
Prints a byte to a text output stream. More... | |
TextOutput & | operator<< (TextOutput &out, char c) |
Prints a character to a text output stream. More... | |
TextOutput & | operator<< (TextOutput &out, short i) |
Prints a short integer to a text output stream. More... | |
TextOutput & | operator<< (TextOutput &out, int i) |
Prints an integer to a text output stream. More... | |
TextOutput & | operator<< (TextOutput &out, long i) |
Prints a long integer to a text output stream. More... | |
TextOutput & | operator<< (TextOutput &out, float f) |
Prints a float to a text output stream. More... | |
TextOutput & | operator<< (TextOutput &out, double d) |
Prints a double to a text output stream. More... | |
TextOutput & | operator<< (TextOutput &out, const char *s) |
Prints a string to a text output stream. More... | |
TextOutput & | operator<< (TextOutput &out, TextOutput &(*manip)(TextOutput &)) |
Applies a manipulator function to a text output stream. More... | |
TextOutput & | endl (TextOutput &out) |
Writes a newline to a text output stream. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from jem::Interface | |
virtual | ~Interface () |
Empty destructor. More... | |
The TextOutput
interface provides a set of (abstract) functions for writing characters and numbers to an output stream. It is typically used to implement functions that write text output and do not care about the destination of the output.
Many classes in jem provide an overloaded version of the <<
operator that writes the contents of a class instance in a human-readable format to a text output stream. These so-called print operators can be very useful debugging aids.
Writer
, TextInput
, DataOutput
.
|
pure virtual |
Writes the integer c, cast to an unsigned char
, to this output stream.
c | - the character to be written. |
IOException | - if an I/O error occurs. |
Implemented in jem::mt::ThreadSafeWriter, jem::io::PrintWriter, jem::StringBuffer, jem::io::PrefixWriter, jem::io::BufferedWriter, jem::io::OutputStreamWriter, jem::io::TeeWriter, jem::io::FilterWriter, jem::io::StringWriter, jem::io::StderrWriter, jem::io::StdoutWriter, and jem::io::NullWriter.
|
pure virtual |
Writes n copies of the integer c, cast to an unsigned char
, to this output stream.
c | - the character to be written. |
n | - the number of copies of the character c to be written. |
n >= 0
IOException | - if an I/O error occurs. |
Implemented in jem::io::Writer.
|
pure virtual |
Writes the first n characters stored in the array buf to this output stream.
buf | - a character array of which the length is at least n. |
n | - the number of characters to be written. |
n >= 0
buf[0], ..., buf[n - 1]
have been written to this output stream.IOException | - if an I/O error occurs. |
Implemented in jem::io::Writer.
|
pure virtual |
Prints the byte b, converted to a character string, to this output stream. You should normally not call this function directly, but use one of the overloaded print operators.
b | - the byte to be printed. |
IOException | - if an I/O error occurs. |
operator << ( TextOutput&, byte )
Implemented in jem::io::Writer, jem::StringBuffer, and jem::io::NullWriter.
|
pure virtual |
Prints the bool b, converted to a character string, to this output stream. You should normally not call this function directly, but use one of the overloaded print operators.
b | - the bool to be printed. |
IOException | - if an I/O error occurs. |
operator << ( TextOutput&, bool )
Implemented in jem::io::Writer, jem::io::PrintWriter, jem::StringBuffer, and jem::io::NullWriter.
|
pure virtual |
Prints the long integer i, converted to a character string, to this output stream. You should normally not call this function directly, but use one of the overloaded print operators.
i | - the integer to be printed. |
IOException | - if an I/O error occurs. |
operator << ( TextOutput&, long )
Implemented in jem::io::Writer.
|
pure virtual |
Prints the double d, converted to a character string, to this output stream. You should normally not call this function directly, but use one of the overloaded print operators.
d | - the double to be printed. |
IOException | - if an I/O error occurs. |
operator << ( TextOutput&, double )
Implemented in jem::io::Writer, jem::io::PrintWriter, jem::StringBuffer, and jem::io::NullWriter.
|
related |
Prints the boolean b to the text output stream out by calling out.printBool(b)
.
out | - a text output stream. |
b | - the boolean to be printed. |
IOException | - if an I/O error occurs. |
|
related |
Prints the byte b to the text output stream out by calling out.printByte(b)
.
out | - a text output stream. |
b | - the byte to be printed. |
IOException | - if an I/O error occurs. |
|
related |
Prints the character c to the text output stream out by calling out.write(c)
.
out | - a text output stream. |
c | - the character to be printed. |
IOException | - if an I/O error occurs. |
|
related |
Prints the short integer i to the text output stream out by calling out.printInt(s)
.
out | - a text output stream. |
i | - the short integer to be printed. |
IOException | - if an I/O error occurs. |
|
related |
Prints the integer i to the text output stream out by calling out.printInt(i)
.
out | - a text output stream. |
i | - the integer to be printed. |
IOException | - if an I/O error occurs. |
|
related |
Prints the long integer i to the text output stream out by calling out.printInt(i)
.
out | - a text output stream. |
i | - the long integer to be printed. |
IOException | - if an I/O error occurs. |
|
related |
Prints the float f to the text output stream out by calling out.printFloat(f)
.
out | - a text output stream. |
f | - the float to be printed. |
IOException | - if an I/O error occurs. |
|
related |
Prints the double d to the text output stream out by calling out.printFloat(d)
.
out | - a text output stream. |
d | - the double to be printed. |
IOException | - if an I/O error occurs. |
|
related |
Prints the null-terminated character array s to the text output stream out.
out | - a text output stream. |
s | - a null-terminated character array, or NULL . |
IOException | - if an I/O error occurs. |
|
related |
Applies the manipulator function manip to the text output stream out. This operator is equivalent with:
return manip( out );
out | - a text output stream. |
manip | - a text output manipulator function. |
IOException | - if an I/O error occurs. |
|
related |
A manipulator function that writes the newline '\n' character to the text output stream out.
out | - a text output stream. |
IOException | - if an I/O error occurs. |