Variable for variable expansion.
A Variable is used by the KTextEditor::Editor to expand variables, also know as expanding macros. A Variable itself is defined by the variable name() as well as a description() and a function that replaces the variable by its value.
To register a Variable in the Editor use either Editor::registerVariableMatch() or Editor::registerPrefixMatch().
- See also
- KTextEditor::Editor, KTextEditor::Editor::registerVariableMatch(), KTextEditor::Editor::registerPrefixMatch()
- Dominik Haumann <dhaum[email protected][email protected][email protected]kde.o[email protected]rg>
Definition at line 49 of file variable.h.
Function that is called to expand a variable in
Definition at line 56 of file variable.h.
Constructor defining a Variable by its
description, and its function
expansionFunc to expand a variable to its corresponding value.
isPrefixMatch indicates whether this Variable represents an exact match (false) or a prefix match (true).
name should not be translated.
Definition at line 25 of file variable.cpp.
||const Variable &
Returns the description that was provided in the constructor.
Definition at line 48 of file variable.cpp.
Expands the Variable to its value.
As example for an exact match, a variable "CurerntDocument:Cursor:Line" uses the
view to return the current line of the text cursor. In this case
prefix equals the text of the variable itself, i.e. "CurerntDocument:Cursor:Line".
As example of a prefix match, a variable "ENV:value" expands the environment value value, e.g. "ENV:HOME". In this case, the
prefix equals the text "ENV:HOME" and
view would be unused.
- the expanded variable.
Definition at line 53 of file variable.cpp.
Returns whether this Variable represents an exact match (false) or a prefix match (true).
Definition at line 38 of file variable.cpp.
Returns true, if the name is non-empty and the function provided in the constructor is not a nullptr.
Definition at line 33 of file variable.cpp.
name that was provided in the constructor.
Depending on where the Variable is registered, this name is used to identify an exact match or a prefix match.
Definition at line 43 of file variable.cpp.
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 12 2019 02:25:30 by
by Dimitri van Heesch
, © 1997-2006
KDE's Doxygen guidelines are available online.