QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 dot kuhn at gmx 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 <QString>
22 #include <QList>
23 #include <QDomNode>
24 
25 #include "qgsfield.h"
26 
32 class CORE_EXPORT QgsExpressionFieldBuffer
33 {
34  public:
35  typedef struct ExpressionField
36  {
38  ExpressionField( QString exp, QgsField fld ) : expression( exp ), field( fld ) {}
39 
40  QString expression;
43 
45 
52  void addExpression( const QString& exp, const QgsField& fld );
53 
59  void removeExpression( int index );
60 
64  void writeXml( QDomNode& layer_node, QDomDocument& document ) const;
65 
69  void readXml( const QDomNode& layer_node );
70 
76  void updateFields( QgsFields& flds );
77 
78  const QList<ExpressionField> expressions() const { return mExpressions; }
79 
80  private:
81  QList<ExpressionField> mExpressions;
82 };
83 
84 #endif // QGSEXPRESSIONFIELDBUFFER_H
static unsigned index
Definition: mersenne-twister.cpp:36
Definition: qgsexpressionfieldbuffer.h:35
Container of fields for a vector layer.
Definition: qgsfield.h:163
const QList< ExpressionField > expressions() const
Definition: qgsexpressionfieldbuffer.h:78
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:33
Buffers information about expression fields for a vector layer.
Definition: qgsexpressionfieldbuffer.h:32
ExpressionField()
Definition: qgsexpressionfieldbuffer.h:37
ExpressionField(QString exp, QgsField fld)
Definition: qgsexpressionfieldbuffer.h:38
QString expression
Definition: qgsexpressionfieldbuffer.h:40
QgsField field
Definition: qgsexpressionfieldbuffer.h:41