MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Data Structures | Public Member Functions | Static Public Member Functions | Data Fields
Tag Struct Reference

The meta information about a song file. More...

`#include <Tag.hxx>`

Collaboration diagram for Tag:
[legend]

## Data Structures
class | const_iterator

## Public Member Functions
| Tag ()
| Create an empty tag. More...
| Tag (const Tag &other)
| Tag (Tag &&other)
| ~Tag ()
| Free the tag object and all its items. More...
Tag & | operator= (const Tag &other)=delete
Tag & | operator= (Tag &&other)
void | MoveItemsFrom (Tag &&other)
| Similar to the move operator, but move only the TagItem array. More...
bool | IsEmpty () const
| Returns true if the tag contains no items. More...
bool | IsDefined () const
| Returns true if the tag contains any information. More...
void | Clear ()
| Clear everything, as if this was a new Tag object. More...
gcc_pure const char * | GetValue (TagType type) const
| Returns the first value of the specified tag type, or nullptr if none is present in this tag object. More...
gcc_pure bool | HasType (TagType type) const
| Checks whether the tag contains one or more items with the specified type. More...
const_iterator | begin () const
const_iterator | end () const

## Static Public Member Functions
static gcc_malloc Tag * | Merge (const Tag &base, const Tag &add)
| Merges the data from two tags. More...
static gcc_malloc Tag * | MergeReplace (Tag *base, Tag *add)
| Merges the data from two tags. More...

## Data Fields
SignedSongTime | duration
| The duration of the song. More...
bool | has_playlist
| Does this file have an embedded playlist (e.g. More...
unsigned short | num_items
| the total number of tag items in the items array More...
TagItem ** | items
| an array of tag items More...

## Detailed Description

The meta information about a song file.

It is a MPD specific subset of tags (e.g. from ID3, vorbis comments, ...).

Definition at line 34 of file Tag.hxx.

## Constructor & Destructor Documentation

Tag::Tag | ( |  | ) |
| inline

Create an empty tag.

Definition at line 56 of file Tag.hxx.

Tag::Tag | ( | const Tag & | other | ) |

Tag::Tag | ( | Tag && | other | ) |
| inline

Definition at line 61 of file Tag.hxx.

Tag::~Tag | ( |  | ) |
| inline

Free the tag object and all its items.

Definition at line 71 of file Tag.hxx.

## Member Function Documentation

const_iterator Tag::begin | ( |  | ) | const
| inline

Definition at line 190 of file Tag.hxx.

void Tag::Clear | ( |  | ) |

Clear everything, as if this was a new Tag object.

const_iterator Tag::end | ( |  | ) | const
| inline

Definition at line 194 of file Tag.hxx.

gcc_pure const char* Tag::GetValue | ( | TagType | type | ) | const

Returns the first value of the specified tag type, or nullptr if none is present in this tag object.

gcc_pure bool Tag::HasType | ( | TagType | type | ) | const

Checks whether the tag contains one or more items with the specified type.

bool Tag::IsDefined | ( |  | ) | const
| inline

Returns true if the tag contains any information.

Definition at line 104 of file Tag.hxx.

bool Tag::IsEmpty | ( |  | ) | const
| inline

Returns true if the tag contains no items.

This ignores the "duration" attribute.

Definition at line 97 of file Tag.hxx.

static gcc_malloc Tag* Tag::Merge | ( | const Tag & | base,
|  | const Tag & | add
| ) |  |
| static

Merges the data from two tags.

If both tags share data for the same TagType, only data from "add" is used.

Returns
  a newly allocated tag

static gcc_malloc Tag* Tag::MergeReplace | ( | Tag * | base,
|  | Tag * | add
| ) |  |
| static

Merges the data from two tags.

Any of the two may be nullptr. Both are freed by this function.

Returns
  a newly allocated tag

void Tag::MoveItemsFrom | ( | Tag && | other | ) |
| inline

Similar to the move operator, but move only the TagItem array.

Definition at line 88 of file Tag.hxx.

Tag& Tag::operator= | ( | const Tag & | other | ) |
| delete

Tag& Tag::operator= | ( | Tag && | other | ) |
| inline

Definition at line 77 of file Tag.hxx.

## Field Documentation

SignedSongTime Tag::duration

The duration of the song.

A negative value means that the length is unknown.

Definition at line 39 of file Tag.hxx.

bool Tag::has_playlist

Does this file have an embedded playlist (e.g.

embedded CUE sheet)?

Definition at line 45 of file Tag.hxx.

TagItem** Tag::items

an array of tag items

Definition at line 51 of file Tag.hxx.

unsigned short Tag::num_items

the total number of tag items in the items array

Definition at line 48 of file Tag.hxx.

The documentation for this struct was generated from the following file:

- tag/Tag.hxx