28#ifndef _ID3LIB_WRITERS_H_
29#define _ID3LIB_WRITERS_H_
32#include "id3/id3lib_streams.h"
42 ID3_OStreamWriter(ostream& writer) : _stream(writer), _beg(streamoff(_stream.tellp())) { ; }
46 virtual void flush() { _stream.flush(); }
59 _stream.write(buf, len);
64 _stream.write(
reinterpret_cast<const char*
>(buf), len);
96 virtual void flush() { _stream.flush(); }
109 _stream.write(buf, len);
114 _stream.write(
reinterpret_cast<const char*
>(buf), len);
170 size_type size = (remaining > len) ? len : remaining;
171 ::memcpy(_cur, buf, size);
virtual void close()
Close the writer.
ID3_FStreamWriter(fstream &writer)
virtual void close()
Close the writer.
iostream & getWriter() const
virtual void flush()
Flush the writer.
virtual size_type writeChars(const char buf[], size_type len)
Write up to len chars into buf and advance the internal position accordingly.
virtual int_type writeChar(char_type ch)
Write a single character and advance the internal position.
virtual pos_type getCur()
Return the next position that will be written to.
ID3_IOStreamWriter(iostream &writer)
virtual pos_type getBeg()
Return the beginning position in the writer.
virtual ~ID3_IOStreamWriter()
virtual size_type writeChars(const char_type buf[], size_type len)
Write up to len characters into buf and advance the internal position accordingly.
virtual pos_type getBeg()
Return the beginning position in the writer.
virtual ~ID3_MemoryWriter()
virtual size_type writeChars(const char buf[], size_type len)
Write up to len chars from buf and advance the internal position accordingly.
ID3_MemoryWriter(char_type buf[], size_t size)
virtual pos_type getCur()
Return the next position that will be written to.
virtual void close()
Close the writer.
virtual pos_type getEnd()
Return the first position that can't be written to.
virtual void flush()
Flush the writer.
virtual size_type writeChars(const char_type buf[], size_type len)
Write up to len characters into buf and advance the internal position accordingly.
void setBuffer(char_type *buf, size_t size)
virtual void close()
Close the writer.
ID3_OFStreamWriter(ofstream &writer)
virtual size_type writeChars(const char_type buf[], size_type len)
Write up to len characters into buf and advance the internal position accordingly.
virtual void close()
Close the writer.
virtual ~ID3_OStreamWriter()
virtual size_type writeChars(const char buf[], size_type len)
Write up to len chars into buf and advance the internal position accordingly.
ID3_OStreamWriter(ostream &writer)
virtual pos_type getCur()
Return the next position that will be written to.
virtual pos_type getBeg()
Return the beginning position in the writer.
ostream & getWriter() const
virtual int_type writeChar(char_type ch)
Write a single character and advance the internal position.
virtual void flush()
Flush the writer.
virtual size_type writeChars(const char_type buf[], size_type len)=0
Write up to len characters into buf and advance the internal position accordingly.