MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
TagBuilder Class Reference

A class that constructs Tag objects. More...

`#include <TagBuilder.hxx>`

## Public Member Functions
| TagBuilder ()
| Create an empty tag. More...
| ~TagBuilder ()
| TagBuilder (const TagBuilder &other)=delete
| TagBuilder (const Tag &other)
| TagBuilder (Tag &&other)
TagBuilder & | operator= (const TagBuilder &other)
TagBuilder & | operator= (TagBuilder &&other)
TagBuilder & | operator= (Tag &&other)
bool | IsEmpty () const
| Returns true if the tag contains no items. More...
gcc_pure bool | IsDefined () const
| Returns true if the object contains any information. More...
void | Clear ()
void | Commit (Tag &tag)
| Move this object to the given Tag instance. More...
Tag | Commit ()
| Create a new Tag instance from data in this object. More...
Tag * | CommitNew ()
| Create a new Tag instance from data in this object. More...
void | SetDuration (SignedSongTime _duration)
void | SetHasPlaylist (bool _has_playlist)
void | Reserve (unsigned n)
gcc_pure bool | HasType (TagType type) const
| Checks whether the tag contains one or more items with the specified type. More...
void | Complement (const Tag &other)
| Copy attributes and items from the other object that do not exist in this object. More...
gcc_nonnull_all void | AddItem (TagType type, StringView value)
| Appends a new tag item. More...
gcc_nonnull_all void | AddItem (TagType type, const char *value)
| Appends a new tag item. More...
void | AddEmptyItem (TagType type)
| Appends a new tag item with an empty value. More...
void | RemoveAll ()
| Removes all tag items. More...
void | RemoveType (TagType type)
| Removes all tag items of the specified type. More...

## Detailed Description

A class that constructs Tag objects.

Definition at line 36 of file TagBuilder.hxx.

## Constructor & Destructor Documentation

TagBuilder::TagBuilder | ( |  | ) |
| inline

Create an empty tag.

Definition at line 56 of file TagBuilder.hxx.

TagBuilder::~TagBuilder | ( |  | ) |
| inline

Definition at line 59 of file TagBuilder.hxx.

TagBuilder::TagBuilder | ( | const TagBuilder & | other | ) |
| delete

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

TagBuilder::TagBuilder | ( | Tag && | other | ) |
| explicit

## Member Function Documentation

void TagBuilder::AddEmptyItem | ( | TagType | type | ) |

Appends a new tag item with an empty value.

Do not use this unless you know what you're doing - because usually, empty values are discarded.

gcc_nonnull_all void TagBuilder::AddItem | ( | TagType | type,
|  | StringView | value
| ) |  |

Appends a new tag item.

Parameters

  type | the type of the new tag item
  value | the value of the tag item (not null-terminated)
  length | the length of #value

gcc_nonnull_all void TagBuilder::AddItem | ( | TagType | type,
|  | const char * | value
| ) |  |

Appends a new tag item.

Parameters

  type | the type of the new tag item
  value | the value of the tag item (null-terminated)

void TagBuilder::Clear | ( |  | ) |

void TagBuilder::Commit | ( | Tag & | tag | ) |

Move this object to the given Tag instance.

This object is empty afterwards.

Tag TagBuilder::Commit | ( |  | ) |

Create a new Tag instance from data in this object.

This object is empty afterwards.

Tag* TagBuilder::CommitNew | ( |  | ) |

Create a new Tag instance from data in this object.

The returned object is owned by the caller. This object is empty afterwards.

void TagBuilder::Complement | ( | const Tag & | other | ) |

Copy attributes and items from the other object that do not exist in this object.

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

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

gcc_pure bool TagBuilder::IsDefined | ( |  | ) | const
| inline

Returns true if the object contains any information.

Definition at line 85 of file TagBuilder.hxx.

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

Returns true if the tag contains no items.

This ignores the "duration" attribute.

Definition at line 77 of file TagBuilder.hxx.

TagBuilder& TagBuilder::operator= | ( | const TagBuilder & | other | ) |

TagBuilder& TagBuilder::operator= | ( | TagBuilder && | other | ) |

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

void TagBuilder::RemoveAll | ( |  | ) |

Removes all tag items.

void TagBuilder::RemoveType | ( | TagType | type | ) |

Removes all tag items of the specified type.

void TagBuilder::Reserve | ( | unsigned | n | ) |
| inline

Definition at line 118 of file TagBuilder.hxx.

void TagBuilder::SetDuration | ( | SignedSongTime | _duration | ) |
| inline

Definition at line 110 of file TagBuilder.hxx.

void TagBuilder::SetHasPlaylist | ( | bool | _has_playlist | ) |
| inline

Definition at line 114 of file TagBuilder.hxx.

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

- tag/TagBuilder.hxx