Class: TagLib::MP4::ItemMap
- Inherits:
-
Object
- Object
- TagLib::MP4::ItemMap
- Defined in:
- docs/taglib/mp4.rb
Overview
The underlying C++-structure of ItemMap
inherits from std::map
.
Consequently, ItemMap
behaves differently from a Ruby hash in a few
places: the C++ memory management strategies of ItemMap can lead to
a situation where a Ruby object refers to a location in memory that was
freed by C++. To prevent Ruby from crashing on us with a segmentation
fault, we raise an ObjectPreviouslyDeleted
exception when we try to access
data that is no longer available.
Instance Method Summary collapse
-
#clear ⇒ nil
Remove all Items from self, destroying each Item.
-
#contains(key) ⇒ Boolean
(also: #has_key?, #include?)
Returns true if self has an Item under
key
. -
#empty? ⇒ Boolean
Returns true if self is empty.
-
#erase(key) ⇒ nil
Remove and destroy the value under
key
, if present. -
#fetch(key) ⇒ TagLib::MP4::Item?
(also: #[])
Return the Item under
key
, ornil
if no Item is present. -
#insert(key, item) ⇒ nil
Insert an item at
key
, destoying the existing item underkey
. -
#size ⇒ Fixnum
The number of Items in self.
-
#to_a ⇒ Array<Array<String, TagLib::MP4::Item>>
Convert self into an array of
[key, value]
pairs. -
#to_h ⇒ Hash<String, TagLib::MP4::Item>
Convert self into an hash.
Instance Method Details
#clear ⇒ nil
May free memory referred to by Ruby objects
Remove all Items from self, destroying each Item.
268 269 |
# File 'docs/taglib/mp4.rb', line 268 def clear end |
#contains(key) ⇒ Boolean Also known as: has_key?, include?
Returns true if self has an Item under key
.
274 275 |
# File 'docs/taglib/mp4.rb', line 274 def contains(key) end |
#empty? ⇒ Boolean
Returns true if self is empty
281 282 |
# File 'docs/taglib/mp4.rb', line 281 def empty? end |
#erase(key) ⇒ nil
May free memory referred to by Ruby objects
Remove and destroy the value under key
, if present.
297 298 |
# File 'docs/taglib/mp4.rb', line 297 def erase(key) end |
#fetch(key) ⇒ TagLib::MP4::Item? Also known as: []
Return the Item under key
, or nil
if no Item is present.
252 253 |
# File 'docs/taglib/mp4.rb', line 252 def fetch(key) end |
#insert(key, item) ⇒ nil
May free memory referred to by Ruby objects
Insert an item at key
, destoying the existing item under key
.
312 313 |
# File 'docs/taglib/mp4.rb', line 312 def insert(key, item) end |
#size ⇒ Fixnum
The number of Items in self.
317 318 |
# File 'docs/taglib/mp4.rb', line 317 def size end |
#to_a ⇒ Array<Array<String, TagLib::MP4::Item>>
Convert self into an array of [key, value]
pairs.
322 323 |
# File 'docs/taglib/mp4.rb', line 322 def to_a end |
#to_h ⇒ Hash<String, TagLib::MP4::Item>
Convert self into an hash.
329 330 |
# File 'docs/taglib/mp4.rb', line 329 def to_h end |