17StateData *StateData::reset(
State &state)
19 auto *p =
new StateData();
24StateData *StateData::detach(
State &state)
27 return state.d.data();
30void StateData::push(Context *context,
QStringList &&captures)
33 m_contextStack.push_back(StackValue{context, std::move(captures)});
36bool StateData::pop(
int popCount)
44 Q_ASSERT(!m_contextStack.empty());
45 const bool initialContextSurvived = int(m_contextStack.size()) > popCount;
46 m_contextStack.resize(std::max(1,
int(m_contextStack.size()) - popCount));
47 return initialContextSurvived;
50State::State() =
default;
52State::State(
State &&other)
noexcept =
default;
54State::State(
const State &other)
noexcept =
default;
56State::~State() =
default;
58State &State::operator=(
State &&other)
noexcept =
default;
60State &State::operator=(
const State &other)
noexcept =
default;
62bool State::operator==(
const State &other)
const
65 return (d == other.d) || (d && other.d && d->m_contextStack == other.d->m_contextStack && d->m_defId == other.d->m_defId);
68bool State::operator!=(
const State &other)
const
70 return !(*
this == other);
73bool State::indentationBasedFoldingEnabled()
const
75 if (!d || d->m_contextStack.empty()) {
78 return d->m_contextStack.back().context->indentationBasedFoldingEnabled();
81std::size_t KSyntaxHighlighting::qHash(
const State &state, std::size_t seed)
83 return state.d ? qHashMulti(seed, *state.d) : 0;
Opaque handle to the state of the highlighting engine.
Syntax highlighting engine for Kate syntax definitions.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:04 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.