This is the documentation for libmusicbrainz5, a library for retrieving data from the MusicBrainz service.
This package provides a pkg-config script that returns the necessary compiler and linker flags, as well as the version number. To build a small sample program one would use:
If you don't want/can't use pkg-config and you are using the C API, make sure you link in the C++ standard library:
try
{
{
std::cout <<
"Found " << ReleaseList->
NumItems() <<
" release(s)" << std::endl;
for (
int count=0;count<ReleaseList->
NumItems();count++)
{
std::cout << "Basic release: " << std::endl << *Release << std::endl;
Params["inc"]="artists labels recordings release-groups url-rels discids artist-credits";
Metadata=Query.Query(
"release",Release.
ID(),
"",Params);
{
std::cout << *FullRelease << std::endl;
}
}
}
}
{
std::cout <<
"Connection Exception: '" << Error.
what() <<
"'" << std::endl;
std::cout << "LastResult: " << Query.LastResult() << std::endl;
std::cout << "LastHTTPCode: " << Query.LastHTTPCode() << std::endl;
std::cout << "LastErrorMessage: " << Query.LastErrorMessage() << std::endl;
}
{
std::cout <<
"Timeout Exception: '" << Error.
what() <<
"'" << std::endl;
std::cout << "LastResult: " << Query.LastResult() << std::endl;
std::cout << "LastHTTPCode: " << Query.LastHTTPCode() << std::endl;
std::cout << "LastErrorMessage: " << Query.LastErrorMessage() << std::endl;
}
{
std::cout <<
"Authentication Exception: '" << Error.
what() <<
"'" << std::endl;
std::cout << "LastResult: " << Query.LastResult() << std::endl;
std::cout << "LastHTTPCode: " << Query.LastHTTPCode() << std::endl;
std::cout << "LastErrorMessage: " << Query.LastErrorMessage() << std::endl;
}
{
std::cout <<
"Fetch Exception: '" << Error.
what() <<
"'" << std::endl;
std::cout << "LastResult: " << Query.LastResult() << std::endl;
std::cout << "LastHTTPCode: " << Query.LastHTTPCode() << std::endl;
std::cout << "LastErrorMessage: " << Query.LastErrorMessage() << std::endl;
}
{
std::cout <<
"Request Exception: '" << Error.
what() <<
"'" << std::endl;
std::cout << "LastResult: " << Query.LastResult() << std::endl;
std::cout << "LastHTTPCode: " << Query.LastHTTPCode() << std::endl;
std::cout << "LastErrorMessage: " << Query.LastErrorMessage() << std::endl;
}
{
std::cout <<
"ResourceNotFound Exception: '" << Error.
what() <<
"'" << std::endl;
std::cout << "LastResult: " << Query.LastResult() << std::endl;
std::cout << "LastHTTPCode: " << Query.LastHTTPCode() << std::endl;
std::cout << "LastErrorMessage: " << Query.LastErrorMessage() << std::endl;
}
Exception thrown when an authentication error occurs.
Definition: HTTPFetch.h:90
Exception thrown when an error occurs connecting to web service.
Definition: HTTPFetch.h:64
CReleaseList * ReleaseList() const
virtual const char * what() const
Definition: HTTPFetch.h:48
Exception thrown when an error occurs fetching data.
Definition: HTTPFetch.h:103
Definition: ListImpl.h:35
T * Item(int Item) const
Definition: ListImpl.h:94
Main object for generating queries to MusicBrainz.
Definition: Query.h:186
std::map< std::string, std::string > tParamMap
Definition: Query.h:188
Exception thrown when an invalid request is made.
Definition: HTTPFetch.h:116
Exception thrown when the requested resource is not found.
Definition: HTTPFetch.h:129
Exception thrown when a connection to the web service times out.
Definition: HTTPFetch.h:77