This file is indexed.

/usr/include/libgdamm-5.0/libgdamm/metastruct.h is in libgdamm5.0-dev 4.99.11-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
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
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
// -*- c++ -*-
// Generated by gmmproc 2.46.1 -- DO NOT MODIFY!
#ifndef _LIBGDAMM_METASTRUCT_H
#define _LIBGDAMM_METASTRUCT_H


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

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

/* metastore.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/value.h>
#include <glibmm/object.h>
#include <glibmm/error.h>
#include <libgda/gda-meta-struct.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GdaMetaStruct GdaMetaStruct;
typedef struct _GdaMetaStructClass GdaMetaStructClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Gnome
{

namespace Gda
{ class MetaStruct_Class; } // namespace Gda

} // namespace Gnome
#endif //DOXYGEN_SHOULD_SKIP_THIS

namespace Gnome
{

namespace Gda
{

/** Exception class for Gda MetaStruct errors.
 */
class MetaStructError : public Glib::Error
{
public:
  /** 
   */
  enum Code
  {
    META_STRUCT_UNKNOWN_OBJECT_ERROR,
    META_STRUCT_DUPLICATE_OBJECT_ERROR,
    META_STRUCT_INCOHERENCE_ERROR,
    META_STRUCT_XML_ERROR
  };

  MetaStructError(Code error_code, const Glib::ustring& error_message);
  explicit MetaStructError(GError* gobject);
  Code code() const;

#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:

  static void throw_func(GError* gobject);

  friend void wrap_init(); // uses throw_func()

  #endif //DOXYGEN_SHOULD_SKIP_THIS
};

} // namespace Gda

} // namespace Gnome

#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gnome::Gda::MetaStructError::Code> : public Glib::Value_Enum<Gnome::Gda::MetaStructError::Code>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{


/** @addtogroup libgdammEnums libgdamm Enums and Flags */

/** 
 *
 * @ingroup libgdammEnums
 * @par Bitwise operators:
 * <tt>%MetaStructFeature operator|(MetaStructFeature, MetaStructFeature)</tt><br>
 * <tt>%MetaStructFeature operator&(MetaStructFeature, MetaStructFeature)</tt><br>
 * <tt>%MetaStructFeature operator^(MetaStructFeature, MetaStructFeature)</tt><br>
 * <tt>%MetaStructFeature operator~(MetaStructFeature)</tt><br>
 * <tt>%MetaStructFeature& operator|=(MetaStructFeature&, MetaStructFeature)</tt><br>
 * <tt>%MetaStructFeature& operator&=(MetaStructFeature&, MetaStructFeature)</tt><br>
 * <tt>%MetaStructFeature& operator^=(MetaStructFeature&, MetaStructFeature)</tt><br>
 */
enum MetaStructFeature
{
  META_STRUCT_FEATURE_NONE = 0x0,
  META_STRUCT_FEATURE_FOREIGN_KEYS = 1 << 0,
  META_STRUCT_FEATURE_VIEW_DEPENDENCIES = 1 << 1,
  META_STRUCT_FEATURE_ALL = 0x3
};

/** @ingroup libgdammEnums */
inline MetaStructFeature operator|(MetaStructFeature lhs, MetaStructFeature rhs)
  { return static_cast<MetaStructFeature>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }

/** @ingroup libgdammEnums */
inline MetaStructFeature operator&(MetaStructFeature lhs, MetaStructFeature rhs)
  { return static_cast<MetaStructFeature>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }

/** @ingroup libgdammEnums */
inline MetaStructFeature operator^(MetaStructFeature lhs, MetaStructFeature rhs)
  { return static_cast<MetaStructFeature>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }

/** @ingroup libgdammEnums */
inline MetaStructFeature operator~(MetaStructFeature flags)
  { return static_cast<MetaStructFeature>(~static_cast<unsigned>(flags)); }

/** @ingroup libgdammEnums */
inline MetaStructFeature& operator|=(MetaStructFeature& lhs, MetaStructFeature rhs)
  { return (lhs = static_cast<MetaStructFeature>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }

/** @ingroup libgdammEnums */
inline MetaStructFeature& operator&=(MetaStructFeature& lhs, MetaStructFeature rhs)
  { return (lhs = static_cast<MetaStructFeature>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }

/** @ingroup libgdammEnums */
inline MetaStructFeature& operator^=(MetaStructFeature& lhs, MetaStructFeature rhs)
  { return (lhs = static_cast<MetaStructFeature>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }

} // namespace Gda

} // namespace Gnome


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gnome::Gda::MetaStructFeature> : public Glib::Value_Flags<Gnome::Gda::MetaStructFeature>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{

/** 
 *
 * @ingroup libgdammEnums
 */
enum MetaDbObjectType
{
  META_DB_UNKNOWN,
  META_DB_TABLE,
  META_DB_VIEW
};

} // namespace Gda

} // namespace Gnome


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gnome::Gda::MetaDbObjectType> : public Glib::Value_Enum<Gnome::Gda::MetaDbObjectType>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{

/** 
 *
 * @ingroup libgdammEnums
 */
enum MetaSortType
{
  META_SORT_ALHAPETICAL,
  META_SORT_DEPENDENCIES
};

} // namespace Gda

} // namespace Gnome


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gnome::Gda::MetaSortType> : public Glib::Value_Enum<Gnome::Gda::MetaSortType>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{

/** 
 *
 * @ingroup libgdammEnums
 * @par Bitwise operators:
 * <tt>%MetaGraphInfo operator|(MetaGraphInfo, MetaGraphInfo)</tt><br>
 * <tt>%MetaGraphInfo operator&(MetaGraphInfo, MetaGraphInfo)</tt><br>
 * <tt>%MetaGraphInfo operator^(MetaGraphInfo, MetaGraphInfo)</tt><br>
 * <tt>%MetaGraphInfo operator~(MetaGraphInfo)</tt><br>
 * <tt>%MetaGraphInfo& operator|=(MetaGraphInfo&, MetaGraphInfo)</tt><br>
 * <tt>%MetaGraphInfo& operator&=(MetaGraphInfo&, MetaGraphInfo)</tt><br>
 * <tt>%MetaGraphInfo& operator^=(MetaGraphInfo&, MetaGraphInfo)</tt><br>
 */
enum MetaGraphInfo
{
  META_GRAPH_COLUMNS = 1 << 0
};

/** @ingroup libgdammEnums */
inline MetaGraphInfo operator|(MetaGraphInfo lhs, MetaGraphInfo rhs)
  { return static_cast<MetaGraphInfo>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }

/** @ingroup libgdammEnums */
inline MetaGraphInfo operator&(MetaGraphInfo lhs, MetaGraphInfo rhs)
  { return static_cast<MetaGraphInfo>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }

/** @ingroup libgdammEnums */
inline MetaGraphInfo operator^(MetaGraphInfo lhs, MetaGraphInfo rhs)
  { return static_cast<MetaGraphInfo>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }

/** @ingroup libgdammEnums */
inline MetaGraphInfo operator~(MetaGraphInfo flags)
  { return static_cast<MetaGraphInfo>(~static_cast<unsigned>(flags)); }

/** @ingroup libgdammEnums */
inline MetaGraphInfo& operator|=(MetaGraphInfo& lhs, MetaGraphInfo rhs)
  { return (lhs = static_cast<MetaGraphInfo>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }

/** @ingroup libgdammEnums */
inline MetaGraphInfo& operator&=(MetaGraphInfo& lhs, MetaGraphInfo rhs)
  { return (lhs = static_cast<MetaGraphInfo>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }

/** @ingroup libgdammEnums */
inline MetaGraphInfo& operator^=(MetaGraphInfo& lhs, MetaGraphInfo rhs)
  { return (lhs = static_cast<MetaGraphInfo>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }

} // namespace Gda

} // namespace Gnome


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gnome::Gda::MetaGraphInfo> : public Glib::Value_Flags<Gnome::Gda::MetaGraphInfo>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{
 

class MetaStore;

/** In-memory representation of some database objects.
 *
 * The Gda::MetaStruct object reads data from a Gda::MetaStore object and creates 
 * an easy to use in memory representation for some database objects. For example
 * one can easily analyse the columns of a table (or its foreign keys) using a 
 * Gda::MetaStruct.
 *
 * When created, the new Gda::MetaStruct object is empty (it does not have any 
 * information about any database object). Information about database objects is 
 * computed upon request using the gda_meta_struct_complement() method. Information 
 * about individual database objects is represented by GdaMetaDbObject structures, 
 * which can be obtained using get_db_object() or get_all_db_objects().
 * 
 * Note that the Gda::MetaDbObject structures may change or may be removed or 
 * replaced by others, so it not advised to keep pointers to these structures: 
 * pointers to these structures should be considered valid as long as 
 * complement() and other similar functions have not been called. 
 *
 * @ingroup Connection
 */

class MetaStruct : public Glib::Object
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef MetaStruct CppObjectType;
  typedef MetaStruct_Class CppClassType;
  typedef GdaMetaStruct BaseObjectType;
  typedef GdaMetaStructClass BaseClassType;

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

private:  friend class MetaStruct_Class;
  static CppClassType metastruct_class_;

protected:
  explicit MetaStruct(const Glib::ConstructParams& construct_params);
  explicit MetaStruct(GdaMetaStruct* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:

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

  virtual ~MetaStruct() 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.
  GdaMetaStruct*       gobj()       { return reinterpret_cast<GdaMetaStruct*>(gobject_); }

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

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

private:

protected:
    explicit MetaStruct(const Glib::RefPtr<MetaStore>& meta_store, MetaStructFeature features);


public:
  
  static Glib::RefPtr<MetaStruct> create(const Glib::RefPtr<MetaStore>& store, MetaStructFeature features =  META_STRUCT_FEATURE_ALL);

  
  //TODO: Wrap GdaMetaDbObject?
  
  /** Creates a new Gda::MetaDbObject structure in @a mstruct to represent the database object (of type @a type)
   * which can be uniquely identified as @a catalog. @a schema. @a name.
   * 
   * If @a catalog is not <tt>0</tt>, then @a schema should not be <tt>0</tt>.
   * 
   * If both @a catalog and @a schema are <tt>0</tt>, then the database object will be the one which is
   * "visible" by default (that is which can be accessed only by its short @a name name).
   * 
   * If @a catalog is <tt>0</tt> and @a schema is not <tt>0</tt>, then the database object will be the one which 
   * can be accessed by its @a schema. @a name name.
   * 
   * Important note: @a catalog, @a schema and @a name will be used using the following convention:
   * - be surrounded by double quotes for a case sensitive search
   * - otherwise for case insensitive search
   * 
   * For more information, see the 
   * meta data section about SQL identifiers.
   * 
   * @param type The type of object to add (which can be GDA_META_DB_UNKNOWN).
   * @param catalog The catalog the object belongs to (as a G_TYPE_STRING GValue), or <tt>0</tt>.
   * @param schema The schema the object belongs to (as a G_TYPE_STRING GValue), or <tt>0</tt>.
   * @param name The object's name (as a G_TYPE_STRING GValue), not <tt>0</tt>.
   * @return The Gda::MetaDbObject corresponding to the database object if no error occurred, or <tt>0</tt>.
   */
  GdaMetaDbObject* complement(MetaDbObjectType type, const Value& catalog, const Value& schema, const Value& name);
  
  /** This method is similar to complement() but creates Gda::MetaDbObject for all the
   * database object which are in the @a schema schema (and in the @a catalog catalog).
   * If @a catalog is <tt>0</tt>, then any catalog will be used, and
   * if @a schema is <tt>0</tt> then any schema will be used (if @a schema is <tt>0</tt> then catalog must also be <tt>0</tt>).
   * 
   * Please refer to complement() form more information.
   * 
   * @param catalog Name of a catalog, or <tt>0</tt>.
   * @param schema Name of a schema, or <tt>0</tt>.
   * @return <tt>true</tt> if no error occurred.
   */
  bool complement_schema(const Value& catalog, const Value& schema);
  
  /** This method is similar to complement() and complement_all()
   * but creates Gda::MetaDbObject for all the
   * database object which are usable using only their short name (that is which do not need to be prefixed by 
   * the schema in which they are to be used).
   * 
   * Please refer to complement() form more information.
   * 
   * @return <tt>true</tt> if no error occurred.
   */
  bool complement_default();
   // private API   

  
  /** Reorders the list of database objects within @a mstruct in a way specified by @a sort_type.
   * 
   * @param sort_type The kind of sorting requested.
   * @return <tt>true</tt> if no error occurred.
   */
  bool sort_db_object(MetaSortType sort_type);
    
  /** Tries to locate the Gda::MetaDbObject structure representing the database object named after
   *  @a catalog, @a schema and @a name.
   * 
   * If one or both of @a catalog and @a schema are <tt>0</tt>, and more than one database object matches the name, then
   * the return value is also <tt>0</tt>.
   * 
   * @param catalog The catalog the object belongs to (as a G_TYPE_STRING GValue), or <tt>0</tt>.
   * @param schema The schema the object belongs to (as a G_TYPE_STRING GValue), or <tt>0</tt>.
   * @param name The object's name (as a G_TYPE_STRING GValue), not <tt>0</tt>.
   * @return The Gda::MetaDbObject or <tt>0</tt> if not found.
   */
  GdaMetaDbObject* get_db_object(const Value& catalog, const Value& schema, const Value& name);

  //TODO: Wrap GdaMetaTable and GdaMetaDbObject? They seem to be bare C structs.
  //http://library.gnome.org/devel/libgda/unstable/GdaMetaStruct.html#GdaMetaTable
  
  GdaMetaTableColumn* get_table_column(GdaMetaTable* table, const Value& col_name);
  
  /** Creates a new graph (in the GraphViz syntax) representation of @a mstruct.
   * 
   * @param info Informs what kind of information to show in the resulting graph.
   * @return A new string, or <tt>0</tt> if an error occurred.
   */
  Glib::ustring dump_as_graph(MetaGraphInfo info);
  
  
  /** This method is similar to complement() and complement_default()
   * but creates Gda::MetaDbObject for all the database object.
   * 
   * Please refer to complement() form more information.
   * 
   * @return <tt>true</tt> if no error occurred.
   */
  bool complement_all();
    
  // TODO: Use C++ type.
  // See http://bugzilla.gnome.org/show_bug.cgi?id=574740
  
  /** Get a list of all the Gda::MetaDbObject structures representing database objects in @a mstruct. Note that
   * no Gda::MetaDbObject structure must not be modified.
   * 
   * @return A new SList list of pointers to Gda::MetaDbObject structures which must be destroyed after usage using Glib::slist_free(). The individual Gda::MetaDbObject must not be modified.
   */
  GSList* get_all_db_objects();
    
  //Ignore private functions.
  //gtkmmproc error: gda_meta_struct_load_from_xml_file : ignored method defs lookup failed//gtkmmproc error: gda_meta_struct_add_db_object : ignored method defs lookup failed
  
  /** 
   *
   * @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_features() 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::MetaStruct
   */
  Glib::RefPtr<Gnome::Gda::MetaStruct> wrap(GdaMetaStruct* object, bool take_copy = false);
}


#endif /* _LIBGDAMM_METASTRUCT_H */