Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
Ahmed Castro edited this page Aug 29, 2018 · 21 revisions

getModTags

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.

Function parameters

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.

Callback parameters

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.

Example

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
  }
});

addModTags

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.

Function parameters

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.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

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
  }
});

deleteModTags

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.

Function parameters

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.

Callback parameters

Name Type Description
response const modio::Response& modio::Response object that contains the mod.io response status.

Example

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
  }
});

Contents

Clone this wiki locally