28 #ifndef _ID3LIB_READER_DECORATORS_H_ 29 #define _ID3LIB_READER_DECORATORS_H_ 33 #include "id3/utils.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); }
70 return _reader.
setCur(mid(this->getBeg(), cur, this->getEnd()));
86 return this->readChars((
char_type*) buf, len);
112 return this->readChars((
char_type*) buf, len);
162 : _writer(writer), _last(
'\0'), _numSyncs(0)
177 return this->writeChars(reinterpret_cast<const char_type *>(buf), len);
197 : _writer(writer), _data(), _origSize(0)
208 return this->writeChars(reinterpret_cast<const char_type*>(buf), len);
virtual pos_type getBeg()
Return the beginning position in the reader.
CompressedWriter(ID3_Writer &writer)
pos_type getEnd()
Return the ending position in the reader.
WindowedReader(ID3_Reader &reader, pos_type beg, size_type size)
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 ~CompressedWriter()
pos_type getBeg()
Return the beginning position in the reader.
pos_type getBeg()
Return the beginning position in the writer.
WindowedReader(ID3_Reader &reader, size_type size)
void close()
Close the reader.
size_type getNumSyncs() const
virtual pos_type getCur()=0
Return the current position in the reader.
virtual pos_type setCur(pos_type pos)=0
Set the value of the current position for reading.
pos_type setCur(pos_type cur)
Set the value of the current position for reading.
void close()
Close the writer.
size_type readChars(char buf[], size_type len)
pos_type getEnd()
Return the ending 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.
pos_type getCur()
Return the next position that will be written to.
CharReader(ID3_Reader &reader)
WindowedReader(ID3_Reader &reader)
pos_type getCur()
Return the next position that will be written to.
pos_type getCur()
Return the current position in the reader.
virtual pos_type getEnd()
Return the ending position in the reader.
pos_type getBeg()
Return the beginning position in the reader.
size_type readChars(char buf[], size_type len)
UnsyncedReader(ID3_Reader &reader)
int_type peekChar()
Return the next character to be read without advancing the internal position.
Set a window on the buffer.
pos_type getCur()
Return the current position in the reader.
size_type getOrigSize() const
void close()
Close the reader.
LineFeedReader(ID3_Reader &reader)
virtual pos_type getCur()=0
Return the next position that will be written to.
pos_type setCur(pos_type cur)
Set the value of the current position for reading.
void close()
Close the writer.
size_type writeChars(const char buf[], size_type len)
UnsyncedWriter(ID3_Writer &writer)
size_type writeChars(const char buf[], size_type len)