25 Bg3PakFile(
const std::filesystem::path& source_file,
const std::filesystem::path& prefix);
30 Bg3PakFile(
const Json::Value& json_value,
const std::filesystem::path& prefix);
36 const std::vector<Bg3Plugin>&
getPlugins()
const;
41 Json::Value
toJson()
const;
63 bool hasPlugin(
const std::string& uuid)
const;
73 const std::string& other_plugin_uuid);
96 std::time_t
getTimestamp(
const std::filesystem::path& file);
Header for the Bg3Plugin class.
Bg3PakFile(const std::filesystem::path &source_file, const std::filesystem::path &prefix)
Reads all plugins from the given .pak file.
std::string getPluginName(const std::string &uuid) const
Returns the name of the plugin matching the given UUID.
Definition bg3pakfile.cpp:63
bool pluginConflictsWith(const std::string &plugin_uuid, const Bg3PakFile &other_file, const std::string &other_plugin_uuid)
Checks whether the given plugin conflicts with the given plugin in the given file.
Definition bg3pakfile.cpp:76
Bg3PakFile(const Json::Value &json_value, const std::filesystem::path &prefix)
Deserializes data from the given json object.
std::filesystem::path source_file_
Path to the source file.
Definition bg3pakfile.h:85
Json::Value toJson() const
Serializes this object.
Definition bg3pakfile.cpp:41
const std::vector< Bg3Plugin > & getPlugins() const
Returns a vector of plugins contained in this pak file.
Definition bg3pakfile.cpp:36
Bg3PakFile()=default
Default constructor.
std::filesystem::path getSourceFile() const
Returns the path to this object's source file.
Definition bg3pakfile.cpp:53
std::filesystem::path source_path_prefix_
Prefix for the source file path.
Definition bg3pakfile.h:91
bool conflictsWith(const Bg3PakFile &other)
Checks whether the any files conflcits with the given pak archive.
Definition bg3pakfile.cpp:118
std::time_t modified_time_
Time at which the source file was modified.
Definition bg3pakfile.h:87
bool hasPlugin(const std::string &uuid) const
Checks whether a plugin with the given UUID exists.
Definition bg3pakfile.cpp:71
std::time_t getTimestamp(const std::filesystem::path &file)
Reads the file modification time from the given file.
Definition bg3pakfile.cpp:128
std::vector< Bg3Plugin > plugins_
Contains all plugins in the source file.
Definition bg3pakfile.h:83
bool timestampsMatch()
Checks if this file's timestamp matches the modification time on disk.
Definition bg3pakfile.cpp:58
void init()
Initializes this object from the source file.
Definition bg3pakfile.cpp:134
std::vector< std::filesystem::path > file_list_
Contains paths to files in the source file.
Definition bg3pakfile.h:89