foobar2000_io::stream_writer Class Reference

#include <filesystem.h>

Inheritance diagram for foobar2000_io::stream_writer:

foobar2000_io::file foobar2000_io::file_dynamicinfo

List of all members.

Public Member Functions

virtual void write (const void *p_buffer, t_size p_bytes, abort_callback &p_abort)=0
void write_object (const void *p_buffer, t_size p_bytes, abort_callback &p_abort)
 Helper. Same as write(), provided for consistency.
template<typename T>
void write_object_t (const T &p_object, abort_callback &p_abort)
template<typename T>
void write_lendian_t (const T &p_object, abort_callback &p_abort)
template<typename T>
void write_bendian_t (const T &p_object, abort_callback &p_abort)
void write_string (const char *p_string, abort_callback &p_abort)
 Helper function; writes string (with 32-bit header indicating length in bytes followed by UTF-8 encoded data without null terminator).
void write_string (const char *p_string, t_size p_len, abort_callback &p_abort)
template<typename T>
void write_string (const T &val, abort_callback &p_abort)
void write_string_raw (const char *p_string, abort_callback &p_abort)
 Helper function; writes raw string to the stream, with no length info or null terminators.

Protected Member Functions

 stream_writer ()
 ~stream_writer ()


Detailed Description

Generic interface to write data to a nonseekable stream. Also see: stream_reader, file.
Error handling: all methods may throw exception_io or one of derivatives on failure; exception_aborted when abort_callback is signaled.

Constructor & Destructor Documentation

foobar2000_io::stream_writer::stream_writer (  )  [inline, protected]

foobar2000_io::stream_writer::~stream_writer (  )  [inline, protected]


Member Function Documentation

virtual void foobar2000_io::stream_writer::write ( const void *  p_buffer,
t_size  p_bytes,
abort_callback p_abort 
) [pure virtual]

Writes specified number of bytes from specified buffer to the stream.

Parameters:
p_buffer Buffer with data to write. Must contain at least p_bytes bytes.
p_bytes Number of bytes to write.
p_abort abort_callback object signaling user aborting the operation.

void foobar2000_io::stream_writer::write_object ( const void *  p_buffer,
t_size  p_bytes,
abort_callback p_abort 
) [inline]

Helper. Same as write(), provided for consistency.

template<typename T>
void foobar2000_io::stream_writer::write_object_t ( const T &  p_object,
abort_callback p_abort 
) [inline]

Helper template. Writes single raw object to the stream.

Parameters:
p_object Object to write.
p_abort abort_callback object signaling user aborting the operation.

template<typename T>
void foobar2000_io::stream_writer::write_lendian_t ( const T &  p_object,
abort_callback p_abort 
) [inline]

Helper template. Writes single raw object to the stream; corrects byte order assuming stream uses little endian order.

Parameters:
p_object Object to write.
p_abort abort_callback object signaling user aborting the operation.

template<typename T>
void foobar2000_io::stream_writer::write_bendian_t ( const T &  p_object,
abort_callback p_abort 
) [inline]

Helper template. Writes single raw object to the stream; corrects byte order assuming stream uses big endian order.

Parameters:
p_object Object to write.
p_abort abort_callback object signaling user aborting the operation.

void foobar2000_io::stream_writer::write_string ( const char *  p_string,
abort_callback p_abort 
)

Helper function; writes string (with 32-bit header indicating length in bytes followed by UTF-8 encoded data without null terminator).

void foobar2000_io::stream_writer::write_string ( const char *  p_string,
t_size  p_len,
abort_callback p_abort 
)

template<typename T>
void foobar2000_io::stream_writer::write_string ( const T &  val,
abort_callback p_abort 
) [inline]

void foobar2000_io::stream_writer::write_string_raw ( const char *  p_string,
abort_callback p_abort 
)

Helper function; writes raw string to the stream, with no length info or null terminators.


The documentation for this class was generated from the following file:

Generated on Fri Apr 25 18:49:55 2008 for foobar2000 SDK by  doxygen 1.5.5