4#include "gearLoader_c.h"
9 return a.major == b.major &&
11 a.patchNum == b.patchNum;
14 return a.major > b.major ||
15 (a.major == b.major && a.minor > b.minor) ||
16 (a.major == b.major && a.minor == b.minor && a.patchNum > b.patchNum);
25 DEBUG = GEARLOADER_LOG_LEVEL_DEBUG,
26 INFO = GEARLOADER_LOG_LEVEL_INFO,
27 WARN = GEARLOADER_LOG_LEVEL_WARN,
28 ERR = GEARLOADER_LOG_LEVEL_ERR,
29 VERBOSE = GEARLOADER_LOG_LEVEL_VERBOSE
39 Api(
GearLoaderApi* c_api, GearLoaderContext* ctx) : base(c_api), _ctx(ctx) { }
45 return (GEARLOADER_VERSION_NUM & 0xFF0000) != (base->version & 0xFF0000);
61 template<
typename ApiType>
63 std::string versionConstraint,
69 int result = base->RetrieveModApi(
72 versionConstraint.c_str(),
76 *pApi =
reinterpret_cast<const ApiType*
>(retApi);
98 return base->RegisterApi(_ctx, api, name.c_str(), version);
109 int Log(LogLevel logLevel, std::string str) {
111 return base->Log(_ctx,
static_cast<uint32_t
>(logLevel), str.c_str());
115 GearLoaderContext* _ctx;
int RetrieveModApi(std::string name, std::string versionConstraint, const ApiType **pApi, SemanticVersion *retrievedVersion)
Retrieves an exported API of another loaded mod.
Definition gearLoader.hpp:62
bool VersionError()
Definition gearLoader.hpp:44
int RegisterApi(const void *api, std::string name, SemanticVersion version)
Registers an API with the mod loader.
Definition gearLoader.hpp:94
int Log(LogLevel logLevel, std::string str)
Logs the given string to the GearLoader.log file.
Definition gearLoader.hpp:109
Definition gearLoader_c.h:50
Definition gearLoader_c.h:21