28#ifndef _ID3LIB_READER_DECORATORS_H_
29#define _ID3LIB_READER_DECORATORS_H_
51 {
return this->getBeg() <= cur && cur < this->getEnd(); }
55 : _reader(reader), _beg(reader.getBeg()), _end(reader.getEnd()) { ; }
58 : _reader(reader), _beg(reader.getBeg()), _end(reader.getEnd())
59 { this->setWindow(this->getCur(), size); }
62 : _reader(reader), _beg(reader.getBeg()), _end(reader.getEnd())
63 { this->setWindow(beg, size); }
65 void setWindow(pos_type beg, size_type size);
67 pos_type setBeg(pos_type);
70 return _reader.
setCur(mid(this->getBeg(), cur, this->getEnd()));
72 pos_type setEnd(pos_type);
83 size_type readChars(char_type buf[], size_type len);
86 return this->readChars((
char_type*) buf, len);
109 size_type readChars(char_type buf[], size_type len);
112 return this->readChars((
char_type*) buf, len);
162 : _writer(writer), _last(
'\0'), _numSyncs(0)
166 int_type writeChar(char_type ch);
174 size_type writeChars(
const char_type[], size_type len);
177 return this->writeChars(
reinterpret_cast<const char_type *
>(buf), len);
197 : _writer(writer), _data(), _origSize(0)
virtual pos_type setCur(pos_type pos)=0
Set the value of the current position for reading.
virtual pos_type getCur()=0
Return the current position in the reader.
virtual pos_type getEnd()
Return the ending position in the reader.
virtual pos_type getBeg()
Return the beginning position in the reader.
virtual int_type peekChar()=0
Return the next character to be read without advancing the internal position.
virtual pos_type getEnd()
Return the first position that can't be written to.
virtual pos_type getBeg()
Return the beginning position in the writer.
virtual pos_type getCur()=0
Return the next position that will be written to.
size_type readChars(char buf[], size_type len)
pos_type setCur(pos_type cur)
Set the value of the current position for reading.
int_type peekChar()
Return the next character to be read without advancing the internal position.
CharReader(ID3_Reader &reader)
pos_type getBeg()
Return the beginning position in the reader.
pos_type getEnd()
Return the ending position in the reader.
void close()
Close the reader.
pos_type getCur()
Return the current position in the reader.
CompressedWriter(ID3_Writer &writer)
virtual ~CompressedWriter()
pos_type getCur()
Return the next position that will be written to.
void close()
Close the writer.
size_type getOrigSize() const
void flush()
Flush the writer.
size_type writeChars(const char_type buf[], size_type len)
Write up to len characters into buf and advance the internal position accordingly.
size_type writeChars(const char buf[], size_type len)
LineFeedReader(ID3_Reader &reader)
UnsyncedReader(ID3_Reader &reader)
pos_type getBeg()
Return the beginning position in the writer.
size_type getNumSyncs() const
size_type writeChars(const char buf[], size_type len)
void close()
Close the writer.
pos_type getEnd()
Return the first position that can't be written to.
pos_type getCur()
Return the next position that will be written to.
UnsyncedWriter(ID3_Writer &writer)
Set a window on the buffer.
pos_type getCur()
Return the current position in the reader.
WindowedReader(ID3_Reader &reader)
size_type readChars(char buf[], size_type len)
pos_type getBeg()
Return the beginning position in the reader.
pos_type setCur(pos_type cur)
Set the value of the current position for reading.
pos_type getEnd()
Return the ending position in the reader.
WindowedReader(ID3_Reader &reader, size_type size)
void close()
Close the reader.
WindowedReader(ID3_Reader &reader, pos_type beg, size_type size)