Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
AuthDatabaseFiles Class Reference

#include <database-files.h>

+ Inheritance diagram for AuthDatabaseFiles:
+ Collaboration diagram for AuthDatabaseFiles:

Public Member Functions

 AuthDatabaseFiles (const std::string &savedir)
 
virtual ~AuthDatabaseFiles ()=default
 
virtual bool getAuth (const std::string &name, AuthEntry &res)
 
virtual bool saveAuth (const AuthEntry &authEntry)
 
virtual bool createAuth (AuthEntry &authEntry)
 
virtual bool deleteAuth (const std::string &name)
 
virtual void listNames (std::vector< std::string > &res)
 
virtual void reload ()
 
- Public Member Functions inherited from AuthDatabase
virtual ~AuthDatabase ()=default
 

Private Member Functions

bool readAuthFile ()
 
bool writeAuthFile ()
 

Private Attributes

std::unordered_map< std::string, AuthEntrym_auth_list
 
std::string m_savedir
 

Constructor & Destructor Documentation

◆ AuthDatabaseFiles()

AuthDatabaseFiles::AuthDatabaseFiles ( const std::string & savedir)

References readAuthFile().

+ Here is the call graph for this function:

◆ ~AuthDatabaseFiles()

virtual AuthDatabaseFiles::~AuthDatabaseFiles ( )
virtualdefault

Member Function Documentation

◆ createAuth()

bool AuthDatabaseFiles::createAuth ( AuthEntry & authEntry)
virtual

Implements AuthDatabase.

References m_auth_list, AuthEntry::name, and writeAuthFile().

+ Here is the call graph for this function:

◆ deleteAuth()

bool AuthDatabaseFiles::deleteAuth ( const std::string & name)
virtual

Implements AuthDatabase.

References m_auth_list, and writeAuthFile().

+ Here is the call graph for this function:

◆ getAuth()

bool AuthDatabaseFiles::getAuth ( const std::string & name,
AuthEntry & res )
virtual

Implements AuthDatabase.

References m_auth_list.

◆ listNames()

void AuthDatabaseFiles::listNames ( std::vector< std::string > & res)
virtual

Implements AuthDatabase.

References m_auth_list.

◆ readAuthFile()

bool AuthDatabaseFiles::readAuthFile ( )
private

References DIR_DELIM, m_auth_list, m_savedir, open_ifstream(), and str_split().

Referenced by AuthDatabaseFiles(), and reload().

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

◆ reload()

void AuthDatabaseFiles::reload ( )
virtual

Implements AuthDatabase.

References readAuthFile().

+ Here is the call graph for this function:

◆ saveAuth()

bool AuthDatabaseFiles::saveAuth ( const AuthEntry & authEntry)
virtual

Implements AuthDatabase.

References m_auth_list, AuthEntry::name, and writeAuthFile().

+ Here is the call graph for this function:

◆ writeAuthFile()

bool AuthDatabaseFiles::writeAuthFile ( )
private

References DIR_DELIM, infostream, AuthEntry::last_login, m_auth_list, m_savedir, AuthEntry::name, AuthEntry::password, AuthEntry::privileges, fs::safeWriteToFile(), and str_join().

Referenced by createAuth(), deleteAuth(), and saveAuth().

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

Member Data Documentation

◆ m_auth_list

std::unordered_map<std::string, AuthEntry> AuthDatabaseFiles::m_auth_list
private

◆ m_savedir

std::string AuthDatabaseFiles::m_savedir
private

Referenced by readAuthFile(), and writeAuthFile().


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