MPD: sticker/SongSticker.hxx File Reference

MPD 0.20.15

Functions
SongSticker.hxx File Reference
`#include "Match.hxx"`
`#include <string>`
Include dependency graph for SongSticker.hxx:

Go to the source code of this file.

## Functions
std::string | sticker_song_get_value (const LightSong &song, const char *name)
| Returns one value from a song's sticker record. More...
void | sticker_song_set_value (const LightSong &song, const char *name, const char *value)
| Sets a sticker value in the specified song. More...
bool | sticker_song_delete (const char *uri)
| Deletes a sticker from the database. More...
bool | sticker_song_delete (const LightSong &song)
bool | sticker_song_delete_value (const LightSong &song, const char *name)
| Deletes a sticker value. More...
Sticker * | sticker_song_get (const LightSong &song)
| Loads the sticker for the specified song. More...
void | sticker_song_find (const Database &db, const char *base_uri, const char *name, StickerOperator op, const char *value, void(*func)(const LightSong &song, const char *value, void *user_data), void *user_data)
| Finds stickers with the specified name below the specified directory. More...

## Function Documentation

## ◆ sticker_song_delete() [1/2]

bool sticker_song_delete | ( | const char * | uri | ) |

Deletes a sticker from the database.

All values are deleted.

Throws SqliteError on error.

## ◆ sticker_song_delete() [2/2]

bool sticker_song_delete | ( | const LightSong & | song | ) |

## ◆ sticker_song_delete_value()

bool sticker_song_delete_value | ( | const LightSong & | song,
|  | const char * | name
| ) |  |

Deletes a sticker value.

Does nothing if the sticker did not exist.

Throws SqliteError on error.

## ◆ sticker_song_find()

void sticker_song_find | ( | const Database & | db,
|  | const char * | base_uri,
|  | const char * | name,
|  | StickerOperator | op,
|  | const char * | value,
|  | void(*)(const LightSong &song, const char *value, void *user_data) | func,
|  | void * | user_data
| ) |  |

Finds stickers with the specified name below the specified directory.

Caller must lock the db_mutex.

Throws SqliteError on error.

Parameters

  base_uri | the base directory to search in
  name | the name of the sticker

## ◆ sticker_song_get()

Sticker* sticker_song_get | ( | const LightSong & | song | ) |

Loads the sticker for the specified song.

Throws SqliteError on error.

Parameters

  song | the song object

Returns
  a sticker object, or nullptr if there is no sticker

## ◆ sticker_song_get_value()

std::string sticker_song_get_value | ( | const LightSong & | song,
|  | const char * | name
| ) |  |

Returns one value from a song's sticker record.

Throws SqliteError on error.

## ◆ sticker_song_set_value()

void sticker_song_set_value | ( | const LightSong & | song,
|  | const char * | name,
|  | const char * | value
| ) |  |

Sets a sticker value in the specified song.

Overwrites existing values.

Throws SqliteError on error.