Minetest  5.4.0
ModMetadata Class Reference

#include <mods.h>

+ Inheritance diagram for ModMetadata:
+ Collaboration diagram for ModMetadata:

Public Member Functions

 ModMetadata ()=delete
 
 ModMetadata (const std::string &mod_name)
 
 ~ModMetadata ()=default
 
virtual void clear ()
 
bool save (const std::string &root_path)
 
bool load (const std::string &root_path)
 
bool isModified () const
 
const std::string & getModName () const
 
virtual bool setString (const std::string &name, const std::string &var)
 Sets var to name key in the metadata storage. More...
 

Private Attributes

std::string m_mod_name
 
bool m_modified = false
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ ModMetadata() [1/2]

ModMetadata::ModMetadata ( )
delete

◆ ModMetadata() [2/2]

ModMetadata::ModMetadata ( const std::string &  mod_name)

◆ ~ModMetadata()

ModMetadata::~ModMetadata ( )
default

Member Function Documentation

◆ clear()

void ModMetadata::clear ( )
virtual

Reimplemented from Metadata.

References Metadata::clear(), and m_modified.

Referenced by StorageRef::clearMeta().

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

◆ getModName()

const std::string& ModMetadata::getModName ( ) const
inline

References m_mod_name.

Referenced by StorageRef::gc_object(), Client::registerModStorage(), and Server::registerModStorage().

+ Here is the caller graph for this function:

◆ isModified()

bool ModMetadata::isModified ( ) const
inline

References m_modified.

◆ load()

bool ModMetadata::load ( const std::string &  root_path)

References DIR_DELIM, errorstream, m_mod_name, and Metadata::m_stringvars.

Referenced by ModApiStorage::l_get_mod_storage().

+ Here is the caller graph for this function:

◆ save()

bool ModMetadata::save ( const std::string &  root_path)

References fs::CreateAllDirs(), DIR_DELIM, errorstream, fastWriteJson(), fs::IsDir(), m_mod_name, m_modified, Metadata::m_stringvars, fs::PathExists(), and fs::safeWriteToFile().

+ Here is the call graph for this function:

◆ setString()

bool ModMetadata::setString ( const std::string &  name,
const std::string &  var 
)
virtual

Sets var to name key in the metadata storage.

Parameters
name
var
Returns
true if key-value pair is created or changed

Reimplemented from Metadata.

References m_modified, and Metadata::setString().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_mod_name

std::string ModMetadata::m_mod_name
private

Referenced by getModName(), load(), and save().

◆ m_modified

bool ModMetadata::m_modified = false
private

Referenced by clear(), isModified(), save(), and setString().


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