Re: [gnome-db] gda_data_model_update_row syntax



> yes. But how do we fix the API to allow both read-only and updatable
> objects without having 2 sets of functions? That's what I'm talking
> about.

We don't need two complete sets of functions.  As far as I can think
of, we only need two gda_row_get_value.

Our trouble with 'const' is actually that we've been using enough
const in our API.  Take gda-row.h for example, all the following
functions should have been declared with const GdaRow*.

  gda_row_get_model,
  gda_row_get_number,
  gda_row_get_id,
  gda_row_get_value,
  gda_row_get_length

Basically, most of the get_ functions should be declared with const
arguments.  This allows users to pass both const and non-const
instances.  Most set_ functions should be declared without const.

C standard library is a good examples.  We have both const char*, and
just char*.  Yet, we need only one set of string-related functions.

If you allow, I want to go through the API and insert 'const' where
they should have been.

Paisa




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]