+// Retrieves depends, optdepends, is_modpack and modpack_content
+void parseModContents(ModSpec &mod);
+
+std::map<std::string,ModSpec> getModsInPath(std::string path, bool part_of_modpack = false);
+
+// If failed, returned modspec has name==""
+ModSpec findCommonMod(const std::string &modname);
+
+// expands modpack contents, but does not replace them.
+std::map<std::string, ModSpec> flattenModTree(std::map<std::string, ModSpec> mods);
+
+// replaces modpack Modspecs with their content
+std::vector<ModSpec> flattenMods(std::map<std::string,ModSpec> mods);
+
+// a ModConfiguration is a subset of installed mods, expected to have
+// all dependencies fullfilled, so it can be used as a list of mods to
+// load when the game starts.
+class ModConfiguration
+{
+public:
+ ModConfiguration():
+ m_unsatisfied_mods(),
+ m_sorted_mods(),
+ m_name_conflicts()
+ {}
+
+
+ ModConfiguration(std::string worldpath);
+
+ // checks if all dependencies are fullfilled.
+ bool isConsistent()
+ {
+ return m_unsatisfied_mods.empty();
+ }
+
+ std::vector<ModSpec> getMods()
+ {
+ return m_sorted_mods;
+ }
+
+ std::vector<ModSpec> getUnsatisfiedMods()
+ {
+ return m_unsatisfied_mods;
+ }
+
+private:
+ // adds all mods in the given path. used for games, modpacks
+ // and world-specific mods (worldmods-folders)
+ void addModsInPath(std::string path);
+
+ // adds all mods in the set.
+ void addMods(std::vector<ModSpec> new_mods);
+
+ // move mods from m_unsatisfied_mods to m_sorted_mods
+ // in an order that satisfies dependencies
+ void resolveDependencies();