Limo
A simple mod manager
Loading...
Searching...
No Matches
mod.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <filesystem>
9#include <json/json.h>
10#include <string>
11
12
16struct Mod
17{
19 int id;
21 std::string name;
23 std::string version;
25 std::time_t install_time;
27 std::filesystem::path local_source;
29 std::string remote_source;
31 std::time_t remote_update_time;
33 unsigned long size_on_disk;
36
50 Mod(int id,
51 const std::string& name,
52 const std::string& version,
53 const std::time_t& time,
54 const std::filesystem::path& source_l,
55 const std::string& source_r,
56 const std::time_t& time_r,
57 unsigned long size,
58 const std::time_t& suppress_time);
63 Mod(const Json::Value& json);
64
65 Json::Value toJson() const;
71 bool operator==(const Mod& other) const;
77 bool operator<(const Mod& other) const;
78};
bool operator<(const Mod &other) const
Compares mods by their id.
Definition mod.cpp:50
std::string remote_source
URL from where the mod was downloaded.
Definition mod.h:29
bool operator==(const Mod &other) const
Compares to another mod by id.
Definition mod.cpp:45
int id
The mod's id.
Definition mod.h:19
std::time_t install_time
The mod's installation time.
Definition mod.h:25
std::string version
The mod's version.
Definition mod.h:23
std::string name
The mod's name.
Definition mod.h:21
std::filesystem::path local_source
Path to the local archive or directory used to install this mod.
Definition mod.h:27
unsigned long size_on_disk
Total size of the installed mod on disk.
Definition mod.h:33
std::time_t remote_update_time
Timestamp for when the mod was updated at the remote source.
Definition mod.h:31
std::time_t suppress_update_time
Timestamp for when the user requested to suppress current update notifications.
Definition mod.h:35
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.
Definition mod.cpp:3