29 std::vector<std::pair<std::string, std::vector<std::string>>>
changelog;
47 static void setApiKey(
const std::string& api_key);
59 static Mod getMod(
const std::string& mod_url);
66 static Mod getMod(
const std::string& domain_name,
long mod_id);
71 static void trackMod(
const std::string& mod_url);
76 static void untrackMod(
const std::string& mod_url);
87 static std::vector<File>
getModFiles(
const std::string& mod_url);
94 static std::string
getDownloadUrl(
const std::string& mod_url,
long file_id);
106 static std::vector<std::pair<std::string, std::vector<std::string>>>
getChangelogs(
107 const std::string& mod_url);
127 static std::optional<std::pair<std::string, bool>>
validateKey(
const std::string& api_key);
150 const std::string& mod_url);
static std::string getNexusPageUrl(const std::string &nxm_url)
Generates a NexusMods mod page URL from the given nxm URL.
Definition api.cpp:313
static void trackMod(const std::string &mod_url)
Tracks the mod for the NexusMods account belonging to the API key.
Definition api.cpp:43
static bool modUrlIsValid(const std::string &url)
Checks if the given URL is a valid NexusMods mod page URL. Only verifies if the URL is semantically c...
Definition api.cpp:284
static std::optional< std::pair< std::string, bool > > validateKey(const std::string &api_key)
Checks if the NexusMods API can be accessed with the given API key.
Definition api.cpp:297
static std::string getDownloadUrl(const std::string &mod_url, long file_id)
Generates a download URL for the given mod file. This only works for premium accounts.
Definition api.cpp:117
static Mod getMod(const std::string &mod_url)
Fetches data for the mod accessible by the given NexusMods URL.
Definition api.cpp:21
static std::string getApiKey()
Getter for the API key.
Definition api.cpp:322
static std::optional< std::pair< std::string, int > > extractDomainAndModId(const std::string &mod_url)
Extracts the NexusMods domain and mod id from the given mod page URL.
Definition api.cpp:327
static std::string api_key_
The API key used for all operations.
Definition api.h:142
static void setApiKey(const std::string &api_key)
Sets the API key to use for all operations.
Definition api.cpp:11
static std::vector< std::pair< std::string, std::vector< std::string > > > getChangelogs(const std::string &mod_url)
Fetches changelogs for the given mod.
Definition api.cpp:203
static bool isInitialized()
Checks if this class has been initialized with an API key. Does NOT check if the key works.
Definition api.cpp:16
static std::vector< File > getModFiles(const std::string &mod_url)
Fetches data for all available files for the given mod.
Definition api.cpp:88
static void untrackMod(const std::string &mod_url)
Tracks the mod for the NexusMods account belonging to the API key.
Definition api.cpp:55
Api()=delete
This is an abstract class, so the constructor is deleted.
static std::vector< Mod > getTrackedMods()
Fetches data for all mods tracked by the account belonging to the API key.
Definition api.cpp:67
static Page getNexusPage(const std::string &mod_url)
Fetches data to fill a Page object for the given mod.
Definition api.cpp:292
Contains data for a mod on NexusMods.
Definition mod.h:22
The nexus namespace contains structs and functions needed for accessing the NexusMods API.
Definition api.h:18
Header for the nexus::File class.
Header for the nexus::Mod class.
Contains all data for a mod available through the NexusMods api.
Definition api.h:23
Mod mod
Contains an overview of of the mod page, like a description and summary.
Definition api.h:27
std::vector< std::pair< std::string, std::vector< std::string > > > changelog
For every Version of the mod: A vector of changes in that version.
Definition api.h:29
std::string url
URL of the mod page on NexusMods.
Definition api.h:25
std::vector< File > files
Contains data on all available files for the mod.
Definition api.h:31