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