/usr/include/qgis/qgsexpressionfieldbuffer.h is in libqgis-dev 2.18.17+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | /***************************************************************************
qgsexpressionfieldbuffer.h
---------------------------
begin : May 27, 2014
copyright : (C) 2014 by Matthias Kuhn
email : matthias at opengis dot ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSEXPRESSIONFIELDBUFFER_H
#define QGSEXPRESSIONFIELDBUFFER_H
#include <QString>
#include <QList>
#include <QDomNode>
#include "qgsfield.h"
#include "qgsexpression.h"
/** \ingroup core
* Buffers information about expression fields for a vector layer.
*
* @note added in 2.6
*/
class CORE_EXPORT QgsExpressionFieldBuffer
{
public:
typedef struct ExpressionField
{
ExpressionField() : cachedExpression( expression ) {}
ExpressionField( const QString& exp, const QgsField& fld )
: expression( exp )
, cachedExpression( exp )
, field( fld )
{}
/**
* @deprecated use cachedExpression instead
*/
QString expression;
QgsExpression cachedExpression;
QgsField field;
} ExpressionField;
QgsExpressionFieldBuffer();
/**
* Add an expression to the buffer
*
* @param exp expression to add
* @param fld field to add
*/
void addExpression( const QString& exp, const QgsField& fld );
/**
* Remove an expression from the buffer
*
* @param index index of expression to remove
*/
void removeExpression( int index );
/**
* Renames an expression field at a given index
*
* @param index The index of the expression to change
* @param name New name for field
*
* @note added in 3.0
*/
void renameExpression( int index, const QString& name );
/**
* Changes the expression at a given index
*
* @param index The index of the expression to change
* @param exp The new expression to set
*
* @note added in 2.9
*/
void updateExpression( int index, const QString& exp );
/**
* Saves expressions to xml under the layer node
*/
void writeXml( QDomNode& layer_node, QDomDocument& document ) const;
/**
* Reads expressions from project file
*/
void readXml( const QDomNode& layer_node );
/**
* Adds fields with the expressions buffered in this object to a QgsFields object
*
* @param flds The fields to be updated
*/
void updateFields( QgsFields& flds );
const QList<ExpressionField>& expressions() const { return mExpressions; }
private:
QList<ExpressionField> mExpressions;
};
#endif // QGSEXPRESSIONFIELDBUFFER_H
|