The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Audio::TagLib::ID3v2::FrameList - Perl-only class

SYNOPSIS

  use Audio::TagLib::ID3v2::FrameList;
  
  my $tag  = Audio::TagLib::ID3v2::Tag->new();
  $tag->setTitle(Audio::TagLib::String->new("title"));
  $tag->setArtist(Audio::TagLib::String->new("artist"));
  my $i = $tag->frameList();
  print $i->size(), "\n"; # got 2

  tie my @i, ref($i), $i;
  print $i[0]->toString()->toCString(), "\n"; # got "title"

DESCRIPTION

This implements Audio::TagLib::ID3v2::FrameList in C/C++ code, which is of type Audio::TagLib::List<Audio::TagLib::ID3v2::Frame *>. The list is copy-on-write.

You can also tie the instance to a array symbol, then operate through the functionalities of array.

WARNING The STORE method behaves different. It will insert item into specific index, or append to the end of list if index is out of bound. That means it will NEVER replace ANY existing item.

Just GET what you want from the tied array and SET everything through normal class methods.

new()

Constructs an empty list.

new(FrameList $l)

Make a shallow, implicitly shared, copy of $l. Because this is implicitly shared, this method is lightweight and suitable for pass-by-value usage.

DESTROY()

Destroys this List instance. If auto deletion is enabled and this list contains a pointer type all of the memebers are also deleted.

Iterator begin()

Returns an STL style iterator to the beginning of the list.

Iterator end()

Returns an STL style iterator to the end of the list.

void insert(Iterator $it, Frame $value)n

Insert a copy of $value before $it.

void sortedInsert(Frame $value, BOOL $unique = FALSE)

Inserts the $value into the list. This assumes that the list is currently sorted. If $unique is true then the value will not be inserted if it is already in the list.

FrameList append(Frame $item)

Appends $item to the end of the list and returns a reference to the list.

FrameList append(FrameList $l)

Appends all of the values in $l to the end of the list and returns a reference to the list.

FrameList prepend(Frame $item)

Prepends $item to the beginning list and returns a reference to the list.

FrameList prepend(FrameList $l)

Prepends all of the items in $l to the beginning list and returns a reference to the list.

void clear()

Clears the list. If auto deletion is enabled and this list contains a pointer type the members are also deleted.

see setAutoDelete()

UV size()

Returns the number of elements in the list.

BOOL isEmpty()

Returns TRUE if list is empty.

Iterator find(Frame $value)

Finds the first occurance of $value.

BOOL contains(Frame $value)

Returns true if the list contains $value.

void erase(Iterator $it)

Erase the item at $it from the list.

Frame front()

Returns the first item in the list.

Frame back()

Returns the last item in the list.

void setAutoDelete(BOOL $autoDelete)

Auto delete the members of the list when the last reference to the list passes out of scope. This will have no effect on lists which do not contain a pointer type.

NOTE This relies on partial template instantiation -- most modern C++ compilers should now support this.

Frame getItem(UV $i)

Returns the item $i in the list.

WARNING This method is slow. Use iterators to loop through the list.

FrameList copy(FrameList $l)

Make a shallow, implicitly shared, copy of $l. Because this is implicitly shared, this method is lightweight and suitable for pass-by-value usage.

OVERLOADED OPERATORS

==

EXPORT

None by default.

SEE ALSO

Audio::TagLib

AUTHOR

Dongxu Ma, <dongxu@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Dongxu Ma

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.