Tag Parser 11.3.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TagParser::Popularity Struct Reference

#include <tagvalue.h>

Collaboration diagram for TagParser::Popularity:
[legend]

Public Member Functions

std::string toString () const
 Returns the popularity as string in the format "rating" if only a rating is present or in the format "user|rating|play-counter" or an empty string if the popularity isEmpty(). More...
 
bool isEmpty () const
 Returns whether the Popularity is empty. The scale and zero-values don't count. More...
 
bool operator== (const Popularity &other) const
 Returns whether two instances are equal. More...
 

Static Public Member Functions

static Popularity fromString (std::string_view str)
 Parses the popularity from str assuming the same format as toString() produces. More...
 

Public Attributes

std::string user
 The user who gave the rating / played the file, e.g. identified by e-mail address. More...
 
double rating = 0.0
 The rating on a tag type specific scale. More...
 
std::uint64_t playCounter = 0
 Play counter specific to the user. More...
 
TagType scale = TagType::Unspecified
 Specifies the scale used for rating by the tag defining that scale. More...
 

Detailed Description

Definition at line 72 of file tagvalue.h.

Member Function Documentation

◆ fromString()

Popularity TagParser::Popularity::fromString ( std::string_view  str)
static

Parses the popularity from str assuming the same format as toString() produces.

Exceptions
ThrowsConversionException() if the format is invalid.

Definition at line 1198 of file tagvalue.cpp.

◆ isEmpty()

bool TagParser::Popularity::isEmpty ( ) const
inline

Returns whether the Popularity is empty. The scale and zero-values don't count.

Definition at line 89 of file tagvalue.h.

◆ operator==()

bool TagParser::Popularity::operator== ( const Popularity other) const
inline

Returns whether two instances are equal.

Remarks
Currently they must match exactly but in the future conversions between different scales might be implemented and two instances would be considered equal if the ratings are considered equal (even specified using different scales).

Definition at line 98 of file tagvalue.h.

◆ toString()

std::string TagParser::Popularity::toString ( ) const

Returns the popularity as string in the format "rating" if only a rating is present or in the format "user|rating|play-counter" or an empty string if the popularity isEmpty().

Definition at line 1188 of file tagvalue.cpp.

Member Data Documentation

◆ playCounter

std::uint64_t TagParser::Popularity::playCounter = 0

Play counter specific to the user.

Definition at line 78 of file tagvalue.h.

◆ rating

double TagParser::Popularity::rating = 0.0

The rating on a tag type specific scale.

Definition at line 76 of file tagvalue.h.

◆ scale

TagType TagParser::Popularity::scale = TagType::Unspecified

Specifies the scale used for rating by the tag defining that scale.

Remarks
The value TagType::Unspecified is preserved to denote a generic scale is used (no conversions to/from a generic scale to tag format specific scales have been implemented at this point).

Definition at line 83 of file tagvalue.h.

◆ user

std::string TagParser::Popularity::user

The user who gave the rating / played the file, e.g. identified by e-mail address.

Definition at line 74 of file tagvalue.h.


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