FLAC++/metadata.h: metadata level 2 interface

Main Page Modules Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# FLAC++/metadata.h: metadata level 2 interface
[FLAC++/metadata.h: metadata interfaces]

Level 2 metadata iterator. More...

## Compounds

class | FLAC::Metadata::Chain
class | FLAC::Metadata::Iterator

## Detailed Description

Level 2 metadata iterator.

The flow through the iterator in the C++ layer is similar to the C layer:

- Create a Chain instance
- Check Chain::is_valid()
- Call Chain::read() and check the return
- Traverse and/or edit with an Iterator or with Chain::merge_padding() or Chain::sort_padding()
- Write changes back to FLAC file with Chain::write()
- Destroy the Chain instance

The ownership of pointers in the C++ layer is slightly different than in the C layer, i.e.

- The objects returned by Iterator::get_block() are NOT owned by the iterator and should be deleted by the caller when finished, BUT, when you modify the block, it will directly edit what's in the chain and you do not need to call Iterator::set_block(). However the changes will not be reflected in the FLAC file until the chain is written with Chain::write().
- When you pass an object to Iterator::set_block(), Iterator::insert_block_before(), or Iterator::insert_block_after(), the iterator takes ownership of the block and it will be deleted by the chain.

See the C layer equivalent for more.