![]() |
Limo
A simple mod manager
|
Provides functions for accessing the NexusMods API. More...
#include <api.h>
Public Member Functions | |
Api ()=delete | |
This is an abstract class, so the constructor is deleted. | |
Static Public Member Functions | |
static void | setApiKey (const std::string &api_key) |
Sets the API key to use for all operations. | |
static bool | isInitialized () |
Checks if this class has been initialized with an API key. Does NOT check if the key works. | |
static Mod | getMod (const std::string &mod_url) |
Fetches data for the mod accessible by the given NexusMods URL. | |
static Mod | getMod (const std::string &domain_name, long mod_id) |
Fetches data for the mod specified by the NexusMods domain and mod id. | |
static void | trackMod (const std::string &mod_url) |
Tracks the mod for the NexusMods account belonging to the API key. | |
static void | untrackMod (const std::string &mod_url) |
Tracks the mod for the NexusMods account belonging to the API key. | |
static std::vector< Mod > | getTrackedMods () |
Fetches data for all mods tracked by the account belonging to the API key. | |
static std::vector< File > | getModFiles (const std::string &mod_url) |
Fetches data for all available files for the given mod. | |
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. | |
static std::string | getDownloadUrl (const std::string &nxm_url) |
Generates a download URL from the given nxm Url. | |
static std::vector< std::pair< std::string, std::vector< std::string > > > | getChangelogs (const std::string &mod_url) |
Fetches changelogs for the given mod. | |
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 correct, not if the target exists. | |
static Page | getNexusPage (const std::string &mod_url) |
Fetches data to fill a Page object for the given mod. | |
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. | |
static std::string | getNexusPageUrl (const std::string &nxm_url) |
Generates a NexusMods mod page URL from the given nxm URL. | |
static std::string | getApiKey () |
Getter for the API key. | |
Static Private Member Functions | |
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. | |
Static Private Attributes | |
static std::string | api_key_ = "" |
The API key used for all operations. | |
Provides functions for accessing the NexusMods API.
|
staticprivate |
Extracts the NexusMods domain and mod id from the given mod page URL.
url | URL to the mod on NexusMods. |
|
static |
Getter for the API key.
|
static |
Fetches changelogs for the given mod.
mod_url | URL to the mod on NexusMods. |
|
static |
Generates a download URL for the given mod file. This only works for premium accounts.
mod_url | URL to the mod on NexusMods. |
file_id | Id of the file for which a link is to be generated. |
|
static |
Generates a download URL from the given nxm Url.
nxm_url | The nxm Url used. This is usually generated through the NexusMods website. |
|
static |
Fetches data for the mod specified by the NexusMods domain and mod id.
domain_name | The NexusMods domain containing the mod. |
mod_id | Target mod id. |
|
static |
Fetches data for the mod accessible by the given NexusMods URL.
mod_url | URL to the mod on NexusMods. |
|
static |
Fetches data for all available files for the given mod.
mod_url | URL to the mod on NexusMods. |
|
static |
|
static |
Generates a NexusMods mod page URL from the given nxm URL.
nxm_url | The nxm Url used. This is usually generated through the NexusMods website. |
|
static |
Fetches data for all mods tracked by the account belonging to the API key.
|
static |
Checks if this class has been initialized with an API key. Does NOT check if the key works.
|
static |
Checks if the given URL is a valid NexusMods mod page URL. Only verifies if the URL is semantically correct, not if the target exists.
url | URL to check. |
|
static |
Sets the API key to use for all operations.
api_key | The new API key. |
|
static |
Tracks the mod for the NexusMods account belonging to the API key.
mod_url | URL to the mod on NexusMods. |
|
static |
Tracks the mod for the NexusMods account belonging to the API key.
mod_url | URL to the mod on NexusMods. |
|
static |
Checks if the NexusMods API can be accessed with the given API key.
api_key | API key to validate. |