1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = libgda-gda-value.html 27 * outPack = gda 28 * outFile = Value 29 * strct = GdaValue 30 * realStrct= 31 * ctorStrct= 32 * clss = Value 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gda_value_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * - gda_value_new_boolean 45 * - gda_value_new_timestamp_from_timet 46 * - gda_value_new_tinyint 47 * - gda_value_new_tinyuint 48 * - gda_value_new_uinteger 49 * omit signals: 50 * imports: 51 * - glib.Str 52 * - gobject.ObjectG 53 * structWrap: 54 * - GObject* -> ObjectG 55 * - GdaValue* -> Value 56 * module aliases: 57 * local aliases: 58 * overrides: 59 */ 60 61 module gda.Value; 62 63 public import gdac.gdatypes; 64 65 private import gdac.gda; 66 private import glib.ConstructionException; 67 private import gobject.ObjectG; 68 69 70 private import glib.Str; 71 private import gobject.ObjectG; 72 73 74 75 76 /** 77 * Description 78 */ 79 public class Value 80 { 81 82 /** the main Gtk struct */ 83 protected GdaValue* gdaValue; 84 85 86 public GdaValue* getValueStruct() 87 { 88 return gdaValue; 89 } 90 91 92 /** the main Gtk struct as a void* */ 93 protected void* getStruct() 94 { 95 return cast(void*)gdaValue; 96 } 97 98 /** 99 * Sets our main struct and passes it to the parent class 100 */ 101 public this (GdaValue* gdaValue) 102 { 103 this.gdaValue = gdaValue; 104 } 105 106 /** */ 107 public this (bool val) 108 { 109 // GdaValue* gda_value_new_boolean (gboolean val); 110 this(cast(GdaValue*)gda_value_new_boolean(val) ); 111 } 112 113 /** 114 */ 115 116 /** 117 * Returns: 118 */ 119 public static GType getGtype() 120 { 121 // GType gda_value_get_gtype (void); 122 return gda_value_get_gtype(); 123 } 124 125 /** 126 * Makes a new GdaValue of type GDA_VALUE_TYPE_NULL. 127 * Throws: ConstructionException GTK+ fails to create the object. 128 */ 129 public this () 130 { 131 // GdaValue* gda_value_new_null (void); 132 auto p = gda_value_new_null(); 133 if(p is null) 134 { 135 throw new ConstructionException("null returned by gda_value_new_null()"); 136 } 137 this(cast(GdaValue*) p); 138 } 139 140 /** 141 * Makes a new GdaValue of type GDA_VALUE_TYPE_BIGINT with value val. 142 * Params: 143 * val = value to set for the new GdaValue. 144 * Throws: ConstructionException GTK+ fails to create the object. 145 */ 146 public this (long val) 147 { 148 // GdaValue* gda_value_new_bigint (gint64 val); 149 auto p = gda_value_new_bigint(val); 150 if(p is null) 151 { 152 throw new ConstructionException("null returned by gda_value_new_bigint(val)"); 153 } 154 this(cast(GdaValue*) p); 155 } 156 157 /** 158 * Makes a new GdaValue of type GDA_VALUE_TYPE_BIGUINT with value val. 159 * Params: 160 * val = value to set for the new GdaValue. 161 * Throws: ConstructionException GTK+ fails to create the object. 162 */ 163 public this (ulong val) 164 { 165 // GdaValue* gda_value_new_biguint (guint64 val); 166 auto p = gda_value_new_biguint(val); 167 if(p is null) 168 { 169 throw new ConstructionException("null returned by gda_value_new_biguint(val)"); 170 } 171 this(cast(GdaValue*) p); 172 } 173 174 /** 175 * Makes a new GdaValue of type GDA_VALUE_TYPE_BINARY with value val. 176 * Params: 177 * val = value to set for the new GdaValue. 178 * size = the size of the memory pool pointer to by val. 179 * Throws: ConstructionException GTK+ fails to create the object. 180 */ 181 public this (void* val, glong size) 182 { 183 // GdaValue* gda_value_new_binary (gconstpointer val, glong size); 184 auto p = gda_value_new_binary(val, size); 185 if(p is null) 186 { 187 throw new ConstructionException("null returned by gda_value_new_binary(val, size)"); 188 } 189 this(cast(GdaValue*) p); 190 } 191 192 /** 193 * Params: 194 * Throws: ConstructionException GTK+ fails to create the object. 195 */ 196 public this (GdaBlob* val) 197 { 198 // GdaValue* gda_value_new_blob (const GdaBlob *val); 199 auto p = gda_value_new_blob(val); 200 if(p is null) 201 { 202 throw new ConstructionException("null returned by gda_value_new_blob(val)"); 203 } 204 this(cast(GdaValue*) p); 205 } 206 207 /** 208 * Makes a new GdaValue of type GDA_VALUE_TYPE_DATE with value val. 209 * Params: 210 * val = value to set for the new GdaValue. 211 * Throws: ConstructionException GTK+ fails to create the object. 212 */ 213 public this (GdaDate* val) 214 { 215 // GdaValue* gda_value_new_date (const GdaDate *val); 216 auto p = gda_value_new_date(val); 217 if(p is null) 218 { 219 throw new ConstructionException("null returned by gda_value_new_date(val)"); 220 } 221 this(cast(GdaValue*) p); 222 } 223 224 /** 225 * Makes a new GdaValue of type GDA_VALUE_TYPE_DOUBLE with value val. 226 * Params: 227 * val = value to set for the new GdaValue. 228 * Throws: ConstructionException GTK+ fails to create the object. 229 */ 230 public this (double val) 231 { 232 // GdaValue* gda_value_new_double (gdouble val); 233 auto p = gda_value_new_double(val); 234 if(p is null) 235 { 236 throw new ConstructionException("null returned by gda_value_new_double(val)"); 237 } 238 this(cast(GdaValue*) p); 239 } 240 241 /** 242 * Makes a new GdaValue of type GDA_VALUE_TYPE_GEOMETRIC_POINT with value 243 * val. 244 * Params: 245 * val = value to set for the new GdaValue. 246 * Throws: ConstructionException GTK+ fails to create the object. 247 */ 248 public this (GdaGeometricPoint* val) 249 { 250 // GdaValue* gda_value_new_geometric_point (const GdaGeometricPoint *val); 251 auto p = gda_value_new_geometric_point(val); 252 if(p is null) 253 { 254 throw new ConstructionException("null returned by gda_value_new_geometric_point(val)"); 255 } 256 this(cast(GdaValue*) p); 257 } 258 259 /** 260 * Makes a new GdaValue of type GDA_VALUE_TYPE_GOBJECT with value val. 261 * Params: 262 * val = value to set for the new GdaValue. 263 * Throws: ConstructionException GTK+ fails to create the object. 264 */ 265 public this (ObjectG val) 266 { 267 // GdaValue* gda_value_new_gobject (const GObject *val); 268 auto p = gda_value_new_gobject((val is null) ? null : val.getObjectGStruct()); 269 if(p is null) 270 { 271 throw new ConstructionException("null returned by gda_value_new_gobject((val is null) ? null : val.getObjectGStruct())"); 272 } 273 this(cast(GdaValue*) p); 274 } 275 276 /** 277 * Makes a new GdaValue of type GDA_VALUE_TYPE_INTEGER with value val. 278 * Params: 279 * val = value to set for the new GdaValue. 280 * Throws: ConstructionException GTK+ fails to create the object. 281 */ 282 public this (int val) 283 { 284 // GdaValue* gda_value_new_integer (gint val); 285 auto p = gda_value_new_integer(val); 286 if(p is null) 287 { 288 throw new ConstructionException("null returned by gda_value_new_integer(val)"); 289 } 290 this(cast(GdaValue*) p); 291 } 292 293 /** 294 * Makes a new GdaValue of type GDA_VALUE_TYPE_LIST with value val. 295 * Params: 296 * val = value to set for the new GdaValue. 297 * Throws: ConstructionException GTK+ fails to create the object. 298 */ 299 public this (GdaValueList* val) 300 { 301 // GdaValue* gda_value_new_list (const GdaValueList *val); 302 auto p = gda_value_new_list(val); 303 if(p is null) 304 { 305 throw new ConstructionException("null returned by gda_value_new_list(val)"); 306 } 307 this(cast(GdaValue*) p); 308 } 309 310 /** 311 * Params: 312 * Throws: ConstructionException GTK+ fails to create the object. 313 */ 314 public this (GdaMoney* val) 315 { 316 // GdaValue* gda_value_new_money (const GdaMoney *val); 317 auto p = gda_value_new_money(val); 318 if(p is null) 319 { 320 throw new ConstructionException("null returned by gda_value_new_money(val)"); 321 } 322 this(cast(GdaValue*) p); 323 } 324 325 /** 326 * Makes a new GdaValue of type GDA_VALUE_TYPE_NUMERIC with value val. 327 * Params: 328 * val = value to set for the new GdaValue. 329 * Throws: ConstructionException GTK+ fails to create the object. 330 */ 331 public this (GdaNumeric* val) 332 { 333 // GdaValue* gda_value_new_numeric (const GdaNumeric *val); 334 auto p = gda_value_new_numeric(val); 335 if(p is null) 336 { 337 throw new ConstructionException("null returned by gda_value_new_numeric(val)"); 338 } 339 this(cast(GdaValue*) p); 340 } 341 342 /** 343 * Makes a new GdaValue of type GDA_VALUE_TYPE_SINGLE with value val. 344 * Params: 345 * val = value to set for the new GdaValue. 346 * Throws: ConstructionException GTK+ fails to create the object. 347 */ 348 public this (float val) 349 { 350 // GdaValue* gda_value_new_single (gfloat val); 351 auto p = gda_value_new_single(val); 352 if(p is null) 353 { 354 throw new ConstructionException("null returned by gda_value_new_single(val)"); 355 } 356 this(cast(GdaValue*) p); 357 } 358 359 /** 360 * Makes a new GdaValue of type GDA_VALUE_TYPE_SMALLINT with value val. 361 * Params: 362 * val = value to set for the new GdaValue. 363 * Throws: ConstructionException GTK+ fails to create the object. 364 */ 365 public this (short val) 366 { 367 // GdaValue* gda_value_new_smallint (gshort val); 368 auto p = gda_value_new_smallint(val); 369 if(p is null) 370 { 371 throw new ConstructionException("null returned by gda_value_new_smallint(val)"); 372 } 373 this(cast(GdaValue*) p); 374 } 375 376 /** 377 * Makes a new GdaValue of type GDA_VALUE_TYPE_SMALLUINT with value val. 378 * Params: 379 * val = value to set for the new GdaValue. 380 * Throws: ConstructionException GTK+ fails to create the object. 381 */ 382 public this (ushort val) 383 { 384 // GdaValue* gda_value_new_smalluint (gushort val); 385 auto p = gda_value_new_smalluint(val); 386 if(p is null) 387 { 388 throw new ConstructionException("null returned by gda_value_new_smalluint(val)"); 389 } 390 this(cast(GdaValue*) p); 391 } 392 393 /** 394 * Makes a new GdaValue of type GDA_VALUE_TYPE_STRING with value val. 395 * Params: 396 * val = value to set for the new GdaValue. 397 * Throws: ConstructionException GTK+ fails to create the object. 398 */ 399 public this (string val) 400 { 401 // GdaValue* gda_value_new_string (const gchar *val); 402 auto p = gda_value_new_string(Str.toStringz(val)); 403 if(p is null) 404 { 405 throw new ConstructionException("null returned by gda_value_new_string(Str.toStringz(val))"); 406 } 407 this(cast(GdaValue*) p); 408 } 409 410 /** 411 * Makes a new GdaValue of type GDA_VALUE_TYPE_TIME with value val. 412 * Params: 413 * val = value to set for the new GdaValue. 414 * Throws: ConstructionException GTK+ fails to create the object. 415 */ 416 public this (GdaTime* val) 417 { 418 // GdaValue* gda_value_new_time (const GdaTime *val); 419 auto p = gda_value_new_time(val); 420 if(p is null) 421 { 422 throw new ConstructionException("null returned by gda_value_new_time(val)"); 423 } 424 this(cast(GdaValue*) p); 425 } 426 427 /** 428 * Makes a new GdaValue of type GDA_VALUE_TYPE_TIMESTAMP with value val. 429 * Params: 430 * val = value to set for the new GdaValue. 431 * Throws: ConstructionException GTK+ fails to create the object. 432 */ 433 public this (GdaTimestamp* val) 434 { 435 // GdaValue* gda_value_new_timestamp (const GdaTimestamp *val); 436 auto p = gda_value_new_timestamp(val); 437 if(p is null) 438 { 439 throw new ConstructionException("null returned by gda_value_new_timestamp(val)"); 440 } 441 this(cast(GdaValue*) p); 442 } 443 444 /** 445 * Makes a new GdaValue of type GDA_VALUE_TYPE_TYPE with value val. 446 * Params: 447 * val = Value to set for the new GdaValue. 448 * Throws: ConstructionException GTK+ fails to create the object. 449 */ 450 public this (GdaValueType val) 451 { 452 // GdaValue* gda_value_new_type (GdaValueType val); 453 auto p = gda_value_new_type(val); 454 if(p is null) 455 { 456 throw new ConstructionException("null returned by gda_value_new_type(val)"); 457 } 458 this(cast(GdaValue*) p); 459 } 460 461 /** 462 * Makes a new GdaValue of type type from its string representation. 463 * Params: 464 * asString = stringified representation of the value. 465 * type = the new value type. 466 * Throws: ConstructionException GTK+ fails to create the object. 467 */ 468 public this (string asString, GdaValueType type) 469 { 470 // GdaValue* gda_value_new_from_string (const gchar *as_string, GdaValueType type); 471 auto p = gda_value_new_from_string(Str.toStringz(asString), type); 472 if(p is null) 473 { 474 throw new ConstructionException("null returned by gda_value_new_from_string(Str.toStringz(asString), type)"); 475 } 476 this(cast(GdaValue*) p); 477 } 478 479 /** 480 * Creates a GdaValue from a XML representation of it. That XML 481 * Params: 482 * node = a XML node representing the value. 483 * Throws: ConstructionException GTK+ fails to create the object. 484 */ 485 public this (xmlNodePtr node) 486 { 487 // GdaValue* gda_value_new_from_xml (const xmlNodePtr node); 488 auto p = gda_value_new_from_xml(node); 489 if(p is null) 490 { 491 throw new ConstructionException("null returned by gda_value_new_from_xml(node)"); 492 } 493 this(cast(GdaValue*) p); 494 } 495 496 /** 497 * Deallocates all memory associated to a GdaValue. 498 */ 499 public void free() 500 { 501 // void gda_value_free (GdaValue *value); 502 gda_value_free(gdaValue); 503 } 504 505 /** 506 * Retrieves the type of the given value. 507 * Returns: the GdaValueType of the value. 508 */ 509 public GdaValueType getType() 510 { 511 // GdaValueType gda_value_get_type (GdaValue *value); 512 return gda_value_get_type(gdaValue); 513 } 514 515 /** 516 * Tests if a given value is of type GDA_VALUE_TYPE_NULL. 517 * Returns: a boolean that says whether or not value is of type GDA_VALUE_TYPE_NULL. 518 */ 519 public int isNull() 520 { 521 // gboolean gda_value_is_null (GdaValue *value); 522 return gda_value_is_null(gdaValue); 523 } 524 525 /** 526 * Gets whether the value stored in the given GdaValue is of 527 * numeric type or not. 528 * Returns: TRUE if a number, FALSE otherwise. 529 */ 530 public int isNumber() 531 { 532 // gboolean gda_value_is_number (GdaValue *value); 533 return gda_value_is_number(gdaValue); 534 } 535 536 /** 537 * Creates a new GdaValue from an existing one. 538 * Returns: a newly allocated GdaValue with a copy of the data in value. 539 */ 540 public Value copy() 541 { 542 // GdaValue* gda_value_copy (GdaValue *value); 543 auto p = gda_value_copy(gdaValue); 544 545 if(p is null) 546 { 547 return null; 548 } 549 550 return ObjectG.getDObject!(Value)(cast(GdaValue*) p); 551 } 552 553 /** 554 * Gets the value stored in value. 555 * Returns: the value contained in value. 556 */ 557 public long getBigint() 558 { 559 // gint64 gda_value_get_bigint (GdaValue *value); 560 return gda_value_get_bigint(gdaValue); 561 } 562 563 /** 564 * Stores val into value. 565 * Params: 566 * val = value to be stored in value. 567 */ 568 public void setBigint(long val) 569 { 570 // void gda_value_set_bigint (GdaValue *value, gint64 val); 571 gda_value_set_bigint(gdaValue, val); 572 } 573 574 /** 575 * Returns: the value stored in value. 576 */ 577 public ulong getBiguint() 578 { 579 // guint64 gda_value_get_biguint (GdaValue *value); 580 return gda_value_get_biguint(gdaValue); 581 } 582 583 /** 584 * Stores val into value. 585 * Params: 586 * val = value to be stored in value. 587 */ 588 public void setBiguint(ulong val) 589 { 590 // void gda_value_set_biguint (GdaValue *value, guint64 val); 591 gda_value_set_biguint(gdaValue, val); 592 } 593 594 /** 595 * Params: 596 * size = holder for length of data. 597 * Returns: the value stored in value. 598 */ 599 public void* getBinary(glong* size) 600 { 601 // const gpointer gda_value_get_binary (GdaValue *value, glong *size); 602 return gda_value_get_binary(gdaValue, size); 603 } 604 605 /** 606 * Stores val into value. 607 * Params: 608 * val = value to be stored in value. 609 * size = the size of the memory pool pointed to by val. 610 */ 611 public void setBinary(void* val, glong size) 612 { 613 // void gda_value_set_binary (GdaValue *value, gconstpointer val, glong size); 614 gda_value_set_binary(gdaValue, val, size); 615 } 616 617 /** 618 * Returns: the value stored in value. 619 */ 620 public GdaBlob* getBlob() 621 { 622 // const GdaBlob* gda_value_get_blob (GdaValue *value); 623 return gda_value_get_blob(gdaValue); 624 } 625 626 /** 627 * Stores val into value. 628 * Params: 629 * val = value to be stored in value. 630 */ 631 public void setBlob(GdaBlob* val) 632 { 633 // void gda_value_set_blob (GdaValue *value, const GdaBlob *val); 634 gda_value_set_blob(gdaValue, val); 635 } 636 637 /** 638 * Returns: the value stored in value. 639 */ 640 public int getBoolean() 641 { 642 // gboolean gda_value_get_boolean (GdaValue *value); 643 return gda_value_get_boolean(gdaValue); 644 } 645 646 /** 647 * Stores val into value. 648 * Params: 649 * val = value to be stored in value. 650 */ 651 public void setBoolean(int val) 652 { 653 // void gda_value_set_boolean (GdaValue *value, gboolean val); 654 gda_value_set_boolean(gdaValue, val); 655 } 656 657 /** 658 * Returns: the value stored in value. 659 */ 660 public GdaDate* getDate() 661 { 662 // const GdaDate* gda_value_get_date (GdaValue *value); 663 return gda_value_get_date(gdaValue); 664 } 665 666 /** 667 * Stores val into value. 668 * Params: 669 * val = value to be stored in value. 670 */ 671 public void setDate(GdaDate* val) 672 { 673 // void gda_value_set_date (GdaValue *value, const GdaDate *val); 674 gda_value_set_date(gdaValue, val); 675 } 676 677 /** 678 * Returns: the value stored in value. 679 */ 680 public double getDouble() 681 { 682 // gdouble gda_value_get_double (GdaValue *value); 683 return gda_value_get_double(gdaValue); 684 } 685 686 /** 687 * Stores val into value. 688 * Params: 689 * val = value to be stored in value. 690 */ 691 public void setDouble(double val) 692 { 693 // void gda_value_set_double (GdaValue *value, gdouble val); 694 gda_value_set_double(gdaValue, val); 695 } 696 697 /** 698 * Returns: the value stored in value. 699 */ 700 public GdaGeometricPoint* getGeometricPoint() 701 { 702 // const GdaGeometricPoint* gda_value_get_geometric_point (GdaValue *value); 703 return gda_value_get_geometric_point(gdaValue); 704 } 705 706 /** 707 * Stores val into value. 708 * Params: 709 * val = value to be stored in value. 710 */ 711 public void setGeometricPoint(GdaGeometricPoint* val) 712 { 713 // void gda_value_set_geometric_point (GdaValue *value, const GdaGeometricPoint *val); 714 gda_value_set_geometric_point(gdaValue, val); 715 } 716 717 /** 718 * Returns: the value stored in value. 719 */ 720 public ObjectG getGobject() 721 { 722 // const GObject* gda_value_get_gobject (GdaValue *value); 723 auto p = gda_value_get_gobject(gdaValue); 724 725 if(p is null) 726 { 727 return null; 728 } 729 730 return ObjectG.getDObject!(ObjectG)(cast(GObject*) p); 731 } 732 733 /** 734 * Stores val into value. 735 * Params: 736 * val = value to be stored in value. 737 */ 738 public void setGobject(ObjectG val) 739 { 740 // void gda_value_set_gobject (GdaValue *value, const GObject *val); 741 gda_value_set_gobject(gdaValue, (val is null) ? null : val.getObjectGStruct()); 742 } 743 744 /** 745 * Returns: the value stored in value. 746 */ 747 public int getInteger() 748 { 749 // gint gda_value_get_integer (GdaValue *value); 750 return gda_value_get_integer(gdaValue); 751 } 752 753 /** 754 * Stores val into value. 755 * Params: 756 * val = value to be stored in value. 757 */ 758 public void setInteger(int val) 759 { 760 // void gda_value_set_integer (GdaValue *value, gint val); 761 gda_value_set_integer(gdaValue, val); 762 } 763 764 /** 765 * Returns: the value stored in value. 766 */ 767 public GdaValueList* getList() 768 { 769 // const GdaValueList* gda_value_get_list (GdaValue *value); 770 return gda_value_get_list(gdaValue); 771 } 772 773 /** 774 * Stores val into value. 775 * Params: 776 * val = value to be stored in value. 777 */ 778 public void setList(GdaValueList* val) 779 { 780 // void gda_value_set_list (GdaValue *value, const GdaValueList *val); 781 gda_value_set_list(gdaValue, val); 782 } 783 784 /** 785 * Sets the type of value to GDA_VALUE_TYPE_NULL. 786 */ 787 public void setNull() 788 { 789 // void gda_value_set_null (GdaValue *value); 790 gda_value_set_null(gdaValue); 791 } 792 793 /** 794 * Returns: the value stored in value. 795 */ 796 public GdaMoney* getMoney() 797 { 798 // const GdaMoney* gda_value_get_money (GdaValue *value); 799 return gda_value_get_money(gdaValue); 800 } 801 802 /** 803 * Stores val into value. 804 * Params: 805 * val = value to be stored in value. 806 */ 807 public void setMoney(GdaMoney* val) 808 { 809 // void gda_value_set_money (GdaValue *value, const GdaMoney *val); 810 gda_value_set_money(gdaValue, val); 811 } 812 813 /** 814 * Returns: the value stored in value. 815 */ 816 public GdaNumeric* getNumeric() 817 { 818 // const GdaNumeric* gda_value_get_numeric (GdaValue *value); 819 return gda_value_get_numeric(gdaValue); 820 } 821 822 /** 823 * Stores val into value. 824 * Params: 825 * val = value to be stored in value. 826 */ 827 public void setNumeric(GdaNumeric* val) 828 { 829 // void gda_value_set_numeric (GdaValue *value, const GdaNumeric *val); 830 gda_value_set_numeric(gdaValue, val); 831 } 832 833 /** 834 * Returns: the value stored in value. 835 */ 836 public float getSingle() 837 { 838 // gfloat gda_value_get_single (GdaValue *value); 839 return gda_value_get_single(gdaValue); 840 } 841 842 /** 843 * Stores val into value. 844 * Params: 845 * val = value to be stored in value. 846 */ 847 public void setSingle(float val) 848 { 849 // void gda_value_set_single (GdaValue *value, gfloat val); 850 gda_value_set_single(gdaValue, val); 851 } 852 853 /** 854 * Returns: the value stored in value. 855 */ 856 public short getSmallint() 857 { 858 // gshort gda_value_get_smallint (GdaValue *value); 859 return gda_value_get_smallint(gdaValue); 860 } 861 862 /** 863 * Stores val into value. 864 * Params: 865 * val = value to be stored in value. 866 */ 867 public void setSmallint(short val) 868 { 869 // void gda_value_set_smallint (GdaValue *value, gshort val); 870 gda_value_set_smallint(gdaValue, val); 871 } 872 873 /** 874 * Returns: the value stored in value. 875 */ 876 public ushort getSmalluint() 877 { 878 // gushort gda_value_get_smalluint (GdaValue *value); 879 return gda_value_get_smalluint(gdaValue); 880 } 881 882 /** 883 * Stores val into value. 884 * Params: 885 * val = value to be stored in value. 886 */ 887 public void setSmalluint(ushort val) 888 { 889 // void gda_value_set_smalluint (GdaValue *value, gushort val); 890 gda_value_set_smalluint(gdaValue, val); 891 } 892 893 /** 894 * Returns: the value stored in value. 895 */ 896 public string getString() 897 { 898 // const gchar* gda_value_get_string (GdaValue *value); 899 return Str.toString(gda_value_get_string(gdaValue)); 900 } 901 902 /** 903 * Stores val into value. 904 * Params: 905 * val = value to be stored in value. 906 */ 907 public void setString(string val) 908 { 909 // void gda_value_set_string (GdaValue *value, const gchar *val); 910 gda_value_set_string(gdaValue, Str.toStringz(val)); 911 } 912 913 /** 914 * Returns: the value stored in value. 915 */ 916 public GdaTime* getTime() 917 { 918 // const GdaTime* gda_value_get_time (GdaValue *value); 919 return gda_value_get_time(gdaValue); 920 } 921 922 /** 923 * Stores val into value. 924 * Params: 925 * val = value to be stored in value. 926 */ 927 public void setTime(GdaTime* val) 928 { 929 // void gda_value_set_time (GdaValue *value, const GdaTime *val); 930 gda_value_set_time(gdaValue, val); 931 } 932 933 /** 934 * Returns: the value stored in value. 935 */ 936 public GdaTimestamp* getTimestamp() 937 { 938 // const GdaTimestamp* gda_value_get_timestamp (GdaValue *value); 939 return gda_value_get_timestamp(gdaValue); 940 } 941 942 /** 943 * Stores val into value. 944 * Params: 945 * val = value to be stored in value. 946 */ 947 public void setTimestamp(GdaTimestamp* val) 948 { 949 // void gda_value_set_timestamp (GdaValue *value, const GdaTimestamp *val); 950 gda_value_set_timestamp(gdaValue, val); 951 } 952 953 /** 954 * Returns: the value stored in value. 955 */ 956 public char getTinyint() 957 { 958 // gchar gda_value_get_tinyint (GdaValue *value); 959 return gda_value_get_tinyint(gdaValue); 960 } 961 962 /** 963 * Stores val into value. 964 * Params: 965 * val = value to be stored in value. 966 */ 967 public void setTinyint(char val) 968 { 969 // void gda_value_set_tinyint (GdaValue *value, gchar val); 970 gda_value_set_tinyint(gdaValue, val); 971 } 972 973 /** 974 * Returns: the value stored in value. 975 */ 976 public char getTinyuint() 977 { 978 // guchar gda_value_get_tinyuint (GdaValue *value); 979 return gda_value_get_tinyuint(gdaValue); 980 } 981 982 /** 983 * Stores val into value. 984 * Params: 985 * val = value to be stored in value. 986 */ 987 public void setTinyuint(char val) 988 { 989 // void gda_value_set_tinyuint (GdaValue *value, guchar val); 990 gda_value_set_tinyuint(gdaValue, val); 991 } 992 993 /** 994 * Returns: the value stored in value. 995 */ 996 public uint getUinteger() 997 { 998 // guint gda_value_get_uinteger (GdaValue *value); 999 return gda_value_get_uinteger(gdaValue); 1000 } 1001 1002 /** 1003 * Stores val into value. 1004 * Params: 1005 * val = value to be stored in value. 1006 */ 1007 public void setUinteger(uint val) 1008 { 1009 // void gda_value_set_uinteger (GdaValue *value, guint val); 1010 gda_value_set_uinteger(gdaValue, val); 1011 } 1012 1013 /** 1014 * Returns: the value stored in value. 1015 */ 1016 public GdaValueType getVtype() 1017 { 1018 // GdaValueType gda_value_get_vtype (GdaValue *value); 1019 return gda_value_get_vtype(gdaValue); 1020 } 1021 1022 /** 1023 * Stores type into value. 1024 * Params: 1025 * type = value to be stored in value. 1026 */ 1027 public void setVtype(GdaValueType type) 1028 { 1029 // void gda_value_set_vtype (GdaValue *value, GdaValueType type); 1030 gda_value_set_vtype(gdaValue, type); 1031 } 1032 1033 /** 1034 * Stores the value data from its string representation as type. 1035 * Params: 1036 * asString = the stringified representation of the value. 1037 * type = the type of the value 1038 * Returns: TRUE if the value has been properly converted to type from its string representation. FALSE otherwise. 1039 */ 1040 public int setFromString(string asString, GdaValueType type) 1041 { 1042 // gboolean gda_value_set_from_string (GdaValue *value, const gchar *as_string, GdaValueType type); 1043 return gda_value_set_from_string(gdaValue, Str.toStringz(asString), type); 1044 } 1045 1046 /** 1047 * Sets the value of a GdaValue from another GdaValue. This 1048 * is different from gda_value_copy, which creates a new GdaValue. 1049 * gda_value_set_from_value, on the other hand, copies the contents 1050 * of copy into value, which must already be allocated. 1051 * Params: 1052 * from = the value to copy from. 1053 * Returns: TRUE if successful, FALSE otherwise. 1054 */ 1055 public int setFromValue(Value from) 1056 { 1057 // gboolean gda_value_set_from_value (GdaValue *value, const GdaValue *from); 1058 return gda_value_set_from_value(gdaValue, (from is null) ? null : from.getValueStruct()); 1059 } 1060 1061 /** 1062 * Compares two values of the same type. 1063 * Params: 1064 * value2 = the other GdaValue to be compared to value1. 1065 * Returns: if both values have the same type, returns 0 if both contain the same value, an integer less than 0 if value1 is less than value2 or an integer greater than 0 if value1 is greater than value2. 1066 */ 1067 public int compare(Value value2) 1068 { 1069 // gint gda_value_compare (GdaValue *value1, GdaValue *value2); 1070 return gda_value_compare(gdaValue, (value2 is null) ? null : value2.getValueStruct()); 1071 } 1072 1073 /** 1074 * Converts a GdaValue to its string representation as indicated by this 1075 * Returns: a string formatted according to the printf() style indicated in the preceding table. Free the value with a g_free() when you've finished using it. 1076 */ 1077 public string stringify() 1078 { 1079 // gchar* gda_value_stringify (GdaValue *value); 1080 return Str.toString(gda_value_stringify(gdaValue)); 1081 } 1082 1083 /** 1084 * Serializes the given GdaValue to a XML node string. 1085 * Returns: the XML node. Once not needed anymore, you should free it. 1086 */ 1087 public xmlNodePtr toXml() 1088 { 1089 // xmlNodePtr gda_value_to_xml (GdaValue *value); 1090 return gda_value_to_xml(gdaValue); 1091 } 1092 }