20#ifndef LIBREPCB_CORE_ATTRIBUTESUBSTITUTOR_H
21#define LIBREPCB_CORE_ATTRIBUTESUBSTITUTOR_H
105 int& length, QStringList& keys) noexcept;
107 static
void applyFilter(QString& str,
int& start,
int& end,
110 static
bool getValueOfKey(const QString& key, QString& value,
The AttributeSubstitutor class substitutes attribute keys in strings with their actual values (e....
Definition: attributesubstitutor.h:57
static QString substitute(QString str, LookupFunction lookup=nullptr, FilterFunction filter=nullptr) noexcept
Substitute all attribute keys in a string with their attribute values.
Definition: attributesubstitutor.cpp:38
static bool searchVariablesInText(const QString &text, int startPos, int &pos, int &length, QStringList &keys) noexcept
Search the next variables (e.g. "{{KEY or FALLBACK}}") in a given text.
Definition: attributesubstitutor.cpp:88
std::function< QString(const QString &)> LookupFunction
Definition: attributesubstitutor.h:59
AttributeSubstitutor & operator=(const AttributeSubstitutor &rhs)=delete
AttributeSubstitutor(const AttributeSubstitutor &other)=delete
static bool getValueOfKey(const QString &key, QString &value, LookupFunction lookup) noexcept
Definition: attributesubstitutor.cpp:121
~AttributeSubstitutor()=delete
static void applyFilter(QString &str, int &start, int &end, FilterFunction filter) noexcept
Definition: attributesubstitutor.cpp:113
std::function< QString(const QString &)> FilterFunction
Definition: attributesubstitutor.h:60
AttributeSubstitutor()=delete
Definition: occmodel.cpp:77