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

Go to the source code of this file.

Macros

#define GET_TOKEN(start, end)
 

Functions

static bool fc_has_capability (const char *cap, const char *capstr, const size_t cap_len)
 This routine returns true if the capability in cap appears in the capability list in capstr. More...
 
bool has_capability (const char *cap, const char *capstr)
 Wrapper for fc_has_capability() for nullptr terminated strings. More...
 
bool has_capabilities (const char *us, const char *them)
 This routine returns true if all the mandatory capabilities in us appear in them. More...
 

Macro Definition Documentation

◆ GET_TOKEN

#define GET_TOKEN (   start,
  end 
)
Value:
{ \
/* skip leading whitespace */ \
while (QChar::isSpace(*start)) { \
start++; \
} \
/* skip to end of token */ \
for (end = start; *end != '\0' && !QChar::isSpace(*end) && *end != ','; \
end++) { \
/* nothing */ \
} \
}

Definition at line 22 of file capability.cpp.

Function Documentation

◆ fc_has_capability()

static bool fc_has_capability ( const char *  cap,
const char *  capstr,
const size_t  cap_len 
)
static

This routine returns true if the capability in cap appears in the capability list in capstr.

The capabilities in capstr are allowed to start with a "+", but the capability in cap must not.

Definition at line 40 of file capability.cpp.

Referenced by has_capabilities(), and has_capability().

◆ has_capabilities()

bool has_capabilities ( const char *  us,
const char *  them 
)

◆ has_capability()

bool has_capability ( const char *  cap,
const char *  capstr 
)

Wrapper for fc_has_capability() for nullptr terminated strings.

Definition at line 71 of file capability.cpp.

Referenced by compat_load_020400(), handle_player_info(), packet_handlers_get(), rscompat_optional_capabilities(), and sg_load_map().