libmusicbrainz3  3.0.2
MusicBrainz::User Class Reference

Represents a MusicBrainz user. More...

Public Member Functions

 User ()
 Constructor. More...
 
virtual ~User ()
 Destructor. More...
 
std::string getName () const
 Returns the user name. More...
 
void setName (const std::string &name)
 Sets the user name. More...
 
std::vector< std::string > & getTypes ()
 Returns the types of this user. More...
 
int getNumTypes () const
 Returns number of types. More...
 
std::string getType (int index) const
 Returns an type specified by index. More...
 
void addType (const std::string &type)
 Add a type to the list of types. More...
 
bool getShowNag () const
 Returns true if a nag screen should be displayed to the user. More...
 
void setShowNag (bool value)
 Sets the value of the nag screen flag. More...
 

Detailed Description

Represents a MusicBrainz user.

Constructor & Destructor Documentation

◆ User()

MusicBrainz::User::User ( )

Constructor.

◆ ~User()

virtual MusicBrainz::User::~User ( )
virtual

Destructor.

Member Function Documentation

◆ addType()

void MusicBrainz::User::addType ( const std::string &  type)

Add a type to the list of types.

Parameters
typea string containing absolute URIs
See also
getTypes

◆ getName()

std::string MusicBrainz::User::getName ( ) const

Returns the user name.

Returns
a string containing the user name

◆ getNumTypes()

int MusicBrainz::User::getNumTypes ( ) const

Returns number of types.

This is equivalent to getTypes().size()

Returns
an int containing number of types
See also
getTypes

◆ getShowNag()

bool MusicBrainz::User::getShowNag ( ) const

Returns true if a nag screen should be displayed to the user.

Returns
true or false

◆ getType()

std::string MusicBrainz::User::getType ( int  index) const

Returns an type specified by index.

This is equivalent to getTypes()[index]

Returns
a string containing the type
See also
getTypes

◆ getTypes()

std::vector<std::string>& MusicBrainz::User::getTypes ( )

Returns the types of this user.

Most users' type list is empty. Currently, the following types are defined:

  • "http://musicbrainz.org/ns/ext-1.0#AutoEditor"
  • "http://musicbrainz.org/ns/ext-1.0#RelationshipEditor"
  • "http://musicbrainz.org/ns/ext-1.0#Bot"
  • "http://musicbrainz.org/ns/ext-1.0#NotNaggable"
Returns
a vector of strings containing absolute URIs

◆ setName()

void MusicBrainz::User::setName ( const std::string &  name)

Sets the user name.

Parameters
namea string containing the user name

◆ setShowNag()

void MusicBrainz::User::setShowNag ( bool  value)

Sets the value of the nag screen flag.

Parameters
valuetrue or false
See also
getShowNag