C++ Portable Types Library (PTypes) Version 1.7

Top: Streams: outstm

#include <pstreams.h>

void outstm::putf(const char* fmt, ...);
void outstm::put(char c);
void outstm::put(const string& str);
void outstm::puteol();
int  outstm::write(const char* buf, int count);
void outstm::flush();
bool outstm::get/set_flusheol();

This class implements the basic functionality of output streams. Outstm is derived from iobase and inherits all its public methods and properties.

End-of-line sequences are not translated when you send data through the output methods. To write an end-of-line sequence appropriate to the given operating environment use puteol() instead.

void outstm::putf(const char* fmt, ...) is a printf-style output method. PTypes supports a subset of format specifiers common to all platforms. PTypes supports <blank>, '#', '+' and '-' formatting flags, 'L', 'h', 'l' and 'll' format modifiers, and the following format specifiers: cdiouxXeEfgGps.

void outstm::put(char c) writes the character c to the stream.

void outstm::put(const string& str) writes the string str to the stream.

void outstm::puteol() writes an end-of-line sequence to the stream. The actual sequence depends on the platform the library was compiled on. May flush data if the property flusheol is set to true.

int outstm::write(const char* buf, int count) writes count bytes from the buffer buf to the stream.

void outstm::flush() writes the remaining data in the buffer to the media, if any. This method is called automatically when the stream is being closed.

bool outstm::get/set_flusheol() -- set this property to true if you want each line to be written to the media or communication stream immediately. Default is false.

See also: iobase, instm, Error handling

PTypes home