libUTL++
I/O Streams

Streams and other I/O abstractions. More...

Classes

class  utl::Base64encode
 Encode binary data using Base64 (the MIME / RFC 2045 encoding). More...
 
class  utl::Base64decode
 Decode binary data that was encoded using Base64 (the MIME / RFC 2045 encoding). More...
 
class  utl::Base64encoder
 Base64 encoder/decoder stream. More...
 
class  utl::BufferedFDstream
 Buffered stream with file descriptor. More...
 
class  utl::BufferedFileStream
 Buffered disk file stream. More...
 
class  utl::BufferedStream
 Buffered stream. More...
 
class  utl::CRC32
 Generate CRC-32 checksums. More...
 
class  utl::Encoder
 Encoder/decoder abstraction. More...
 
class  utl::FDstream
 Stream with file descriptor. More...
 
class  utl::FileStream
 Disk file stream. More...
 
class  utl::IOmux
 Stream (de)-multiplexor. More...
 
class  utl::MD5sum
 Store MD5 checksum. More...
 
class  utl::MD5
 Generate MD5 checksums. More...
 
class  utl::MemStream
 Memory stream. More...
 
class  utl::SHA256
 Compute SHA256 cryptographic hash. More...
 
class  utl::SHA256sum
 Store a SHA256 sum. More...
 
class  utl::Stream
 Stream I/O abstraction. More...
 
class  utl::SyslogStream
 Syslog stream. More...
 

Enumerations

enum  utl::fs_flags_t { utl::fs_create = 4, utl::fs_append = 8, utl::fs_trunc = 16, utl::fs_clobber = 32 }
 FileStream flags. More...
 
enum  utl::ios_flg_t { utl::io_eof = 3, utl::io_error = 4, utl::io_bol = 5, utl::io_lineBuffered = 6 }
 Stream flags. More...
 

Functions

utl::BufferedStreamutl::endl (utl::BufferedStream &stream)
 Output a newline to the stream.
 
utl::BufferedStreamutl::endlf (utl::BufferedStream &stream)
 Output a newline to the stream and flush its output.
 
utl::BufferedStreamutl::flush (utl::BufferedStream &stream)
 Flush the stream's output.
 
utl::BufferedStreamoperator<< (utl::BufferedStream &lhs, const utl::Object &rhs)
 Output an object's string representation to a stream (with Object::toString()). More...
 
utl::BufferedStreamoperator>> (utl::BufferedStream &lhs, utl::String &rhs)
 Read a string from the given input stream. More...
 
utl::BufferedStreamoperator<< (utl::BufferedStream &lhs, const utl::String &rhs)
 Write a string to the given output stream. More...
 
utl::Streamutl::endl (utl::Stream &stream)
 Output a newline to the stream.
 
utl::Streamutl::endlf (utl::Stream &stream)
 Output a newline to the stream and flush its output.
 
utl::Streamutl::flush (utl::Stream &stream)
 Flush the stream's output.
 
utl::Streamoperator<< (utl::Stream &lhs, const utl::Object &rhs)
 Output an object's string representation to a stream (with Object::toString()). More...
 
utl::Streamoperator>> (utl::Stream &lhs, utl::String &rhs)
 Read a string from the given input stream. More...
 
utl::Streamoperator<< (utl::Stream &lhs, const utl::String &rhs)
 Write a string to the given output stream. More...
 

Variables

BufferedFDstream utl::cin
 Standard input.
 
BufferedFDstream utl::cout
 Standard output.
 
BufferedFDstream utl::cerr
 Standard error.
 

Detailed Description

Streams and other I/O abstractions.

Enumeration Type Documentation

◆ fs_flags_t

FileStream flags.

Enumerator
fs_create 

FileStream::open() : create a new file.

fs_append 

FileStream::open() : open in append mode.

fs_trunc 

FileStream::open() : truncate existing file.

fs_clobber 

same as io_wr | fs_create | fs_trunc

Definition at line 18 of file FileStream.h.

◆ ios_flg_t

Stream flags.

Enumerator
io_eof 

end-of-file

io_error 

I/O error.

io_bol 

begin-of-line

io_lineBuffered 

line-buffered

Definition at line 21 of file Stream.h.

Function Documentation

◆ operator<<() [1/4]

utl::BufferedStream& operator<< ( utl::BufferedStream lhs,
const utl::Object rhs 
)

Output an object's string representation to a stream (with Object::toString()).

Returns
output stream
Parameters
lhsstream to output to
rhsobject to output

Referenced by utl::flush(), and utl::BufferedStream::setLineBuffered().

◆ operator>>() [1/2]

utl::BufferedStream& operator>> ( utl::BufferedStream lhs,
utl::String rhs 
)

Read a string from the given input stream.

Returns
reference to input stream
Parameters
lhsinput stream
rhsoutput string

Referenced by utl::flush(), and utl::BufferedStream::setLineBuffered().

◆ operator<<() [2/4]

utl::BufferedStream& operator<< ( utl::BufferedStream lhs,
const utl::String rhs 
)

Write a string to the given output stream.

Returns
reference to output stream.
Parameters
lhsoutput stream
rhsinput string

◆ operator<<() [3/4]

utl::Stream& operator<< ( utl::Stream lhs,
const utl::Object rhs 
)

Output an object's string representation to a stream (with Object::toString()).

Returns
output stream
Parameters
lhsstream to output to
rhsobject to output

Referenced by utl::flush(), and utl::Stream::operator<<().

◆ operator>>() [2/2]

utl::Stream& operator>> ( utl::Stream lhs,
utl::String rhs 
)

Read a string from the given input stream.

Returns
reference to input stream
Parameters
lhsinput stream
rhsoutput string

Referenced by utl::flush(), and utl::Stream::operator<<().

◆ operator<<() [4/4]

utl::Stream& operator<< ( utl::Stream lhs,
const utl::String rhs 
)

Write a string to the given output stream.

Returns
reference to output stream.
Parameters
lhsoutput stream
rhsinput string