![]() |
Limo
A simple mod manager
|
Represents a fomod dependency tree node. More...
#include <dependency.h>
Public Member Functions | |
Dependency (pugi::xml_node source) | |
Recursively builds a dependency tree from given fomod node. | |
Dependency () | |
Constructs a dummy node. | |
bool | evaluate (const std::filesystem::path &target_path, const std::map< std::string, std::string > &flags, std::function< bool(std::string)> eval_game_version, std::function< bool(std::string)> eval_fomm_version=[](auto s) { return true;}) const |
Checks given flags, files, game version and fomm version fulfill the condition represented by this tree. | |
std::string | toString () const |
Private Types | |
enum | Type { dummy_node , and_node , or_node , file_leaf , flag_leaf , game_version_leaf , fomm_version_leaf } |
Represents different dependency types. More... | |
Private Attributes | |
Type | type_ |
Type of this dependency. | |
std::string | target_ |
Value for comparison, e.g. file path for a file dependency. | |
std::string | state_ = "" |
State of file or flag. | |
std::vector< Dependency > | children_ |
Children of this node. | |
Represents a fomod dependency tree node.
|
private |
Represents different dependency types.
Enumerator | |
---|---|
dummy_node | Always evaluates to true. |
and_node | True if all children evaluate to true. |
or_node | True if at least one child evaluates to true. |
file_leaf | File must exist. |
flag_leaf | Flag must be set. |
game_version_leaf | Game version must be == some version. |
fomm_version_leaf | Fomm version must be == some version. |
Dependency::Dependency | ( | pugi::xml_node | source | ) |
Recursively builds a dependency tree from given fomod node.
source | Source fomod node. |
bool Dependency::evaluate | ( | const std::filesystem::path & | target_path, |
const std::map< std::string, std::string > & | flags, | ||
std::function< bool(std::string)> | eval_game_version, | ||
std::function< bool(std::string)> | eval_fomm_version = [](auto s) { return true; } ) const |
Checks given flags, files, game version and fomm version fulfill the condition represented by this tree.
target_path | Path to target files. |
flags | Flags to be checked. |
eval_game_version | Used to check if this nodes game version is valid. |
eval_fomm_version | Used to check if this nodes fomm version is valid. |