This file is indexed.

/usr/include/libgdamm-5.0/libgdamm/dataselect.h is in libgdamm5.0-dev 4.99.11-0ubuntu1.

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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
// -*- c++ -*-
// Generated by gmmproc 2.46.1 -- DO NOT MODIFY!
#ifndef _LIBGDAMM_DATASELECT_H
#define _LIBGDAMM_DATASELECT_H


#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>

// -*- C++ -*- //

/* dataselect.h
 *
 * Copyright 2006 libgdamm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or(at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */


#include <libgdamm/datamodel.h>
#include <libgdamm/statement.h>
#include <libgdamm/set.h>

#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GdaDataSelect GdaDataSelect;
typedef struct _GdaDataSelectClass GdaDataSelectClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Gnome
{

namespace Gda
{ class DataSelect_Class; } // namespace Gda

} // namespace Gnome
#endif //DOXYGEN_SHOULD_SKIP_THIS

namespace Gnome
{

namespace Gda
{

/** Data models returned by the execution of a SELECT statement.
 *
 * This data model implements the Gda::DataModel interface and is the required 
 * base object when database providers implement a data model returned when a 
 * SELECT statement has been executed. As the GdaDataModel interface is implemented, 
 * consult the API to access and modify the data held in a GdaDataSelect object.
 *
 * The default behaviour however is to disallow modifications, and this section 
 * documents how to characterize a Gda::DataSelect to allow modifications. 
 * Once this is done, any modification done to the data model whill be propagated 
 * to the modified table in the database using INSERT, UPDATE or DELETE statements.
 *
 * After any modification, it is still possible to read values from the data model
 * (even values for rows which have been modified or inserted). The data model 
 * might then execute some SELECT statement to fetch some actualized values. 
 * Note: there is a corner case where a modification made to a row would make 
 * the row not selected at first in the data model (for example is the original 
 * SELECT statement included a clause "WHERE id < 100" and the modification sets 
 * the "id" value to 110), then the row will still be in the data model 
 * even though it would not be if the SELECT statement which execution 
 * created the data model in the first place was re-run.
 *
 * @ingroup DataModels
 */

class DataSelect
 : public Glib::Object,
   public DataModel
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef DataSelect CppObjectType;
  typedef DataSelect_Class CppClassType;
  typedef GdaDataSelect BaseObjectType;
  typedef GdaDataSelectClass BaseClassType;

  // noncopyable
  DataSelect(const DataSelect&) = delete;
  DataSelect& operator=(const DataSelect&) = delete;

private:  friend class DataSelect_Class;
  static CppClassType dataselect_class_;

protected:
  explicit DataSelect(const Glib::ConstructParams& construct_params);
  explicit DataSelect(GdaDataSelect* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:

  DataSelect(DataSelect&& src) noexcept;
  DataSelect& operator=(DataSelect&& src) noexcept;

  virtual ~DataSelect() noexcept;

  /** Get the GType for this class, for use with the underlying GObject type system.
   */
  static GType get_type()      G_GNUC_CONST;

#ifndef DOXYGEN_SHOULD_SKIP_THIS


  static GType get_base_type() G_GNUC_CONST;
#endif

  ///Provides access to the underlying C GObject.
  GdaDataSelect*       gobj()       { return reinterpret_cast<GdaDataSelect*>(gobject_); }

  ///Provides access to the underlying C GObject.
  const GdaDataSelect* gobj() const { return reinterpret_cast<GdaDataSelect*>(gobject_); }

  ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  GdaDataSelect* gobj_copy();

private:

  
public:
  
  /** Specifies the SQL condition corresponding to the WHERE part of a SELECT statement which would
   * return only 1 row (the expression of the primary key).
   * 
   * For example for a table created as <![CDATA["CREATE TABLE mytable (part1 int NOT <tt>0</tt>, part2 string NOT <tt>0</tt>, 
   * name string, PRIMARY KEY (part1, part2))"]]>, and if @a pmodel corresponds to the execution of the 
   * <![CDATA["SELECT name, part1, part2 FROM mytable"]]>, then the sensible value for @a sql_where would be
   * <![CDATA["part1 = ##-1::int AND part2 = ##-2::string"]]> because the values of the 'part1' field are located
   * in @a pmodel's column number 1 and the values of the 'part2' field are located
   * in @a pmodel's column number 2 and the primary key is composed of (part1, part2).
   * 
   * For more information about the syntax of the parameters (named <![CDATA["##-1::int"]]> for example), see the
   * GdaSqlParser documentation, and 
   * set_modification_statement().
   * 
   * @param sql_where An SQL condition (without the WHERE keyword).
   * @return <tt>true</tt> if no error occurred.
   */
  bool set_row_selection_condition_sql(const Glib::ustring& sql_where);
  // This is internal only
  
  
  /** Offers the same features as set_row_selection_condition() but the expression
   * is computed from the meta data associated to the connection being used when @a model was created.
   * 
   * NOTE1: make sure the meta data associated to the connection is up to date before using this
   * method, see Gda::Connection::update_meta_store().
   * 
   * NOTE2: if the SELECT statement from which @a model has been created uses more than one table, or
   * if the table used does not have any primary key, then this method will fail
   * 
   * @return <tt>true</tt> if no error occurred.
   */
  void compute_row_selection_condition();
  
  /** Informs @a model that it should allow modifications to the data in some columns and some rows
   * using @a mod_stmt to propagate those modifications into the database.
   * 
   * If @a mod_stmt is:
   * - an UPDATE statement, then all the rows in @a model will be modifyable
   * - a DELETE statement, then it will be possible to delete rows in @a model
   * - in INSERT statement, then it will be possible to add some rows to @a model
   * - any other statement, then this method will return an error
   * 
   * This method can be called several times to specify different types of modification.
   * 
   * If @a mod_stmt is an UPDATE or DELETE statement then it should have a WHERE part which identifies
   * a unique row in @a model (please note that this property can't be checked but may result
   * in @a model behaving in an unpredictable way).
   * 
   * NOTE1: However, if the set_row_selection_condition()
   * or set_row_selection_condition_sql() have been successfully be called before, the WHERE
   * part of @a mod_stmt <em>WILL</em> be modified to use the row selection condition specified through one of
   * these methods (please not that it is then possible to avoid specifying a WHERE part in @a mod_stmt then).
   * 
   * NOTE2: if set_row_selection_condition()
   * or set_row_selection_condition_sql() have not yet been successfully be called before, then
   * the WHERE part of @a mod_stmt will be used as if one of these functions had been called.
   * 
   * @param mod_stmt A Gda::Statement (INSERT, UPDATE or DELETE).
   * @return <tt>true</tt> if no error occurred.
   */
  void set_modification_statement(const Glib::RefPtr<Statement>& mod_stmt);
  
  /** Offers the same feature as set_modification_statement() but using an SQL statement
   * 
   * @param sql An SQL text.
   * @return <tt>true</tt> if no error occurred.
   */
  void set_modification_statement_sql(const Glib::ustring& sql);
  
  /** Makes @a model try to compute INSERT, UPDATE and DELETE statements to be used when modifying @a model's contents.
   * @note any modification statement set using set_modification_statement() will first be unset
   * 
   * @return <tt>true</tt> if no error occurred. If <tt>false</tt> is returned, then some modification statement may still have been
   * computed.
   */
  void compute_modification_statements();
  
  /** Computes correct attributes for each of @a model's columns, which includes the "NOT <tt>0</tt>" attribute, the
   * default value, the precision and scale for numeric values.
   * 
   * @return <tt>true</tt> if no error occurred.
   */
  void compute_columns_attributes();

  
  /** Get a pointer to the Gda::Connection object which was used when @a model was created
   * (and which may be used internally by @a model).
   * 
   * @return A pointer to the Gda::Connection, or <tt>0</tt>.
   */
  Glib::RefPtr<Connection> get_connection();

  
  /** Requests that @a model be re-run to have an updated result. If an error occurs,
   * then @a model will not be changed.
   * 
   * @newin{4,2}
   * 
   * @return <tt>true</tt> if no error occurred.
   */
  void rerun();

  /** Automatically re-run the SELECT statement if any parameter has changed since it was first executed.
   *
   * @return A PropertyProxy that allows you to get or set the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy< bool > property_auto_reset() ;

/** Automatically re-run the SELECT statement if any parameter has changed since it was first executed.
   *
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< bool > property_auto_reset() const;

  /** Tells if model has analyzed all the rows.
   *
   * @return A PropertyProxy that allows you to get or set the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy< bool > property_store_all_rows() ;

/** Tells if model has analyzed all the rows.
   *
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< bool > property_store_all_rows() const;

  /** Connection from which this data model is created.
   *
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Connection> > property_connection() const;


  /** DELETE Statement to be executed to remove data.
   *
   * @return A PropertyProxy that allows you to get or set the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy< Glib::RefPtr<Statement> > property_delete_stmt() ;

/** DELETE Statement to be executed to remove data.
   *
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> > property_delete_stmt() const;

  /** INSERT Statement to be executed to add data.
   *
   * @return A PropertyProxy that allows you to get or set the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy< Glib::RefPtr<Statement> > property_insert_stmt() ;

/** INSERT Statement to be executed to add data.
   *
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> > property_insert_stmt() const;

  /** Associated prepared statement (for internal usage).
   *
   * @return A PropertyProxy that allows you to get or set the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy< Glib::RefPtr<Statement> > property_prepared_stmt() ;

/** Associated prepared statement (for internal usage).
   *
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> > property_prepared_stmt() const;

  /** UPDATE Statement to be executed to update data.
   *
   * @return A PropertyProxy that allows you to get or set the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy< Glib::RefPtr<Statement> > property_update_stmt() ;

/** UPDATE Statement to be executed to update data.
   *
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Statement> > property_update_stmt() const;

  /** GdaSet used when the SELECT statement was executed.
   *
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Set> > property_exec_params() const;


  /** Determines how the data model may be used.
   *
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
   * or receive notification when the value of the property changes.
   */
  Glib::PropertyProxy_ReadOnly< guint > property_model_usage() const;


public:

public:
  //C++ methods used to invoke GTK+ virtual functions:

protected:
  //GTK+ Virtual Functions (override these to change behaviour):

  //Default Signal Handlers::


};

} // namespace Gda
} // namespace Gnome


namespace Glib
{
  /** A Glib::wrap() method for this object.
   * 
   * @param object The C instance.
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
   * @result A C++ instance that wraps this C instance.
   *
   * @relates Gnome::Gda::DataSelect
   */
  Glib::RefPtr<Gnome::Gda::DataSelect> wrap(GdaDataSelect* object, bool take_copy = false);
}


#endif /* _LIBGDAMM_DATASELECT_H */