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 <email@example.com@.firstname.lastname@example.org@m.rg>
Definition at line 47 of file variable.h.
Function that is called to expand a variable in
Definition at line 54 of file variable.h.
Constructor defining a Variable by its
description, and its function
expansionFunc to expand a variable to its corresponding value.
name should not be translated.
Definition at line 24 of file variable.cpp.
Returns the description that was provided in the constructor.
Definition at line 40 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 45 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 30 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 35 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 Apr 18 2019 02:39:02 by
by Dimitri van Heesch
, © 1997-2006
KDE's Doxygen guidelines are available online.