Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
mods.cpp File Reference
#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"
+ Include dependency graph for mods.cpp:

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, ModSpecgetModsInPath (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< ModSpecflattenMods (const std::map< std::string, ModSpec > &mods)
 

Function Documentation

◆ flattenMods()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getModsInPath()

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.

Parameters
Pathto search, should be absolute
part_of_modpackIs this searching within a modpack?
virtual_pathVirtual path for this directory, see comment in ModSpec
Returns
map of mods

References DIR_DELIM, fs::GetDirListing(), and parseModContents().

Referenced by ModConfiguration::addModsFromConfig(), ModConfiguration::addModsInPath(), findLocaleFileInMods(), and parseModContents().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseDependsString()

bool parseDependsString ( std::string & dep,
std::unordered_set< char > & symbols )

References MODNAME_ALLOWED_CHARS, string_allowed(), and trim().

Referenced by parseModContents().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseModContents()

bool parseModContents ( ModSpec & mod)

Retrieves depends, optdepends, is_modpack and modpack_content.

Returns
false if not a mod

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: