ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

commandLine.cpp File Reference

#include <limits.h>
#include "engines/metaengine.h"
#include "base/commandLine.h"
#include "base/plugins.h"
#include "base/version.h"
#include "common/config-manager.h"
#include "common/fs.h"
#include "common/rendermode.h"
#include "common/stack.h"
#include "common/system.h"
#include "common/textconsole.h"
#include "gui/ThemeEngine.h"
#include "audio/musicplugin.h"
#include "graphics/renderer.h"
Include dependency graph for commandLine.cpp:

Go to the source code of this file.

Namespaces

namespace  Base

Defines

#define FORBIDDEN_SYMBOL_EXCEPTION_printf
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
#define DETECTOR_TESTING_HACK
#define UPGRADE_ALL_TARGETS_HACK
#define DO_OPTION_OPT(shortCmd, longCmd, defaultVal)
#define DO_OPTION(shortCmd, longCmd)
#define DO_OPTION_INT(shortCmd, longCmd)
#define DO_OPTION_BOOL(shortCmd, longCmd)
#define DO_COMMAND(shortCmd, longCmd)
#define DO_LONG_OPTION_OPT(longCmd, d)   DO_OPTION_OPT(0, longCmd, d)
#define DO_LONG_OPTION(longCmd)   DO_OPTION(0, longCmd)
#define DO_LONG_OPTION_INT(longCmd)   DO_OPTION_INT(0, longCmd)
#define DO_LONG_OPTION_BOOL(longCmd)   DO_OPTION_BOOL(0, longCmd)
#define DO_LONG_COMMAND(longCmd)   DO_COMMAND(0, longCmd)
#define END_OPTION
#define END_COMMAND

Functions

static void NORETURN_PRE Base::usage (const char *s,...) GCC_PRINTF(1
static void Base::ensureFirstCommand (const Common::String &existingCommand, const char *newCommand)
void Base::registerDefaults ()
 Register various defaults with the ConfigManager.
Common::String Base::parseCommandLine (Common::StringMap &settings, int argc, const char *const *argv)
 Parse the command line for options and a command; the options are stored in the map 'settings, the command (if any) is returned.
static void Base::listGames ()
 List all supported game IDs, i.e.
static void Base::listTargets ()
 List all targets which are configured in the config file.
static Common::Error Base::listSaves (const Common::String &target)
 List all saves states for the given target.
static void Base::listThemes ()
 Lists all usable themes.
static void Base::listAudioDevices ()
 Lists all output devices.
static DetectedGames Base::getGameList (const Common::FSNode &dir)
 Display all games in the given directory, or current directory if empty.
static DetectedGames Base::recListGames (const Common::FSNode &dir, const Common::String &gameId, bool recursive)
static Common::String Base::detectGames (const Common::String &path, const Common::String &gameId, bool recursive)
 Display all games in the given directory, return ID of first detected game.
static int Base::recAddGames (const Common::FSNode &dir, const Common::String &game, bool recursive)
static bool Base::addGames (const Common::String &path, const Common::String &game, bool recursive)
static void Base::runDetectorTest ()
void Base::upgradeTargets ()
bool Base::processSettings (Common::String &command, Common::StringMap &settings, Common::Error &err)
 Process the command line options and arguments.

Variables

static const char Base::USAGE_STRING [] = "Try '%s --help' for more options.\n"
static const char Base::HELP_STRING [] = " (default: 60)\n"
static const char * Base::s_appName = "residualvm"
static void NORETURN_PRE Base::NORETURN_POST

Define Documentation

#define DETECTOR_TESTING_HACK

Definition at line 48 of file commandLine.cpp.

#define DO_COMMAND (   shortCmd,
  longCmd 
)
Value:
if (isLongCmd ? (!strcmp(s + 2, longCmd)) : (tolower(s[1]) == shortCmd)) { \
        s += 2; \
        if (isLongCmd) \
            s += sizeof(longCmd) - 1; \
        if (*s != '\0') goto unknownOption; \
        ensureFirstCommand(command, longCmd); \
        command = longCmd;

Definition at line 320 of file commandLine.cpp.

#define DO_LONG_COMMAND (   longCmd  )     DO_COMMAND(0, longCmd)

Definition at line 334 of file commandLine.cpp.

#define DO_LONG_OPTION (   longCmd  )     DO_OPTION(0, longCmd)

Definition at line 331 of file commandLine.cpp.

#define DO_LONG_OPTION_BOOL (   longCmd  )     DO_OPTION_BOOL(0, longCmd)

Definition at line 333 of file commandLine.cpp.

#define DO_LONG_OPTION_INT (   longCmd  )     DO_OPTION_INT(0, longCmd)

Definition at line 332 of file commandLine.cpp.

#define DO_LONG_OPTION_OPT (   longCmd,
  d 
)    DO_OPTION_OPT(0, longCmd, d)

Definition at line 330 of file commandLine.cpp.

#define DO_OPTION (   shortCmd,
  longCmd 
)
Value:
DO_OPTION_OPT(shortCmd, longCmd, 0) \
    if (!option) usage("Option '%s' requires an argument", argv[isLongCmd ? i : i-1]);

Definition at line 292 of file commandLine.cpp.

#define DO_OPTION_BOOL (   shortCmd,
  longCmd 
)
Value:
if (isLongCmd ? (!strcmp(s + 2, longCmd) || !strcmp(s + 2, "no-" longCmd)) : (tolower(s[1]) == shortCmd)) { \
        bool boolValue = (Common::isLower(s[1]) != 0); \
        s += 2; \
        if (isLongCmd) { \
            boolValue = !strcmp(s, longCmd); \
            s += boolValue ? (sizeof(longCmd) - 1) : (sizeof("no-" longCmd) - 1); \
        } \
        if (*s != '\0') goto unknownOption; \
        const char *option = boolValue ? "true" : "false"; \
        settings[longCmd] = option;

Definition at line 307 of file commandLine.cpp.

#define DO_OPTION_INT (   shortCmd,
  longCmd 
)
Value:
DO_OPTION(shortCmd, longCmd) \
    char *endptr; \
    long int retval = strtol(option, &endptr, 0); \
    if (*endptr != '\0' || retval == LONG_MAX || retval == LONG_MIN) \
        usage("--%s: Invalid number '%s'", longCmd, option);

Definition at line 298 of file commandLine.cpp.

#define DO_OPTION_OPT (   shortCmd,
  longCmd,
  defaultVal 
)
Value:
if (isLongCmd ? (!strcmp(s + 2, longCmd) || !memcmp(s + 2, longCmd"=", sizeof(longCmd"=") - 1)) : (tolower(s[1]) == shortCmd)) { \
        s += 2; \
        if (isLongCmd) { \
            s += sizeof(longCmd) - 1; \
            if (*s == '=') \
                s++; \
        } \
        const char *option = s; \
        if (*s == '\0' && !isLongCmd) { option = s2; i++; } \
        if (!option || *option == '\0') option = defaultVal; \
        if (option) settings[longCmd] = option;

Definition at line 278 of file commandLine.cpp.

#define END_COMMAND
Value:
continue; \
    }

Definition at line 342 of file commandLine.cpp.

#define END_OPTION
Value:
continue; \
    }

Definition at line 337 of file commandLine.cpp.

#define FORBIDDEN_SYMBOL_EXCEPTION_exit

Definition at line 26 of file commandLine.cpp.

#define FORBIDDEN_SYMBOL_EXCEPTION_printf

Definition at line 24 of file commandLine.cpp.

#define UPGRADE_ALL_TARGETS_HACK

Definition at line 49 of file commandLine.cpp.



Generated on Sat Feb 16 2019 05:01:40 for ResidualVM by doxygen 1.7.1
curved edge   curved edge