QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
qgsexpressionfieldbuffer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsexpressionfieldbuffer.h
3 ---------------------------
4 begin : May 27, 2014
5 copyright : (C) 2014 by Matthias Kuhn
6 email : matthias at opengis dot ch
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSEXPRESSIONFIELDBUFFER_H
19#define QGSEXPRESSIONFIELDBUFFER_H
20
21#include "qgis_core.h"
22#include <QString>
23#include <QList>
24#include <QDomNode>
25
26#include "qgsfields.h"
27#include "qgsexpression.h"
28
34class CORE_EXPORT QgsExpressionFieldBuffer
35{
36 public:
38 {
39 ExpressionField( const QString &exp, const QgsField &fld )
40 : cachedExpression( exp )
41 , field( fld )
42 {}
43
46 };
47
49
56 void addExpression( const QString &exp, const QgsField &fld );
57
63 void removeExpression( int index );
64
72 void renameExpression( int index, const QString &name );
73
81 void updateExpression( int index, const QString &exp );
82
86 void writeXml( QDomNode &layer_node, QDomDocument &document ) const;
87
91 void readXml( const QDomNode &layer_node );
92
98 void updateFields( QgsFields &flds ) const;
99
100 QList<QgsExpressionFieldBuffer::ExpressionField> expressions() const { return mExpressions; }
101
102 private:
103 QList<ExpressionField> mExpressions;
104};
105
106#endif // QGSEXPRESSIONFIELDBUFFER_H
Buffers information about expression fields for a vector layer.
QList< QgsExpressionFieldBuffer::ExpressionField > expressions() const
QgsExpressionFieldBuffer()=default
Class for parsing and evaluation of expressions (formerly called "search strings").
Encapsulate a field in an attribute table or data source.
Definition qgsfield.h:53
Container of fields for a vector layer.
Definition qgsfields.h:46
ExpressionField(const QString &exp, const QgsField &fld)