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

Go to the source code of this file.

Macros

#define MAX_LEN_ERRORBUF   1024
 
#define DEBUG_ENTRIES(...)
 

Functions

const char * secfile_error ()
 Returns the last error which occurred in a string. More...
 
void secfile_log (const struct section_file *secfile, const struct section *psection, const char *file, const char *function, int line, const char *format,...)
 Edit the error_buffer. More...
 
const char * section_name (const struct section *psection)
 Returns the section name. More...
 
struct section_filesecfile_new (bool allow_duplicates)
 Create a new empty section file. More...
 
void secfile_destroy (struct section_file *secfile)
 Free a section file. More...
 
void secfile_allow_digital_boolean (struct section_file *secfile, bool allow_digital_boolean)
 Set if we could consider values 0 and 1 as boolean. More...
 
bool entry_from_token (struct section *psection, const QString &name, const QString &tok)
 Add entry to section from token. More...
 

Variables

static char error_buffer [MAX_LEN_ERRORBUF] = "\0"
 

Macro Definition Documentation

◆ DEBUG_ENTRIES

#define DEBUG_ENTRIES (   ...)

Definition at line 27 of file section_file.cpp.

◆ MAX_LEN_ERRORBUF

#define MAX_LEN_ERRORBUF   1024

Definition at line 22 of file section_file.cpp.

Function Documentation

◆ entry_from_token()

bool entry_from_token ( struct section psection,
const QString &  name,
const QString &  tok 
)

Add entry to section from token.

Definition at line 121 of file section_file.cpp.

Referenced by entry_from_inf_token().

◆ secfile_allow_digital_boolean()

void secfile_allow_digital_boolean ( struct section_file secfile,
bool  allow_digital_boolean 
)

Set if we could consider values 0 and 1 as boolean.

By default, this is not allowed, but we need to keep compatibility with old Freeciv version for savegames, ruleset etc.

Definition at line 111 of file section_file.cpp.

◆ secfile_destroy()

◆ secfile_error()

◆ secfile_log()

void secfile_log ( const struct section_file secfile,
const struct section psection,
const char *  file,
const char *  function,
int  line,
const char *  format,
  ... 
)

Edit the error_buffer.

Definition at line 38 of file section_file.cpp.

◆ secfile_new()

struct section_file* secfile_new ( bool  allow_duplicates)

Create a new empty section file.

Definition at line 67 of file section_file.cpp.

Referenced by create_ruleset_file(), options_save(), save_game(), secfile_from_input_file(), and send_client_wants_hack().

◆ section_name()

Variable Documentation

◆ error_buffer

char error_buffer[MAX_LEN_ERRORBUF] = "\0"
static

Definition at line 24 of file section_file.cpp.

Referenced by secfile_error(), and secfile_log().