17 #ifndef QGSEXPRESSIONPRIVATE_H
18 #define QGSEXPRESSIONPRIVATE_H
35 class QgsExpressionPrivate
38 QgsExpressionPrivate()
42 QgsExpressionPrivate(
const QgsExpressionPrivate &other )
44 , mRootNode( other.mRootNode ? other.mRootNode->clone() : nullptr )
45 , mParserErrorString( other.mParserErrorString )
46 , mEvalErrorString( other.mEvalErrorString )
47 , mParserErrors( other.mParserErrors )
49 , mDaEllipsoid( other.mDaEllipsoid )
50 , mCalc( other.mCalc )
51 , mDistanceUnit( other.mDistanceUnit )
52 , mAreaUnit( other.mAreaUnit )
55 mDaCrs = std::make_unique<QgsCoordinateReferenceSystem>( *other.mDaCrs.get() );
56 if ( other.mDaTransformContext )
57 mDaTransformContext = std::make_unique<QgsCoordinateTransformContext>( *other.mDaTransformContext.get() );
60 ~QgsExpressionPrivate()
69 QString mParserErrorString;
70 QString mEvalErrorString;
72 QList<QgsExpression::ParserError> mParserErrors;
77 std::unique_ptr<QgsCoordinateReferenceSystem> mDaCrs;
78 std::unique_ptr<QgsCoordinateTransformContext> mDaTransformContext;
80 std::shared_ptr<QgsDistanceArea> mCalc;
85 bool mIsPrepared =
false;
87 QgsExpressionPrivate &operator= (
const QgsExpressionPrivate & ) =
delete;
93 HelpArg(
const QString &arg,
const QString &desc,
bool descOnly =
false,
bool syntaxOnly =
false,
94 bool optional =
false,
const QString &defaultVal = QString() )
96 , mDescription( desc )
97 , mDescOnly( descOnly )
98 , mSyntaxOnly( syntaxOnly )
99 , mOptional( optional )
100 , mDefaultVal( defaultVal )
104 QString mDescription;
113 HelpExample(
const QString &expression,
const QString &returns,
const QString ¬e = QString() )
114 : mExpression( expression )
115 , mReturns( returns )
127 HelpVariant(
const QString &name,
const QString &description,
128 const QList<HelpArg> &arguments = QList<HelpArg>(),
129 bool variableLenArguments =
false,
130 const QList<HelpExample> &examples = QList<HelpExample>(),
131 const QString ¬es = QString(),
132 const QStringList &tags = QStringList() )
134 , mDescription( description )
135 , mArguments( arguments )
136 , mVariableLenArguments( variableLenArguments )
137 , mExamples( examples )
143 QString mDescription;
144 QList<HelpArg> mArguments;
145 bool mVariableLenArguments;
146 QList<HelpExample> mExamples;
157 Help(
const QString &name,
const QString &type,
const QString &description,
const QList<HelpVariant> &variants )
160 , mDescription( description )
161 , mVariants( variants )
166 QString mDescription;
167 QList<HelpVariant> mVariants;
170 typedef QHash<QString, Help> HelpTextHash;
Abstract base class for all nodes that can appear in an expression.
DistanceUnit
Units of distance.
@ DistanceUnknownUnit
Unknown distance unit.
@ AreaUnknownUnit
Unknown areal unit.
HelpTextHash & functionHelpTexts()