|
Doxygen
|
#include "aliases.h"#include <unordered_map>#include "config.h"#include "debug.h"#include "message.h"#include "regex.h"#include "stringutil.h"#include "util.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 41 of file aliases.cpp.
| using AliasOverloads = std::unordered_map<int,AliasInfo> |
Definition at line 40 of file aliases.cpp.
|
static |
Definition at line 57 of file aliases.cpp.
References Debug::Alias, ASSERT, 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 441 of file aliases.cpp.
References findEndOfCommand().
Referenced by expandAliasRec().
|
static |
Definition at line 152 of file aliases.cpp.
References substituteStringView().
Referenced by readAliases().
|
static |
Definition at line 314 of file aliases.cpp.
Referenced by expandAliasRec().
|
static |
Definition at line 505 of file aliases.cpp.
References Debug::Alias, expandAliasRec(), and Debug::print().
Referenced by readAliases().
|
static |
Definition at line 335 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 465 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 206 of file aliases.cpp.
References extractAliasArgs(), and isId().
Referenced by countAliasArguments(), and replaceAliasArguments().
| bool isAliasCmd | ( | std::string_view | aliasCmd | ) |
Definition at line 519 of file aliases.cpp.
References g_aliasInfoMap.
Referenced by DocPara::handleCommand().
| void readAliases | ( | ) |
Definition at line 162 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 221 of file aliases.cpp.
References expandAliasRec(), findEndOfCommand(), and substituteInplace().
Referenced by expandAliasRec().
| std::string resolveAliasCmd | ( | std::string_view | aliasCmd | ) |
Definition at line 495 of file aliases.cpp.
References Debug::Alias, expandAliasRec(), and Debug::print().
Referenced by replaceAliases().
|
static |
Definition at line 53 of file aliases.cpp.
Referenced by addValidAliasToMap(), expandAliasRec(), isAliasCmd(), and readAliases().