alternative to assert
[gtkD.git] / gtkD / srcgda / gda / Value.d
blob6388a88d2dfea2c83d6e2a7d7f44c5329f3a9812
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = libgda-gda-value.html
26 * outPack = gda
27 * outFile = Value
28 * strct = GdaValue
29 * realStrct=
30 * ctorStrct=
31 * clss = Value
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gda_value_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * - gda_value_new_boolean
44 * - gda_value_new_timestamp_from_timet
45 * - gda_value_new_tinyint
46 * - gda_value_new_tinyuint
47 * - gda_value_new_uinteger
48 * imports:
49 * - gobject.ObjectG
50 * structWrap:
51 * - GObject* -> ObjectG
52 * - GdaValue* -> Value
53 * module aliases:
54 * local aliases:
57 module gda.Value;
59 version(noAssert)
61 version(Tango)
63 import tango.io.Stdout; // use the tango loging?
67 private import gdac.gdatypes;
69 private import gdac.gda;
72 private import gobject.ObjectG;
77 /**
78 * Description
80 public class Value
83 /** the main Gtk struct */
84 protected GdaValue* gdaValue;
87 public GdaValue* getValueStruct()
89 return gdaValue;
93 /** the main Gtk struct as a void* */
94 protected void* getStruct()
96 return cast(void*)gdaValue;
99 /**
100 * Sets our main struct and passes it to the parent class
102 public this (GdaValue* gdaValue)
104 version(noAssert)
106 if ( gdaValue is null )
108 int zero = 0;
109 version(Tango)
111 Stdout("struct gdaValue is null on constructor").newline;
113 else
115 printf("struct gdaValue is null on constructor");
117 zero = zero / zero;
120 else
122 assert(gdaValue !is null, "struct gdaValue is null on constructor");
124 this.gdaValue = gdaValue;
127 public this (bool val)
129 // GdaValue* gda_value_new_boolean (gboolean val);
130 this(cast(GdaValue*)gda_value_new_boolean(val) );
148 * Returns :
150 public static GType getGtype()
152 // GType gda_value_get_gtype (void);
153 return gda_value_get_gtype();
157 * Makes a new GdaValue of type GDA_VALUE_TYPE_NULL.
158 * Returns :
159 * the newly created GdaValue.
161 public this ()
163 // GdaValue* gda_value_new_null (void);
164 this(cast(GdaValue*)gda_value_new_null() );
168 * Makes a new GdaValue of type GDA_VALUE_TYPE_BIGINT with value val.
169 * val :
170 * value to set for the new GdaValue.
171 * Returns :
172 * the newly created GdaValue.
174 public this (long val)
176 // GdaValue* gda_value_new_bigint (gint64 val);
177 this(cast(GdaValue*)gda_value_new_bigint(val) );
181 * Makes a new GdaValue of type GDA_VALUE_TYPE_BIGUINT with value val.
182 * val :
183 * value to set for the new GdaValue.
184 * Returns :
185 * the newly created GdaValue.
187 public this (ulong val)
189 // GdaValue* gda_value_new_biguint (guint64 val);
190 this(cast(GdaValue*)gda_value_new_biguint(val) );
194 * Makes a new GdaValue of type GDA_VALUE_TYPE_BINARY with value val.
195 * val :
196 * value to set for the new GdaValue.
197 * size :
198 * the size of the memory pool pointer to by val.
199 * Returns :
200 * the newly created GdaValue.
202 public this (void* val, int size)
204 // GdaValue* gda_value_new_binary (gconstpointer val, glong size);
205 this(cast(GdaValue*)gda_value_new_binary(val, size) );
209 * val :
210 * Returns :
212 public this (GdaBlob* val)
214 // GdaValue* gda_value_new_blob (const GdaBlob *val);
215 this(cast(GdaValue*)gda_value_new_blob(val) );
220 * Makes a new GdaValue of type GDA_VALUE_TYPE_DATE with value val.
221 * val :
222 * value to set for the new GdaValue.
223 * Returns :
224 * the newly created GdaValue.
226 public this (GdaDate* val)
228 // GdaValue* gda_value_new_date (const GdaDate *val);
229 this(cast(GdaValue*)gda_value_new_date(val) );
233 * Makes a new GdaValue of type GDA_VALUE_TYPE_DOUBLE with value val.
234 * val :
235 * value to set for the new GdaValue.
236 * Returns :
237 * the newly created GdaValue.
239 public this (double val)
241 // GdaValue* gda_value_new_double (gdouble val);
242 this(cast(GdaValue*)gda_value_new_double(val) );
246 * Makes a new GdaValue of type GDA_VALUE_TYPE_GEOMETRIC_POINT with value
247 * val.
248 * val :
249 * value to set for the new GdaValue.
250 * Returns :
251 * the newly created GdaValue.
253 public this (GdaGeometricPoint* val)
255 // GdaValue* gda_value_new_geometric_point (const GdaGeometricPoint *val);
256 this(cast(GdaValue*)gda_value_new_geometric_point(val) );
260 * Makes a new GdaValue of type GDA_VALUE_TYPE_GOBJECT with value val.
261 * val :
262 * value to set for the new GdaValue.
263 * Returns :
264 * the newly created GdaValue.
266 public this (ObjectG val)
268 // GdaValue* gda_value_new_gobject (const GObject *val);
269 this(cast(GdaValue*)gda_value_new_gobject((val is null) ? null : val.getObjectGStruct()) );
273 * Makes a new GdaValue of type GDA_VALUE_TYPE_INTEGER with value val.
274 * val :
275 * value to set for the new GdaValue.
276 * Returns :
277 * the newly created GdaValue.
279 public this (int val)
281 // GdaValue* gda_value_new_integer (gint val);
282 this(cast(GdaValue*)gda_value_new_integer(val) );
286 * Makes a new GdaValue of type GDA_VALUE_TYPE_LIST with value val.
287 * val :
288 * value to set for the new GdaValue.
289 * Returns :
290 * the newly created GdaValue.
292 public this (GdaValueList* val)
294 // GdaValue* gda_value_new_list (const GdaValueList *val);
295 this(cast(GdaValue*)gda_value_new_list(val) );
299 * val :
300 * Returns :
302 public this (GdaMoney* val)
304 // GdaValue* gda_value_new_money (const GdaMoney *val);
305 this(cast(GdaValue*)gda_value_new_money(val) );
309 * Makes a new GdaValue of type GDA_VALUE_TYPE_NUMERIC with value val.
310 * val :
311 * value to set for the new GdaValue.
312 * Returns :
313 * the newly created GdaValue.
315 public this (GdaNumeric* val)
317 // GdaValue* gda_value_new_numeric (const GdaNumeric *val);
318 this(cast(GdaValue*)gda_value_new_numeric(val) );
322 * Makes a new GdaValue of type GDA_VALUE_TYPE_SINGLE with value val.
323 * val :
324 * value to set for the new GdaValue.
325 * Returns :
326 * the newly created GdaValue.
328 public this (float val)
330 // GdaValue* gda_value_new_single (gfloat val);
331 this(cast(GdaValue*)gda_value_new_single(val) );
335 * Makes a new GdaValue of type GDA_VALUE_TYPE_SMALLINT with value val.
336 * val :
337 * value to set for the new GdaValue.
338 * Returns :
339 * the newly created GdaValue.
341 public this (short val)
343 // GdaValue* gda_value_new_smallint (gshort val);
344 this(cast(GdaValue*)gda_value_new_smallint(val) );
348 * Makes a new GdaValue of type GDA_VALUE_TYPE_SMALLUINT with value val.
349 * val :
350 * value to set for the new GdaValue.
351 * Returns :
352 * the newly created GdaValue.
354 public this (ushort val)
356 // GdaValue* gda_value_new_smalluint (gushort val);
357 this(cast(GdaValue*)gda_value_new_smalluint(val) );
361 * Makes a new GdaValue of type GDA_VALUE_TYPE_STRING with value val.
362 * val :
363 * value to set for the new GdaValue.
364 * Returns :
365 * the newly created GdaValue.
367 public this (char[] val)
369 // GdaValue* gda_value_new_string (const gchar *val);
370 this(cast(GdaValue*)gda_value_new_string(Str.toStringz(val)) );
374 * Makes a new GdaValue of type GDA_VALUE_TYPE_TIME with value val.
375 * val :
376 * value to set for the new GdaValue.
377 * Returns :
378 * the newly created GdaValue.
380 public this (GdaTime* val)
382 // GdaValue* gda_value_new_time (const GdaTime *val);
383 this(cast(GdaValue*)gda_value_new_time(val) );
387 * Makes a new GdaValue of type GDA_VALUE_TYPE_TIMESTAMP with value val.
388 * val :
389 * value to set for the new GdaValue.
390 * Returns :
391 * the newly created GdaValue.
393 public this (GdaTimestamp* val)
395 // GdaValue* gda_value_new_timestamp (const GdaTimestamp *val);
396 this(cast(GdaValue*)gda_value_new_timestamp(val) );
403 * Makes a new GdaValue of type GDA_VALUE_TYPE_TYPE with value val.
404 * val :
405 * Value to set for the new GdaValue.
406 * Returns :
407 * the newly created GdaValue.
409 public this (GdaValueType val)
411 // GdaValue* gda_value_new_type (GdaValueType val);
412 this(cast(GdaValue*)gda_value_new_type(val) );
417 * Makes a new GdaValue of type type from its string representation.
418 * as_string :
419 * stringified representation of the value.
420 * type :
421 * the new value type.
422 * Returns :
423 * the newly created GdaValue or NULL if the string representation
424 * cannot be converted to the specified type.
426 public this (char[] asString, GdaValueType type)
428 // GdaValue* gda_value_new_from_string (const gchar *as_string, GdaValueType type);
429 this(cast(GdaValue*)gda_value_new_from_string(Str.toStringz(asString), type) );
433 * Creates a GdaValue from a XML representation of it. That XML
434 * node corresponds to the following string representation:
435 * lt;value type="gdatype"gt;valuelt;/valuegt;
436 * node :
437 * a XML node representing the value.
438 * Returns :
439 * the newly created GdaValue.
441 public this (xmlNodePtr node)
443 // GdaValue* gda_value_new_from_xml (const xmlNodePtr node);
444 this(cast(GdaValue*)gda_value_new_from_xml(node) );
448 * Deallocates all memory associated to a GdaValue.
449 * value :
450 * the resource to free.
452 public void free()
454 // void gda_value_free (GdaValue *value);
455 gda_value_free(gdaValue);
459 * Retrieves the type of the given value.
460 * value :
461 * value to get the type from.
462 * Returns :
463 * the GdaValueType of the value.
465 public GdaValueType getType()
467 // GdaValueType gda_value_get_type (GdaValue *value);
468 return gda_value_get_type(gdaValue);
473 * Tests if a given value is of type GDA_VALUE_TYPE_NULL.
474 * value :
475 * value to test.
476 * Returns :
477 * a boolean that says whether or not value is of type
478 * GDA_VALUE_TYPE_NULL.
480 public int isNull()
482 // gboolean gda_value_is_null (GdaValue *value);
483 return gda_value_is_null(gdaValue);
487 * Gets whether the value stored in the given GdaValue is of
488 * numeric type or not.
489 * value :
490 * a GdaValue.
491 * Returns :
492 * TRUE if a number, FALSE otherwise.
494 public int isNumber()
496 // gboolean gda_value_is_number (GdaValue *value);
497 return gda_value_is_number(gdaValue);
501 * Creates a new GdaValue from an existing one.
502 * value :
503 * value to get a copy from.
504 * Returns :
505 * a newly allocated GdaValue with a copy of the data in value.
507 public Value copy()
509 // GdaValue* gda_value_copy (GdaValue *value);
510 return new Value( gda_value_copy(gdaValue) );
514 * Gets the value stored in value.
515 * value :
516 * a GdaValue whose value we want to get.
517 * Returns :
518 * the value contained in value.
520 public long getBigint()
522 // gint64 gda_value_get_bigint (GdaValue *value);
523 return gda_value_get_bigint(gdaValue);
527 * Stores val into value.
528 * value :
529 * a GdaValue that will store val.
530 * val :
531 * value to be stored in value.
533 public void setBigint(long val)
535 // void gda_value_set_bigint (GdaValue *value, gint64 val);
536 gda_value_set_bigint(gdaValue, val);
540 * value :
541 * a GdaValue whose value we want to get.
542 * Returns :
543 * the value stored in value.
545 public ulong getBiguint()
547 // guint64 gda_value_get_biguint (GdaValue *value);
548 return gda_value_get_biguint(gdaValue);
552 * Stores val into value.
553 * value :
554 * a GdaValue that will store val.
555 * val :
556 * value to be stored in value.
558 public void setBiguint(ulong val)
560 // void gda_value_set_biguint (GdaValue *value, guint64 val);
561 gda_value_set_biguint(gdaValue, val);
565 * value :
566 * a GdaValue whose value we want to get.
567 * size :
568 * holder for length of data.
569 * Returns :
570 * the value stored in value.
572 public void* getBinary(int* size)
574 // const gpointer gda_value_get_binary (GdaValue *value, glong *size);
575 return gda_value_get_binary(gdaValue, size);
579 * Stores val into value.
580 * value :
581 * a GdaValue that will store val.
582 * val :
583 * value to be stored in value.
584 * size :
585 * the size of the memory pool pointed to by val.
587 public void setBinary(void* val, int size)
589 // void gda_value_set_binary (GdaValue *value, gconstpointer val, glong size);
590 gda_value_set_binary(gdaValue, val, size);
594 * value :
595 * a GdaValue whose value we want to get.
596 * Returns :
597 * the value stored in value.
599 public GdaBlob* getBlob()
601 // const GdaBlob* gda_value_get_blob (GdaValue *value);
602 return gda_value_get_blob(gdaValue);
606 * Stores val into value.
607 * value :
608 * a GdaValue that will store val.
609 * val :
610 * value to be stored in value.
612 public void setBlob(GdaBlob* val)
614 // void gda_value_set_blob (GdaValue *value, const GdaBlob *val);
615 gda_value_set_blob(gdaValue, val);
619 * value :
620 * a GdaValue whose value we want to get.
621 * Returns :
622 * the value stored in value.
624 public int getBoolean()
626 // gboolean gda_value_get_boolean (GdaValue *value);
627 return gda_value_get_boolean(gdaValue);
631 * Stores val into value.
632 * value :
633 * a GdaValue that will store val.
634 * val :
635 * value to be stored in value.
637 public void setBoolean(int val)
639 // void gda_value_set_boolean (GdaValue *value, gboolean val);
640 gda_value_set_boolean(gdaValue, val);
644 * value :
645 * a GdaValue whose value we want to get.
646 * Returns :
647 * the value stored in value.
649 public GdaDate* getDate()
651 // const GdaDate* gda_value_get_date (GdaValue *value);
652 return gda_value_get_date(gdaValue);
656 * Stores val into value.
657 * value :
658 * a GdaValue that will store val.
659 * val :
660 * value to be stored in value.
662 public void setDate(GdaDate* val)
664 // void gda_value_set_date (GdaValue *value, const GdaDate *val);
665 gda_value_set_date(gdaValue, val);
669 * value :
670 * a GdaValue whose value we want to get.
671 * Returns :
672 * the value stored in value.
674 public double getDouble()
676 // gdouble gda_value_get_double (GdaValue *value);
677 return gda_value_get_double(gdaValue);
681 * Stores val into value.
682 * value :
683 * a GdaValue that will store val.
684 * val :
685 * value to be stored in value.
687 public void setDouble(double val)
689 // void gda_value_set_double (GdaValue *value, gdouble val);
690 gda_value_set_double(gdaValue, val);
694 * value :
695 * a GdaValue whose value we want to get.
696 * Returns :
697 * the value stored in value.
699 public GdaGeometricPoint* getGeometricPoint()
701 // const GdaGeometricPoint* gda_value_get_geometric_point (GdaValue *value);
702 return gda_value_get_geometric_point(gdaValue);
706 * Stores val into value.
707 * value :
708 * a GdaValue that will store val.
709 * val :
710 * value to be stored in value.
712 public void setGeometricPoint(GdaGeometricPoint* val)
714 // void gda_value_set_geometric_point (GdaValue *value, const GdaGeometricPoint *val);
715 gda_value_set_geometric_point(gdaValue, val);
719 * value :
720 * a GdaValue whose value we want to get.
721 * Returns :
722 * the value stored in value.
724 public ObjectG getGobject()
726 // const GObject* gda_value_get_gobject (GdaValue *value);
727 return new ObjectG( gda_value_get_gobject(gdaValue) );
731 * Stores val into value.
732 * value :
733 * a GdaValue that will store val.
734 * val :
735 * value to be stored in value.
737 public void setGobject(ObjectG val)
739 // void gda_value_set_gobject (GdaValue *value, const GObject *val);
740 gda_value_set_gobject(gdaValue, (val is null) ? null : val.getObjectGStruct());
744 * value :
745 * a GdaValue whose value we want to get.
746 * Returns :
747 * the value stored in value.
749 public int getInteger()
751 // gint gda_value_get_integer (GdaValue *value);
752 return gda_value_get_integer(gdaValue);
756 * Stores val into value.
757 * value :
758 * a GdaValue that will store val.
759 * val :
760 * value to be stored in value.
762 public void setInteger(int val)
764 // void gda_value_set_integer (GdaValue *value, gint val);
765 gda_value_set_integer(gdaValue, val);
769 * value :
770 * a GdaValue whose value we want to get.
771 * Returns :
772 * the value stored in value.
774 public GdaValueList* getList()
776 // const GdaValueList* gda_value_get_list (GdaValue *value);
777 return gda_value_get_list(gdaValue);
781 * Stores val into value.
782 * value :
783 * a GdaValue that will store val.
784 * val :
785 * value to be stored in value.
787 public void setList(GdaValueList* val)
789 // void gda_value_set_list (GdaValue *value, const GdaValueList *val);
790 gda_value_set_list(gdaValue, val);
794 * Sets the type of value to GDA_VALUE_TYPE_NULL.
795 * value :
796 * a GdaValue that will store a value of type GDA_VALUE_TYPE_NULL.
798 public void setNull()
800 // void gda_value_set_null (GdaValue *value);
801 gda_value_set_null(gdaValue);
805 * value :
806 * a GdaValue whose value we want to get.
807 * Returns :
808 * the value stored in value.
810 public GdaMoney* getMoney()
812 // const GdaMoney* gda_value_get_money (GdaValue *value);
813 return gda_value_get_money(gdaValue);
817 * Stores val into value.
818 * value :
819 * a GdaValue that will store val.
820 * val :
821 * value to be stored in value.
823 public void setMoney(GdaMoney* val)
825 // void gda_value_set_money (GdaValue *value, const GdaMoney *val);
826 gda_value_set_money(gdaValue, val);
830 * value :
831 * a GdaValue whose value we want to get.
832 * Returns :
833 * the value stored in value.
835 public GdaNumeric* getNumeric()
837 // const GdaNumeric* gda_value_get_numeric (GdaValue *value);
838 return gda_value_get_numeric(gdaValue);
842 * Stores val into value.
843 * value :
844 * a GdaValue that will store val.
845 * val :
846 * value to be stored in value.
848 public void setNumeric(GdaNumeric* val)
850 // void gda_value_set_numeric (GdaValue *value, const GdaNumeric *val);
851 gda_value_set_numeric(gdaValue, val);
855 * value :
856 * a GdaValue whose value we want to get.
857 * Returns :
858 * the value stored in value.
860 public float getSingle()
862 // gfloat gda_value_get_single (GdaValue *value);
863 return gda_value_get_single(gdaValue);
867 * Stores val into value.
868 * value :
869 * a GdaValue that will store val.
870 * val :
871 * value to be stored in value.
873 public void setSingle(float val)
875 // void gda_value_set_single (GdaValue *value, gfloat val);
876 gda_value_set_single(gdaValue, val);
880 * value :
881 * a GdaValue whose value we want to get.
882 * Returns :
883 * the value stored in value.
885 public short getSmallint()
887 // gshort gda_value_get_smallint (GdaValue *value);
888 return gda_value_get_smallint(gdaValue);
892 * Stores val into value.
893 * value :
894 * a GdaValue that will store val.
895 * val :
896 * value to be stored in value.
898 public void setSmallint(short val)
900 // void gda_value_set_smallint (GdaValue *value, gshort val);
901 gda_value_set_smallint(gdaValue, val);
905 * value :
906 * a GdaValue whose value we want to get.
907 * Returns :
908 * the value stored in value.
910 public ushort getSmalluint()
912 // gushort gda_value_get_smalluint (GdaValue *value);
913 return gda_value_get_smalluint(gdaValue);
917 * Stores val into value.
918 * value :
919 * a GdaValue that will store val.
920 * val :
921 * value to be stored in value.
923 public void setSmalluint(ushort val)
925 // void gda_value_set_smalluint (GdaValue *value, gushort val);
926 gda_value_set_smalluint(gdaValue, val);
930 * value :
931 * a GdaValue whose value we want to get.
932 * Returns :
933 * the value stored in value.
935 public char[] getString()
937 // const gchar* gda_value_get_string (GdaValue *value);
938 return Str.toString(gda_value_get_string(gdaValue) );
942 * Stores val into value.
943 * value :
944 * a GdaValue that will store val.
945 * val :
946 * value to be stored in value.
948 public void setString(char[] val)
950 // void gda_value_set_string (GdaValue *value, const gchar *val);
951 gda_value_set_string(gdaValue, Str.toStringz(val));
955 * value :
956 * a GdaValue whose value we want to get.
957 * Returns :
958 * the value stored in value.
960 public GdaTime* getTime()
962 // const GdaTime* gda_value_get_time (GdaValue *value);
963 return gda_value_get_time(gdaValue);
967 * Stores val into value.
968 * value :
969 * a GdaValue that will store val.
970 * val :
971 * value to be stored in value.
973 public void setTime(GdaTime* val)
975 // void gda_value_set_time (GdaValue *value, const GdaTime *val);
976 gda_value_set_time(gdaValue, val);
980 * value :
981 * a GdaValue whose value we want to get.
982 * Returns :
983 * the value stored in value.
985 public GdaTimestamp* getTimestamp()
987 // const GdaTimestamp* gda_value_get_timestamp (GdaValue *value);
988 return gda_value_get_timestamp(gdaValue);
992 * Stores val into value.
993 * value :
994 * a GdaValue that will store val.
995 * val :
996 * value to be stored in value.
998 public void setTimestamp(GdaTimestamp* val)
1000 // void gda_value_set_timestamp (GdaValue *value, const GdaTimestamp *val);
1001 gda_value_set_timestamp(gdaValue, val);
1005 * value :
1006 * a GdaValue whose value we want to get.
1007 * Returns :
1008 * the value stored in value.
1010 public char getTinyint()
1012 // gchar gda_value_get_tinyint (GdaValue *value);
1013 return gda_value_get_tinyint(gdaValue);
1017 * Stores val into value.
1018 * value :
1019 * a GdaValue that will store val.
1020 * val :
1021 * value to be stored in value.
1023 public void setTinyint(char val)
1025 // void gda_value_set_tinyint (GdaValue *value, gchar val);
1026 gda_value_set_tinyint(gdaValue, val);
1030 * value :
1031 * a GdaValue whose value we want to get.
1032 * Returns :
1033 * the value stored in value.
1035 public char getTinyuint()
1037 // guchar gda_value_get_tinyuint (GdaValue *value);
1038 return gda_value_get_tinyuint(gdaValue);
1042 * Stores val into value.
1043 * value :
1044 * a GdaValue that will store val.
1045 * val :
1046 * value to be stored in value.
1048 public void setTinyuint(char val)
1050 // void gda_value_set_tinyuint (GdaValue *value, guchar val);
1051 gda_value_set_tinyuint(gdaValue, val);
1055 * value :
1056 * a GdaValue whose value we want to get.
1057 * Returns :
1058 * the value stored in value.
1060 public uint getUinteger()
1062 // guint gda_value_get_uinteger (GdaValue *value);
1063 return gda_value_get_uinteger(gdaValue);
1067 * Stores val into value.
1068 * value :
1069 * a GdaValue that will store val.
1070 * val :
1071 * value to be stored in value.
1073 public void setUinteger(uint val)
1075 // void gda_value_set_uinteger (GdaValue *value, guint val);
1076 gda_value_set_uinteger(gdaValue, val);
1080 * value :
1081 * a GdaValue whose value we want to get.
1082 * Returns :
1083 * the value stored in value.
1085 public GdaValueType getVtype()
1087 // GdaValueType gda_value_get_vtype (GdaValue *value);
1088 return gda_value_get_vtype(gdaValue);
1092 * Stores type into value.
1093 * value :
1094 * a GdaValue that will store type.
1095 * type :
1096 * value to be stored in value.
1098 public void setVtype(GdaValueType type)
1100 // void gda_value_set_vtype (GdaValue *value, GdaValueType type);
1101 gda_value_set_vtype(gdaValue, type);
1105 * Stores the value data from its string representation as type.
1106 * value :
1107 * a GdaValue that will store val.
1108 * as_string :
1109 * the stringified representation of the value.
1110 * type :
1111 * the type of the value
1112 * Returns :
1113 * TRUE if the value has been properly converted to type from
1114 * its string representation. FALSE otherwise.
1116 public int setFromString(char[] asString, GdaValueType type)
1118 // gboolean gda_value_set_from_string (GdaValue *value, const gchar *as_string, GdaValueType type);
1119 return gda_value_set_from_string(gdaValue, Str.toStringz(asString), type);
1123 * Sets the value of a GdaValue from another GdaValue. This
1124 * is different from gda_value_copy, which creates a new GdaValue.
1125 * gda_value_set_from_value, on the other hand, copies the contents
1126 * of copy into value, which must already be allocated.
1127 * value :
1128 * a GdaValue.
1129 * from :
1130 * the value to copy from.
1131 * Returns :
1132 * TRUE if successful, FALSE otherwise.
1134 public int setFromValue(Value from)
1136 // gboolean gda_value_set_from_value (GdaValue *value, const GdaValue *from);
1137 return gda_value_set_from_value(gdaValue, (from is null) ? null : from.getValueStruct());
1141 * Compares two values of the same type.
1142 * value1 :
1143 * a GdaValue to compare.
1144 * value2 :
1145 * the other GdaValue to be compared to value1.
1146 * Returns :
1147 * if both values have the same type, returns 0 if both contain
1148 * the same value, an integer less than 0 if value1 is less than value2 or
1149 * an integer greater than 0 if value1 is greater than value2.
1151 public int compare(Value value2)
1153 // gint gda_value_compare (GdaValue *value1, GdaValue *value2);
1154 return gda_value_compare(gdaValue, (value2 is null) ? null : value2.getValueStruct());
1158 * Converts a GdaValue to its string representation as indicated by this
1159 * table:
1160 * value :
1161 * a GdaValue.
1162 * Returns :
1163 * a string formatted according to the printf() style indicated in
1164 * the preceding table. Free the value with a g_free() when you've finished
1165 * using it.
1167 public char[] stringify()
1169 // gchar* gda_value_stringify (GdaValue *value);
1170 return Str.toString(gda_value_stringify(gdaValue) );
1174 * Serializes the given GdaValue to a XML node string.
1175 * value :
1176 * a GdaValue.
1177 * Returns :
1178 * the XML node. Once not needed anymore, you should free it.
1180 public xmlNodePtr toXml()
1182 // xmlNodePtr gda_value_to_xml (GdaValue *value);
1183 return gda_value_to_xml(gdaValue);