Limo
A simple mod manager
Loading...
Searching...
No Matches
Bg3Plugin Class Reference

Parses and represents data from a meta.lsx file for a Baldurs Gate 3 plugin. More...

#include <bg3plugin.h>

Public Member Functions

 Bg3Plugin (const std::string &xml_string)
 Initializes this object from the given xml string.
 
std::string getUuid () const
 Getter for the plugin UUID.
 
std::string getVersion () const
 Getter for the plugin version.
 
std::string getDirectory () const
 Getter for the plugin directory.
 
std::string getName () const
 Getter for the plugin name.
 
std::string getDescription () const
 Getter for the plugin description.
 
std::vector< std::pair< std::string, std::string > > getDependencies () const
 Getter for the plugin's dependencies.
 
bool hasDependency (const std::string &uuid)
 Checks if this plugin depends on the plugin with the given UUID.
 
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.
 
std::string getXmlString () const
 Getter for the plugins xml representation.
 
std::string toXmlPluginString () const
 Constructs an xml string for use in the Mods section of the modsettings.lsx file.
 
std::string toXmlLoadorderString () const
 Constructs an xml string for use in the ModOrder section of the modsettings.lsx file.
 
void addToXmlModsNode (pugi::xml_node &root) const
 Adds this plugin to the given Mods xml node in modsettings.lsx.
 
void addToXmlOrderNode (pugi::xml_node &root) const
 Adds this plugin to the given ModOrder xml node in modsettings.lsx.
 

Static Public Member Functions

static bool isValidPlugin (const std::string &xml_string)
 Checks if the given xml string contains a valid plugin that is not the GustavDev plugin.
 

Static Public Attributes

static constexpr char BG3_VANILLA_MOD_UUID [] = "28ac9ce2-2aba-8cda-b3b5-6e922f71b6b8"
 UUID of the GustavDev plugin.
 

Private Attributes

std::string xml_string_
 Xml representation of this plugin.
 
std::string uuid_
 UUID of this plugin.
 
std::string version_
 Name of this plugin.
 
std::string directory_
 Subdirectory of this plugin.
 
std::string name_
 Name of this plugin.
 
std::string description_
 Description of this plugin.
 
std::vector< std::pair< std::string, std::string > > dependencies_
 For every plugin dependency: A pair of its UUID and name.
 

Detailed Description

Parses and represents data from a meta.lsx file for a Baldurs Gate 3 plugin.

Constructor & Destructor Documentation

◆ Bg3Plugin()

Bg3Plugin::Bg3Plugin ( const std::string & xml_string)

Initializes this object from the given xml string.

Parameters
xml_stringSource xml string.

Member Function Documentation

◆ addToXmlModsNode()

void Bg3Plugin::addToXmlModsNode ( pugi::xml_node & root) const

Adds this plugin to the given Mods xml node in modsettings.lsx.

Parameters
rootXml node to which to add this plugin.

◆ addToXmlOrderNode()

void Bg3Plugin::addToXmlOrderNode ( pugi::xml_node & root) const

Adds this plugin to the given ModOrder xml node in modsettings.lsx.

Parameters
rootXml node to which to add this plugin.

◆ getDependencies()

std::vector< std::pair< std::string, std::string > > Bg3Plugin::getDependencies ( ) const

Getter for the plugin's dependencies.

Returns
for every dependency: A pair of UUID and name.

◆ getDescription()

std::string Bg3Plugin::getDescription ( ) const

Getter for the plugin description.

Returns
The description.

◆ getDirectory()

std::string Bg3Plugin::getDirectory ( ) const

Getter for the plugin directory.

Returns
The directory.

◆ getMissingDependencies()

std::vector< std::pair< std::string, std::string > > Bg3Plugin::getMissingDependencies ( const std::set< std::string > & plugin_uuids)

Compares this plugin's dependencies with the given plugin UUIDs.

Parameters
plugin_uuidsUUIDs to check.
Returns
For every dependency of this not in the given plugin UUIDs: A pair of UUID and name of that dependency.

◆ getName()

std::string Bg3Plugin::getName ( ) const

Getter for the plugin name.

Returns
The name.

◆ getUuid()

std::string Bg3Plugin::getUuid ( ) const

Getter for the plugin UUID.

Returns
The UUID.

◆ getVersion()

std::string Bg3Plugin::getVersion ( ) const

Getter for the plugin version.

Returns
The version.

◆ getXmlString()

std::string Bg3Plugin::getXmlString ( ) const

Getter for the plugins xml representation.

Returns
The xml string.

◆ hasDependency()

bool Bg3Plugin::hasDependency ( const std::string & uuid)

Checks if this plugin depends on the plugin with the given UUID.

Parameters
uuidUUID to check.
Returns
True if dependency exists.

◆ isValidPlugin()

bool Bg3Plugin::isValidPlugin ( const std::string & xml_string)
static

Checks if the given xml string contains a valid plugin that is not the GustavDev plugin.

Parameters
xml_stringXml string to check.
Returns
True if the xml string contains a valid plugin.

◆ toXmlLoadorderString()

std::string Bg3Plugin::toXmlLoadorderString ( ) const

Constructs an xml string for use in the ModOrder section of the modsettings.lsx file.

Returns
The xml string.

◆ toXmlPluginString()

std::string Bg3Plugin::toXmlPluginString ( ) const

Constructs an xml string for use in the Mods section of the modsettings.lsx file.

Returns
The xml string.

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