Limo
A simple mod manager
Loading...
Searching...
No Matches
bg3plugin.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <pugixml.hpp>
9#include <set>
10#include <string>
11#include <vector>
12
13
18{
19public:
24 Bg3Plugin(const std::string& xml_string);
25
30 std::string getUuid() const;
35 std::string getVersion() const;
40 std::string getDirectory() const;
45 std::string getName() const;
50 std::string getDescription() const;
55 std::vector<std::pair<std::string, std::string>> getDependencies() const;
61 bool hasDependency(const std::string& uuid);
68 std::vector<std::pair<std::string, std::string>> getMissingDependencies(
69 const std::set<std::string>& plugin_uuids);
74 std::string getXmlString() const;
79 std::string toXmlPluginString() const;
84 std::string toXmlLoadorderString() const;
89 void addToXmlModsNode(pugi::xml_node& root) const;
94 void addToXmlOrderNode(pugi::xml_node& root) const;
100 static bool isValidPlugin(const std::string& xml_string);
101
103 static constexpr char BG3_VANILLA_MOD_UUID[] = "28ac9ce2-2aba-8cda-b3b5-6e922f71b6b8";
104
105private:
107 std::string xml_string_;
109 std::string uuid_;
111 std::string version_;
113 std::string directory_;
115 std::string name_;
117 std::string description_;
119 std::vector<std::pair<std::string, std::string>> dependencies_;
120};
bool hasDependency(const std::string &uuid)
Checks if this plugin depends on the plugin with the given UUID.
Definition bg3plugin.cpp:76
void addToXmlOrderNode(pugi::xml_node &root) const
Adds this plugin to the given ModOrder xml node in modsettings.lsx.
Definition bg3plugin.cpp:145
std::string uuid_
UUID of this plugin.
Definition bg3plugin.h:109
std::string getName() const
Getter for the plugin name.
Definition bg3plugin.cpp:61
std::string description_
Description of this plugin.
Definition bg3plugin.h:117
std::string getVersion() const
Getter for the plugin version.
Definition bg3plugin.cpp:51
std::vector< std::pair< std::string, std::string > > getMissingDependencies(const std::set< std::string > &plugin_uuids)
Compares this plugin's dependencies with the given plugin UUIDs.
Definition bg3plugin.cpp:81
std::string toXmlLoadorderString() const
Constructs an xml string for use in the ModOrder section of the modsettings.lsx file.
Definition bg3plugin.cpp:108
std::string name_
Name of this plugin.
Definition bg3plugin.h:115
std::string getUuid() const
Getter for the plugin UUID.
Definition bg3plugin.cpp:46
std::string directory_
Subdirectory of this plugin.
Definition bg3plugin.h:113
std::string version_
Name of this plugin.
Definition bg3plugin.h:111
std::string getXmlString() const
Getter for the plugins xml representation.
Definition bg3plugin.cpp:93
std::vector< std::pair< std::string, std::string > > getDependencies() const
Getter for the plugin's dependencies.
Definition bg3plugin.cpp:71
static constexpr char BG3_VANILLA_MOD_UUID[]
UUID of the GustavDev plugin.
Definition bg3plugin.h:103
std::string toXmlPluginString() const
Constructs an xml string for use in the Mods section of the modsettings.lsx file.
Definition bg3plugin.cpp:98
std::vector< std::pair< std::string, std::string > > dependencies_
For every plugin dependency: A pair of its UUID and name.
Definition bg3plugin.h:119
std::string xml_string_
Xml representation of this plugin.
Definition bg3plugin.h:107
std::string getDirectory() const
Getter for the plugin directory.
Definition bg3plugin.cpp:56
void addToXmlModsNode(pugi::xml_node &root) const
Adds this plugin to the given Mods xml node in modsettings.lsx.
Definition bg3plugin.cpp:114
std::string getDescription() const
Getter for the plugin description.
Definition bg3plugin.cpp:66
static bool isValidPlugin(const std::string &xml_string)
Checks if the given xml string contains a valid plugin that is not the GustavDev plugin.
Definition bg3plugin.cpp:156
Bg3Plugin(const std::string &xml_string)
Initializes this object from the given xml string.
Definition bg3plugin.cpp:7