Doxygen
|
#include <unordered_map>
#include <cassert>
#include "message.h"
#include "aliases.h"
#include "containers.h"
#include "config.h"
#include "regex.h"
#include "textstream.h"
#include "util.h"
#include "debug.h"
#include "stringutil.h"
Go to the source code of this file.
Classes | |
struct | AliasInfo |
struct | Marker |
Typedefs | |
using | AliasOverloads = std::unordered_map<int,AliasInfo> |
using | AliasInfoMap = std::unordered_map<std::string,AliasOverloads> |
Functions | |
static std::string | expandAliasRec (StringUnorderedSet &aliasesProcessed, std::string_view s, bool allowRecursion=FALSE) |
static int | countAliasArguments (std::string_view args, std::string_view sep) |
static std::string | extractAliasArgs (std::string_view args) |
static std::string | expandAlias (std::string_view aliasName, std::string_view aliasValue) |
static void | addValidAliasToMap (std::string_view alias) |
static std::string | escapeAlias (std::string_view value) |
void | readAliases () |
static size_t | findEndOfCommand (std::string_view s) |
For a string s that starts with a command name, returns the character offset within that string representing the first character after the command. | |
static std::string | replaceAliasArguments (StringUnorderedSet &aliasesProcessed, std::string_view aliasValue, std::string_view argList, std::string_view sep) |
Replaces the markers in an alias definition aliasValue with the corresponding values found in the comma separated argument list argList and the returns the result after recursive alias expansion. | |
static std::string | escapeSeparators (const std::string &s, const std::string &sep) |
std::string | resolveAliasCmd (std::string_view aliasCmd) |
bool | isAliasCmd (std::string_view aliasCmd) |
Variables | |
static AliasInfoMap | g_aliasInfoMap |
using AliasInfoMap = std::unordered_map<std::string,AliasOverloads> |
Definition at line 40 of file aliases.cpp.
using AliasOverloads = std::unordered_map<int,AliasInfo> |
Definition at line 39 of file aliases.cpp.
|
static |
Definition at line 56 of file aliases.cpp.
References Debug::Alias, err, g_aliasInfoMap, reg::Match::length(), reg::Match::position(), Debug::print(), reg::search(), reg::Match::size(), and reg::Match::str().
Referenced by readAliases().
|
static |
Definition at line 440 of file aliases.cpp.
References findEndOfCommand().
Referenced by expandAliasRec().
|
static |
Definition at line 151 of file aliases.cpp.
References substituteStringView().
Referenced by readAliases().
|
static |
Definition at line 313 of file aliases.cpp.
Referenced by expandAliasRec().
|
static |
Definition at line 504 of file aliases.cpp.
References Debug::Alias, expandAliasRec(), and Debug::print().
Referenced by readAliases().
|
static |
Definition at line 334 of file aliases.cpp.
References countAliasArguments(), escapeSeparators(), expandAliasRec(), extractAliasArgs(), g_aliasInfoMap, replaceAliasArguments(), and reg::search().
Referenced by expandAlias(), expandAliasRec(), replaceAliasArguments(), and resolveAliasCmd().
|
static |
Definition at line 464 of file aliases.cpp.
Referenced by expandAliasRec(), and findEndOfCommand().
|
static |
For a string s that starts with a command name, returns the character offset within that string representing the first character after the command.
For an alias with argument, this is the offset to the character just after the argument list.
Examples:
Definition at line 205 of file aliases.cpp.
References extractAliasArgs(), and isId().
Referenced by countAliasArguments(), and replaceAliasArguments().
bool isAliasCmd | ( | std::string_view | aliasCmd | ) |
Definition at line 518 of file aliases.cpp.
References g_aliasInfoMap.
Referenced by DocPara::handleCommand().
void readAliases | ( | ) |
Definition at line 161 of file aliases.cpp.
References addValidAliasToMap(), Config_getList, escapeAlias(), expandAlias(), and g_aliasInfoMap.
Referenced by adjustConfiguration().
|
static |
Replaces the markers in an alias definition aliasValue with the corresponding values found in the comma separated argument list argList and the returns the result after recursive alias expansion.
Definition at line 220 of file aliases.cpp.
References expandAliasRec(), findEndOfCommand(), and substituteInplace().
Referenced by expandAliasRec().
std::string resolveAliasCmd | ( | std::string_view | aliasCmd | ) |
Definition at line 494 of file aliases.cpp.
References Debug::Alias, expandAliasRec(), and Debug::print().
Referenced by replaceAliases().
|
static |
Definition at line 52 of file aliases.cpp.
Referenced by addValidAliasToMap(), expandAliasRec(), isAliasCmd(), and readAliases().