This file is indexed.

/usr/include/libgdamm-5.0/libgdamm/datahandler.h is in libgdamm5.0-dev 4.99.6-0ubuntu3.

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
// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _LIBGDAMM_DATAHANDLER_H
#define _LIBGDAMM_DATAHANDLER_H


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

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

/* datahandler.h
 *
 * Copyright 2003 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 <glibmm/interface.h>
#include <libgdamm/value.h>
#include <libgda/gda-data-handler.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GdaDataHandler GdaDataHandler;
typedef struct _GdaDataHandlerClass GdaDataHandlerClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace Gda
{ class DataHandler_Class; } // namespace Gda

} // namespace Gnome
namespace Gnome
{

namespace Gda
{

/** @defgroup DataHandlers Data Handlers
 */

/** Base class which provides data handling capabilities.
 *
 * Because data types vary a lot from one DBMS to another, the DataHandler interface helps with designing modules 
 * which can handle very specific pieces of data through plugins. Each object which imlements the DataHandler interface 
 * is expected to handle a subset of the possible libgda defined data types.
 * 
 * The DataHandler object can convert a Value to and from both SQL and 'STR'. The SQL representation of a value is the 
 * actual string which would be used in an SQL statement (for example a string's SQL representation is surrounded by 
 * quotes such as 'that\s a string''). The 'STR' representation is a human-readable representation of a value appropriate 
 * for the user's current locale. The 'STR' respresentation of a string is simply the original string without quotes but 
 * a numerical value or date, for instance, will be formatted according to the user's current locale.
 * 
 * Only one object which implements this interface is needed for any given data type, and it mainly contains some methods 
 * to manage values (as Value structures). The Gnome::Db::DataEntry interface is complementary to this one since it is 
 * implemented by widgets in which the user can enter or modify some data. 
 *
 * @ingroup DataHandlers
 */

class DataHandler : public Glib::Interface
{
  
#ifndef DOXYGEN_SHOULD_SKIP_THIS

public:
  typedef DataHandler CppObjectType;
  typedef DataHandler_Class CppClassType;
  typedef GdaDataHandler BaseObjectType;
  typedef GdaDataHandlerIface BaseClassType;

private:
  friend class DataHandler_Class;
  static CppClassType datahandler_class_;

  // noncopyable
  DataHandler(const DataHandler&);
  DataHandler& operator=(const DataHandler&);

protected:
  DataHandler(); // you must derive from this class

  /** Called by constructors of derived classes. Provide the result of 
   * the Class init() function to ensure that it is properly 
   * initialized.
   * 
   * @param interface_class The Class object for the derived type.
   */
  explicit DataHandler(const Glib::Interface_Class& interface_class);

public:
  // This is public so that C++ wrapper instances can be
  // created for C instances of unwrapped types.
  // For instance, if an unexpected C type implements the C interface. 
  explicit DataHandler(GdaDataHandler* castitem);

protected:
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:
  virtual ~DataHandler();

  static void add_interface(GType gtype_implementer);

#ifndef DOXYGEN_SHOULD_SKIP_THIS
  static GType get_type()      G_GNUC_CONST;
  static GType get_base_type() G_GNUC_CONST;
#endif

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

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

private:

public:

  
  /** Creates a new string which is an SQL representation of the given value, the returned string
   * can be used directly in an SQL statement. For example if @a value is a G_TYPE_STRING, then
   * the returned string will be correctly quoted. Note however that it is a better practice
   * to use variables in statements instead of value literals, see
   * the GdaSqlParser for more information.
   * 
   * If the value is <tt>0</tt> or is of type GDA_TYPE_<tt>0</tt>, the returned string is "<tt>0</tt>".
   * @param value The value to be converted to a string.
   * @return The new string, or <tt>0</tt> if an error occurred.
   */
  Glib::ustring get_sql_from_value(const Value& value) const;
  
  /** Creates a new string which is a "user friendly" representation of the given value
   * (in the user's locale, specially for the dates). If the value is 
   * <tt>0</tt> or is of type GDA_TYPE_<tt>0</tt>, the returned string is a copy of "" (empty string).
   * @param value The value to be converted to a string.
   * @return The new string, or <tt>0</tt> if an error occurred.
   */
  Glib::ustring get_str_from_value(const Value& value) const;

  
  /** Creates a new GValue which represents the SQL value given as argument. This is
   * the opposite of the function get_sql_from_value(). The type argument
   * is used to determine the real data type requested for the returned value.
   * 
   * If the sql string is <tt>0</tt>, then the returned GValue is of type GDA_TYPE_<tt>0</tt>;
   * if the sql string does not correspond to a valid SQL string for the requested type, then
   * the "<tt>0</tt>" string is returned.
   * @param sql An SQL string.
   * @param type A GType.
   * @return The new GValue or <tt>0</tt> on error.
   */
  Value get_value_from_sql(const Glib::ustring& sql, GType type) const;
  
  /** Creates a new GValue which represents the STR value given as argument. This is
   * the opposite of the function get_str_from_value(). The type argument
   * is used to determine the real data type requested for the returned value.
   * 
   * If the str string is <tt>0</tt>, then the returned GValue is of type GDA_TYPE_<tt>0</tt>;
   * if the str string does not correspond to a valid STR string for the requested type, then
   * <tt>0</tt> is returned.
   * @param str A string.
   * @param type A GType.
   * @return The new GValue or <tt>0</tt> on error.
   */
  Value get_value_from_str(const Glib::ustring& sql, GType type) const;
  
  /** Creates a new GValue which holds a sane initial value to be used if no value is specifically
   * provided. For example for a simple string, this would return a new value containing the "" string.
   * @param type A GTYpe.
   * @return The new GValue, or <tt>0</tt> if no such value can be created.
   */
  Value get_sane_init_value(GType type) const;

  
  /** Checks wether the GdaDataHandler is able to handle the gda type given as argument.
   * @param type A Type.
   * @return <tt>true</tt> if the gda type can be handled.
   */
  bool accepts_g_type(GType type) const;
  
  /** Get a short description of the GdaDataHandler
   * @return The description.
   */
  Glib::ustring get_descr() const;

protected:

  //We don't wrap the vfuncs because they are only useful for implementation of libgda itself,
  //and they have a high code-size and per-object memory cost. murrayc


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::DataHandler
   */
  Glib::RefPtr<Gnome::Gda::DataHandler> wrap(GdaDataHandler* object, bool take_copy = false);

} // namespace Glib


#endif /* _LIBGDAMM_DATAHANDLER_H */