Re: [gnome-db] Making a field mandatory in a form/grid



On 2/1/07, Murray Cumming <murrayc murrayc com> wrote:
On Wed, 2007-01-31 at 22:45 +0100, Johannes Schmid wrote:
> Hi Vivien!
>
> Well, the docs are quite confusing in this point because they just
> mention that the parameter cannot be "0" if set_not_null(TRUE) was
> called. Anyway an empty string is usually non-NULL (especially in a C++
> context).

There is no concept of a NULL std::string in C++. Either string.empty()
is true or it's not - there's nothing in between.

>  Maybe the docs and the method name could be improved.

For strings, NULLness is not very interesting. It's a concept from SQL
that isn't useful in an API.

Or do you have an example of a situation in which it is useful for the
application to distinguish between empty-string and NULL for a text
field? How would the application (or libgnomedb) show this distinction?

In Libgda, a NULL value is either represented using the NULL pointer,
or a GValue where all the attributes are 0. A Libgnomedb data entry or
data cell renderer will simply display an empty string (so no
difference with an empty string there); and if the actions are shown,
then the user will notice that the value is actually NULL.

Vivien



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