39 #if !defined(TAWARA_BLOCK_IMPL_H_)
40 #define TAWARA_BLOCK_IMPL_H_
58 public boost::equality_comparable<BlockImpl>
62 BlockImpl(uint64_t track_number, int16_t timecode,
69 { track_num_ = track_number; }
93 {
return frames_.at(pos); }
98 {
return frames_.at(pos); }
104 {
return frames_[pos]; }
109 {
return frames_[pos]; }
133 bool empty()
const {
return frames_.empty(); }
137 size_type max_count()
const;
144 { frames_.erase(position); }
147 { frames_.erase(first, last); }
150 void push_back(value_type
const& value);
153 void resize(size_type count);
163 std::streamsize
size()
const;
183 std::streamsize
write(std::ostream& output, uint8_t extra_flags);
220 void validate()
const;
235 std::streamsize read_ebml_laced_frames(std::istream& input,
236 std::streamsize
size);
252 std::streamsize read_fixed_frames(std::istream& input,
253 std::streamsize
size,
unsigned int count);
263 #endif // TAWARA_BLOCK_IMPL_H_
std::streamsize write(ID id, std::ostream &output)
Write an ID to an output stream.
size_type count() const
Get the number of frames.
const_iterator end() const
Get an iterator to the position past the last frame.
std::vector< value_type > frames_
std::streamsize size(ID id)
Get the number of bytes required by an ID.
value_type const & operator[](size_type pos) const
Get a reference to a frame.
std::vector< FramePtr >::const_iterator const_iterator
The constant random access iterator type.
void track_number(uint64_t track_number)
Set the block's track number.
value_type & operator[](size_type pos)
Get a reference to a frame.
Common block functionality implementation.
boost::shared_ptr< std::vector< char > > value_type
The stored type.
iterator begin()
Get an iterator to the first frame.
bool invisible() const
If this block is invisible.
reverse_iterator rbegin()
Get a reverse iterator to the last frame.
void clear()
Remove all frames.
ReadResult read(std::istream &input)
Read an ID from an input stream.
bool operator==(AttachedFile const &lhs, AttachedFile const &rhs)
Equality operator for the AttachedFile object.
void timecode(int16_t timecode)
Set the block's timecode.
std::vector< FramePtr >::size_type size_type
The size type of this container.
bool empty() const
Check if there are no frames.
const_reverse_iterator rend() const
Get a reverse iterator to the position before the first frame.
reverse_iterator rend()
Get a reverse iterator to the position before the first frame.
std::vector< FramePtr >::reverse_iterator reverse_iterator
The reversed random access iterator type.
LacingType lacing() const
Get the lacing type in use.
const_reverse_iterator rbegin() const
Get a reverse iterator to the last frame.
void erase(iterator first, iterator last)
Erase a range of frames.
value_type const & at(size_type pos) const
Get the frame at the given position, with bounds checking.
const_iterator begin() const
Get an iterator to the first frame.
void erase(iterator position)
Erase the frame at the specified iterator.
value_type & at(size_type pos)
Get the frame at the given position, with bounds checking.
std::pair< std::streamsize, uint8_t > ReadResult
The return result of a read.
std::vector< FramePtr >::const_reverse_iterator const_reverse_iterator
The constant reversed random access iterator type.
void lacing(LacingType lacing)
Set the lacing type in use.
uint64_t track_number() const
The block's track number.
int16_t timecode() const
The timecode of this block.
void invisible(bool invisible)
Set if this block is invisible.
iterator end()
Get an iterator to the position past the last frame.
std::vector< FramePtr >::iterator iterator
The random access iterator type.