Freeciv21
Develop your civilization from humble roots to a global empire
fcdb.cpp File Reference
#include <QHash>
#include <QString>
#include "fcintl.h"
#include "log.h"
#include "registry.h"
#include "section_file.h"
#include "support.h"
#include "script_fcdb.h"
#include "fcdb.h"
+ Include dependency graph for fcdb.cpp:

Go to the source code of this file.

Classes

struct  fcdb_option
 

Functions

static bool fcdb_set_option (const char *key, const char *value)
 Set one fcdb option (or delete it if value == nullptr). More...
 
static bool fcdb_load_config (const char *filename)
 Load fcdb configuration from file. More...
 
bool fcdb_init (const char *conf_file)
 Initialize freeciv database system. More...
 
const char * fcdb_option_get (const char *type)
 Return the selected fcdb config value. More...
 
void fcdb_free (void)
 Free resources allocated by fcdb system. More...
 

Variables

QHash< QString, fcdb_option * > fcdb_config
 

Function Documentation

◆ fcdb_free()

void fcdb_free ( void  )

Free resources allocated by fcdb system.

Definition at line 145 of file fcdb.cpp.

Referenced by server_quit().

◆ fcdb_init()

bool fcdb_init ( const char *  conf_file)

Initialize freeciv database system.

Definition at line 117 of file fcdb.cpp.

◆ fcdb_load_config()

static bool fcdb_load_config ( const char *  filename)
static

Load fcdb configuration from file.

We deliberately don't search datadirs for filename, as we don't want this overridden by modpacks etc.

Definition at line 79 of file fcdb.cpp.

Referenced by fcdb_init().

◆ fcdb_option_get()

const char* fcdb_option_get ( const char *  type)

Return the selected fcdb config value.

Definition at line 133 of file fcdb.cpp.

Referenced by script_fcdb_register_functions().

◆ fcdb_set_option()

static bool fcdb_set_option ( const char *  key,
const char *  value 
)
static

Set one fcdb option (or delete it if value == nullptr).

Replaces any previous setting.

Definition at line 41 of file fcdb.cpp.

Referenced by fcdb_load_config().

Variable Documentation

◆ fcdb_config

QHash<QString, fcdb_option *> fcdb_config

Definition at line 32 of file fcdb.cpp.

Referenced by fcdb_free(), fcdb_option_get(), and fcdb_set_option().