Qore Programming Language Reference Manual 1.19.2
|
This class defines a stream writer for output streams. More...
#include <QC_StreamWriter.dox.h>
Public Member Methods | |
constructor (Qore::OutputStream os, *string encoding) | |
Creates the StreamWriter for writing data to the given OutputStream. More... | |
nothing | f_printf (string fmt,...) |
Writes a formatted string with hard field widths to an output stream; string data is converted to the StreamWriter's character encoding if necessary before writing. More... | |
nothing | f_vprintf (string fmt, any fmt_args) |
Writes a formatted string with hard field widths to an output stream, where the second argument is the formatting argument list; string data is converted to the StreamWriter's character encoding if necessary before writing. More... | |
string | getEncoding () |
Returns the character encoding for the StreamWriter. More... | |
OutputStream | getOutputStream () |
Returns the OutputStream for the StreamWriter. More... | |
nothing | print (string str) |
Writes string data to an output stream; string data is converted to the StreamWriter's character encoding if necessary before writing. More... | |
nothing | printf (string fmt,...) |
Writes a formatted string with soft field widths to an output stream; string data is converted to the StreamWriter's character encoding if necessary before writing. More... | |
nothing | vprintf (string fmt, any fmt_args) |
Writes a formatted string with soft field widths to an output stream, where the second argument is the formatting argument list; string data is converted to the StreamWriter's character encoding if necessary before writing. More... | |
nothing | write (string str) |
Writes a String to the output stream. More... | |
nothing | write (binary b) |
Writes a Binary to the output stream. More... | |
nothing | writei1 (int c) |
Writes a 1-byte signed integer to the output stream. More... | |
nothing | writei2 (int s) |
Writes a 2-byte (16 bit) integer to the output stream in binary big-endian format. More... | |
nothing | writei2LSB (int s) |
Writes a 2-byte (16 bit) integer to the output stream in binary little-endian format. More... | |
nothing | writei4 (int i) |
Writes a 4-byte (32 bit) integer to the output stream in binary big-endian format. More... | |
nothing | writei4LSB (int i) |
Writes a 4-byte (32 bit) integer to the output stream in binary little-endian format. More... | |
nothing | writei8 (int i) |
Writes an 8-byte (64 bit) integer to the output stream in binary big-endian format. More... | |
nothing | writei8LSB (int i) |
Writes an 8-byte (64 bit) integer to the output stream in binary little-endian format. More... | |
This class defines a stream writer for output streams.
Qore::StreamWriter::constructor | ( | Qore::OutputStream | os, |
*string | encoding | ||
) |
Creates the StreamWriter for writing data to the given OutputStream.
os | the OutputStream for writing data |
encoding | character encoding of the StreamWriter; all passed string data will be converted to this encoding before being written to the output stream; if not present, the default character encoding is assumed |
nothing Qore::StreamWriter::f_printf | ( | string | fmt, |
... | |||
) |
Writes a formatted string with hard field widths to an output stream; string data is converted to the StreamWriter's character encoding if necessary before writing.
This method does not allow arguments to overrun field width specifiers in the format string.
fmt | the format string; see String Formatting for more information about the format string |
ENCODING-CONVERSION-ERROR | error converting from the string's character encoding to the StreamWriter's character encoding |
nothing Qore::StreamWriter::f_vprintf | ( | string | fmt, |
any | fmt_args | ||
) |
Writes a formatted string with hard field widths to an output stream, where the second argument is the formatting argument list; string data is converted to the StreamWriter's character encoding if necessary before writing.
This method does not allow arguments to overrun field width specifiers in the format string.
fmt | the format string; see String Formatting for more information about the format string |
fmt_args | the single argument or list of arguments that will be used as the argument list for the format string. If a single argument is passed instead of a list, it will be used as the first argument as if a list were passed |
ENCODING-CONVERSION-ERROR | error converting from the string's character encoding to the StreamWriter's character encoding |
string Qore::StreamWriter::getEncoding | ( | ) |
Returns the character encoding for the StreamWriter.
Returns the character encoding for the StreamWriter.
OutputStream Qore::StreamWriter::getOutputStream | ( | ) |
Returns the OutputStream for the StreamWriter.
Returns the OutputStream for the StreamWriter.
nothing Qore::StreamWriter::print | ( | string | str | ) |
Writes string data to an output stream; string data is converted to the StreamWriter's character encoding if necessary before writing.
str | the string to be written to the output stream; string data is converted to the StreamWriter's character encoding if necessary before writing |
ENCODING-CONVERSION-ERROR | error converting from the string's character encoding to the StreamWriter's character encoding |
nothing Qore::StreamWriter::printf | ( | string | fmt, |
... | |||
) |
Writes a formatted string with soft field widths to an output stream; string data is converted to the StreamWriter's character encoding if necessary before writing.
This method will allow arguments to overrun field width specifiers in the format string.
fmt | the format string; see String Formatting for more information about the format string |
ENCODING-CONVERSION-ERROR | error converting from the string's character encoding to the StreamWriter's character encoding |
nothing Qore::StreamWriter::vprintf | ( | string | fmt, |
any | fmt_args | ||
) |
Writes a formatted string with soft field widths to an output stream, where the second argument is the formatting argument list; string data is converted to the StreamWriter's character encoding if necessary before writing.
This method will allow arguments to overrun field width specifiers in the format string.
fmt | the format string; see String Formatting for more information about the format string |
fmt_args | the single argument or list of arguments that will be used as the argument list for the format string. If a single argument is passed instead of a list, it will be used as the first argument as if a list were passed |
ENCODING-CONVERSION-ERROR | error converting from the string's character encoding to the StreamWriter's character encoding |
nothing Qore::StreamWriter::write | ( | binary | b | ) |
nothing Qore::StreamWriter::write | ( | string | str | ) |
Writes a String to the output stream.
str | the string to write |
nothing Qore::StreamWriter::writei1 | ( | int | c | ) |
Writes a 1-byte signed integer to the output stream.
c | the integer to write; only the least-significant 8 bits will be written to the file |
nothing Qore::StreamWriter::writei2 | ( | int | s | ) |
Writes a 2-byte (16 bit) integer to the output stream in binary big-endian format.
s | the integer to write in binary big-endian format; only the least-significant 16 bits of the integer will be written to the file |
nothing Qore::StreamWriter::writei2LSB | ( | int | s | ) |
Writes a 2-byte (16 bit) integer to the output stream in binary little-endian format.
s | the integer to write in binary little-endian format; only the least-significant 16 bits of the integer will be written to the file |
nothing Qore::StreamWriter::writei4 | ( | int | i | ) |
Writes a 4-byte (32 bit) integer to the output stream in binary big-endian format.
i | the integer to write in binary big-endian format; only the least-significant 32 bits of the integer will be written to the file |
nothing Qore::StreamWriter::writei4LSB | ( | int | i | ) |
Writes a 4-byte (32 bit) integer to the output stream in binary little-endian format.
i | the integer to write in binary little-endian format; only the least-significant 32 bits of the integer will be written to the file |
nothing Qore::StreamWriter::writei8 | ( | int | i | ) |
Writes an 8-byte (64 bit) integer to the output stream in binary big-endian format.
i | the integer to write in binary big-endian format; only the least-significant 64 bits of the integer will be written to the file |
nothing Qore::StreamWriter::writei8LSB | ( | int | i | ) |
Writes an 8-byte (64 bit) integer to the output stream in binary little-endian format.
i | the integer to write in binary little-endian format; only the least-significant 64 bits of the integer will be written to the file |