Tags - modio/modio-sdk-legacy GitHub Wiki
void Instance::getModTags(u32 mod_id, const std::function<void(const modio::Response& response, std::vector<modio::Tag> tags)>& callback)
API endpoint used: Get Mod Tags
Returns all the tags corresponding a mod.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
callback | const std::function<void(const modio::Response& response, std::vector<modio::Tag> tags)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
tags_array | std::vector<modio::Tag> |
Vector containing the modio::Tag objects returned. |
modio_instance.getTags(requested_mod.id, [&](const modio::Response& response, std::vector<modio::Tag> tags)
{
if(response.code == 200)
{
//The tags can be browsed on the tags_array
}
});
void Instance::addModTags(u32 mod_id, std::vector<std::string> tags, const std::function<void(const modio::Response& response)>& callback)
API endpoint used: Add Mod Tag
Adds one or more tags to a mod. Tags are supplied as a char* array.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
tags | std::vector<std::string> |
Vector containing the tags to be added. |
callback | const std::function<void(const modio::Response& response, u32 mod_id)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
std::vector<std::string> tags;
tags.push_back("Easy");
modio_instance.addModTags(requested_mod.id, tags, [&](const modio::Response& response)
{
if(response.code == 204)
{
//Tags successfully added
}
});
void Instance::deleteModTags(u32 mod_id, std::vector<std::string> tags, const std::function<void(const modio::Response& response)>& callback)
API endpoint used: Delete Mod Tag
Deletes one or more tags to a mod. Tags are supplied as a char* array.
Name | Type | Description |
---|---|---|
mod_id | u32 |
Mod's unique identifier. |
tags | std::vector<std::string> |
Vector containing the tags to be deleted. |
callback | const std::function<void(const modio::Response& response, u32 mod_id)>& |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response | const modio::Response& |
modio::Response object that contains the mod.io response status. |
std::vector<std::string> tags;
tags.push_back("Easy");
modio_instance.deleteModTags(requested_mod.id, tags, [&](const modio::Response& response)
{
if(response.code == 204)
{
//Tags successfully deleted
}
});