Limo
A simple mod manager
Loading...
Searching...
No Matches
Mod Struct Reference

Stores information about an installed mod. More...

#include <mod.h>

Public Member Functions

 Mod (int id, const std::string &name, const std::string &version, const std::time_t &time, const std::filesystem::path &source_l, const std::string &source_r, const std::time_t &time_r, unsigned long size, const std::time_t &suppress_time)
 Constructor. Simply initializes members.
 
 Mod (const Json::Value &json)
 Initializes all members from a JSON object.
 
Json::Value toJson () const
 
bool operator== (const Mod &other) const
 Compares to another mod by id.
 
bool operator< (const Mod &other) const
 Compares mods by their id.
 

Public Attributes

int id
 The mod's id.
 
std::string name
 The mod's name.
 
std::string version
 The mod's version.
 
std::time_t install_time
 The mod's installation time.
 
std::filesystem::path local_source
 Path to the local archive or directory used to install this mod.
 
std::string remote_source
 URL from where the mod was downloaded.
 
std::time_t remote_update_time
 Timestamp for when the mod was updated at the remote source.
 
unsigned long size_on_disk
 Total size of the installed mod on disk.
 
std::time_t suppress_update_time
 Timestamp for when the user requested to suppress current update notifications.
 

Detailed Description

Stores information about an installed mod.

Constructor & Destructor Documentation

◆ Mod() [1/2]

Mod::Mod ( int id,
const std::string & name,
const std::string & version,
const std::time_t & time,
const std::filesystem::path & source_l,
const std::string & source_r,
const std::time_t & time_r,
unsigned long size,
const std::time_t & suppress_time )

Constructor. Simply initializes members.

Parameters
idThe mod's id.
nameThe mod's name.
versionThe mod's version.
timeThe mod's installation time.
source_lPath to the local archive or directory used to install this mod.
source_rURL from where the mod was downloaded.
time_rTimestamp for when the mod was updated at the remote source.
sizeTotal size of the installed mod on disk.
suppress_timeTimestamp for when the user requested to suppress current update notifications.

◆ Mod() [2/2]

Mod::Mod ( const Json::Value & json)

Initializes all members from a JSON object.

Parameters
jsonThe source for member values.

Member Function Documentation

◆ operator<()

bool Mod::operator< ( const Mod & other) const

Compares mods by their id.

Parameters
Othermod for comparison.
Returns
True only if this.id < other.id

◆ operator==()

bool Mod::operator== ( const Mod & other) const

Compares to another mod by id.

Parameters
otherMod to compare to.
Returns
True if both share the same id, else false.

The documentation for this struct was generated from the following files: