Parses and represents plugin data contained in a .pak file used in Baldurs Gate 3.
More...
#include <bg3pakfile.h>
|
| Bg3PakFile ()=default |
| Default constructor.
|
|
| Bg3PakFile (const std::filesystem::path &source_file, const std::filesystem::path &prefix) |
| Reads all plugins from the given .pak file.
|
|
| Bg3PakFile (const Json::Value &json_value, const std::filesystem::path &prefix) |
| Deserializes data from the given json object.
|
|
const std::vector< Bg3Plugin > & | getPlugins () const |
| Returns a vector of plugins contained in this pak file.
|
|
Json::Value | toJson () const |
| Serializes this object.
|
|
std::filesystem::path | getSourceFile () const |
| Returns the path to this object's source file.
|
|
bool | timestampsMatch () |
| Checks if this file's timestamp matches the modification time on disk.
|
|
std::string | getPluginName (const std::string &uuid) const |
| Returns the name of the plugin matching the given UUID.
|
|
bool | hasPlugin (const std::string &uuid) const |
| Checks whether a plugin with the given UUID exists.
|
|
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.
|
|
bool | conflictsWith (const Bg3PakFile &other) |
| Checks whether the any files conflcits with the given pak archive.
|
|
|
void | init () |
| Initializes this object from the source file.
|
|
std::time_t | getTimestamp (const std::filesystem::path &file) |
| Reads the file modification time from the given file.
|
|
|
std::vector< Bg3Plugin > | plugins_ |
| Contains all plugins in the source file.
|
|
std::filesystem::path | source_file_ |
| Path to the source file.
|
|
std::time_t | modified_time_ |
| Time at which the source file was modified.
|
|
std::vector< std::filesystem::path > | file_list_ |
| Contains paths to files in the source file.
|
|
std::filesystem::path | source_path_prefix_ |
| Prefix for the source file path.
|
|
Parses and represents plugin data contained in a .pak file used in Baldurs Gate 3.
◆ Bg3PakFile() [1/2]
Bg3PakFile::Bg3PakFile |
( |
const std::filesystem::path & | source_file, |
|
|
const std::filesystem::path & | prefix ) |
Reads all plugins from the given .pak file.
- Parameters
-
source_file | Source .pak file. |
◆ Bg3PakFile() [2/2]
Bg3PakFile::Bg3PakFile |
( |
const Json::Value & | json_value, |
|
|
const std::filesystem::path & | prefix ) |
Deserializes data from the given json object.
- Parameters
-
json_value | source json object. |
◆ conflictsWith()
bool Bg3PakFile::conflictsWith |
( |
const Bg3PakFile & | other | ) |
|
Checks whether the any files conflcits with the given pak archive.
- Parameters
-
- Returns
- True if a conflict exists.
◆ getPluginName()
std::string Bg3PakFile::getPluginName |
( |
const std::string & | uuid | ) |
const |
Returns the name of the plugin matching the given UUID.
- Parameters
-
- Returns
- The name, or an empty string of the UUID could not be matched.
◆ getPlugins()
const std::vector< Bg3Plugin > & Bg3PakFile::getPlugins |
( |
| ) |
const |
Returns a vector of plugins contained in this pak file.
- Returns
- The vector.
◆ getSourceFile()
std::filesystem::path Bg3PakFile::getSourceFile |
( |
| ) |
const |
Returns the path to this object's source file.
- Returns
- The path.
◆ hasPlugin()
bool Bg3PakFile::hasPlugin |
( |
const std::string & | uuid | ) |
const |
Checks whether a plugin with the given UUID exists.
- Parameters
-
- Returns
- True if a plugin exists.
◆ pluginConflictsWith()
bool Bg3PakFile::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.
- Parameters
-
plugin_uuid | Plugin UUID in this file to check. |
other_file | Other file containing other_plugin. |
other_plugin_uuid | Plugin UUID in other_file. |
- Returns
- True if a conflict exists.
◆ timestampsMatch()
bool Bg3PakFile::timestampsMatch |
( |
| ) |
|
Checks if this file's timestamp matches the modification time on disk.
- Returns
- True of the times match.
◆ toJson()
Json::Value Bg3PakFile::toJson |
( |
| ) |
const |
Serializes this object.
- Returns
- Json object containing serialized data.
The documentation for this class was generated from the following files: