#include <cctype>
#include <fstream>
#include <json/json.h>
#include <algorithm>
#include "content/mods.h"
#include "database/database.h"
#include "filesys.h"
#include "log.h"
#include "content/subgames.h"
#include "settings.h"
#include "porting.h"
#include "convert_json.h"
#include "script/common/c_internal.h"
Functions | |
bool | parseDependsString (std::string &dep, std::unordered_set< char > &symbols) |
bool | parseModContents (ModSpec &spec) |
Retrieves depends, optdepends, is_modpack and modpack_content. | |
std::map< std::string, ModSpec > | getModsInPath (const std::string &path, const std::string &virtual_path, bool part_of_modpack) |
Gets a list of all mods and modpacks in path. | |
std::vector< ModSpec > | flattenMods (const std::map< std::string, ModSpec > &mods) |
References flattenMods(), ModSpec::is_modpack, and ModSpec::modpack_content.
Referenced by ModConfiguration::addModsFromConfig(), ModConfiguration::addModsInPath(), findLocaleFileInMods(), and flattenMods().
std::map< std::string, ModSpec > getModsInPath | ( | const std::string & | path, |
const std::string & | virtual_path, | ||
bool | part_of_modpack = false ) |
Gets a list of all mods and modpacks in path.
Path | to search, should be absolute |
part_of_modpack | Is this searching within a modpack? |
virtual_path | Virtual path for this directory, see comment in ModSpec |
References DIR_DELIM, fs::GetDirListing(), and parseModContents().
Referenced by ModConfiguration::addModsFromConfig(), ModConfiguration::addModsInPath(), findLocaleFileInMods(), and parseModContents().
bool parseDependsString | ( | std::string & | dep, |
std::unordered_set< char > & | symbols ) |
References MODNAME_ALLOWED_CHARS, string_allowed(), and trim().
Referenced by parseModContents().
bool parseModContents | ( | ModSpec & | mod | ) |
Retrieves depends, optdepends, is_modpack and modpack_content.
References ModSpec::author, ModSpec::depends, ModSpec::deprecation_msgs, ModSpec::desc, DIR_DELIM, Settings::exists(), Settings::get(), getModsInPath(), Settings::getS32(), ModSpec::is_modpack, fs::IsFile(), ModSpec::modpack_content, ModSpec::name, ModSpec::optdepends, parseDependsString(), ModSpec::path, Settings::readConfigFile(), fs::ReadFile(), ModSpec::release, str_split(), and ModSpec::virtual_path.
Referenced by getModsInPath(), ModApiMainMenu::l_check_mod_configuration(), and ModApiMainMenu::l_get_content_info().