/usr/include/d/gtkd-3/gio/DBusMessage.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gio.DBusMessage;
private import gio.UnixFDList;
private import gio.c.functions;
public import gio.c.types;
private import glib.ConstructionException;
private import glib.ErrorG;
private import glib.GException;
private import glib.Str;
private import glib.Variant;
private import gobject.ObjectG;
public import gtkc.giotypes;
/**
* A type for representing D-Bus messages that can be sent or received
* on a #GDBusConnection.
*
* Since: 2.26
*/
public class DBusMessage : ObjectG
{
/** the main Gtk struct */
protected GDBusMessage* gDBusMessage;
/** Get the main Gtk struct */
public GDBusMessage* getDBusMessageStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gDBusMessage;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gDBusMessage;
}
protected override void setStruct(GObject* obj)
{
gDBusMessage = cast(GDBusMessage*)obj;
super.setStruct(obj);
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GDBusMessage* gDBusMessage, bool ownedRef = false)
{
this.gDBusMessage = gDBusMessage;
super(cast(GObject*)gDBusMessage, ownedRef);
}
/** */
public static GType getType()
{
return g_dbus_message_get_type();
}
/**
* Creates a new empty #GDBusMessage.
*
* Returns: A #GDBusMessage. Free with g_object_unref().
*
* Since: 2.26
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this()
{
auto p = g_dbus_message_new();
if(p is null)
{
throw new ConstructionException("null returned by new");
}
this(cast(GDBusMessage*) p, true);
}
/**
* Creates a new #GDBusMessage from the data stored at @blob. The byte
* order that the message was in can be retrieved using
* g_dbus_message_get_byte_order().
*
* Params:
* blob = A blob represent a binary D-Bus message.
* capabilities = A #GDBusCapabilityFlags describing what protocol features are supported.
*
* Returns: A new #GDBusMessage or %NULL if @error is set. Free with
* g_object_unref().
*
* Since: 2.26
*
* Throws: GException on failure.
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(char[] blob, GDBusCapabilityFlags capabilities)
{
GError* err = null;
auto p = g_dbus_message_new_from_blob(blob.ptr, cast(size_t)blob.length, capabilities, &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
throw new ConstructionException("null returned by new_from_blob");
}
this(cast(GDBusMessage*) p, true);
}
/**
* Creates a new #GDBusMessage for a method call.
*
* Params:
* name = A valid D-Bus name or %NULL.
* path = A valid object path.
* iface = A valid D-Bus interface name or %NULL.
* method = A valid method name.
*
* Returns: A #GDBusMessage. Free with g_object_unref().
*
* Since: 2.26
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(string name, string path, string iface, string method)
{
auto p = g_dbus_message_new_method_call(Str.toStringz(name), Str.toStringz(path), Str.toStringz(iface), Str.toStringz(method));
if(p is null)
{
throw new ConstructionException("null returned by new_method_call");
}
this(cast(GDBusMessage*) p, true);
}
/**
* Creates a new #GDBusMessage for a signal emission.
*
* Params:
* path = A valid object path.
* iface = A valid D-Bus interface name.
* signal = A valid signal name.
*
* Returns: A #GDBusMessage. Free with g_object_unref().
*
* Since: 2.26
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(string path, string iface, string signal)
{
auto p = g_dbus_message_new_signal(Str.toStringz(path), Str.toStringz(iface), Str.toStringz(signal));
if(p is null)
{
throw new ConstructionException("null returned by new_signal");
}
this(cast(GDBusMessage*) p, true);
}
/**
* Utility function to calculate how many bytes are needed to
* completely deserialize the D-Bus message stored at @blob.
*
* Params:
* blob = A blob represent a binary D-Bus message.
*
* Returns: Number of bytes needed or -1 if @error is set (e.g. if
* @blob contains invalid data or not enough data is available to
* determine the size).
*
* Since: 2.26
*
* Throws: GException on failure.
*/
public static ptrdiff_t bytesNeeded(char[] blob)
{
GError* err = null;
auto p = g_dbus_message_bytes_needed(blob.ptr, cast(size_t)blob.length, &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return p;
}
/**
* Copies @message. The copy is a deep copy and the returned
* #GDBusMessage is completely identical except that it is guaranteed
* to not be locked.
*
* This operation can fail if e.g. @message contains file descriptors
* and the per-process or system-wide open files limit is reached.
*
* Returns: A new #GDBusMessage or %NULL if @error is set.
* Free with g_object_unref().
*
* Since: 2.26
*
* Throws: GException on failure.
*/
public DBusMessage copy()
{
GError* err = null;
auto p = g_dbus_message_copy(gDBusMessage, &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return ObjectG.getDObject!(DBusMessage)(cast(GDBusMessage*) p, true);
}
/**
* Convenience to get the first item in the body of @message.
*
* Returns: The string item or %NULL if the first item in the body of
* @message is not a string.
*
* Since: 2.26
*/
public string getArg0()
{
return Str.toString(g_dbus_message_get_arg0(gDBusMessage));
}
/**
* Gets the body of a message.
*
* Returns: A #GVariant or %NULL if the body is
* empty. Do not free, it is owned by @message.
*
* Since: 2.26
*/
public Variant getBody()
{
auto p = g_dbus_message_get_body(gDBusMessage);
if(p is null)
{
return null;
}
return new Variant(cast(GVariant*) p);
}
/**
* Gets the byte order of @message.
*
* Returns: The byte order.
*/
public GDBusMessageByteOrder getByteOrder()
{
return g_dbus_message_get_byte_order(gDBusMessage);
}
/**
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
*
* Returns: The value.
*
* Since: 2.26
*/
public string getDestination()
{
return Str.toString(g_dbus_message_get_destination(gDBusMessage));
}
/**
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
*
* Returns: The value.
*
* Since: 2.26
*/
public string getErrorName()
{
return Str.toString(g_dbus_message_get_error_name(gDBusMessage));
}
/**
* Gets the flags for @message.
*
* Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
*
* Since: 2.26
*/
public GDBusMessageFlags getFlags()
{
return g_dbus_message_get_flags(gDBusMessage);
}
/**
* Gets a header field on @message.
*
* Params:
* headerField = A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
*
* Returns: A #GVariant with the value if the header was found, %NULL
* otherwise. Do not free, it is owned by @message.
*
* Since: 2.26
*/
public Variant getHeader(GDBusMessageHeaderField headerField)
{
auto p = g_dbus_message_get_header(gDBusMessage, headerField);
if(p is null)
{
return null;
}
return new Variant(cast(GVariant*) p, true);
}
/**
* Gets an array of all header fields on @message that are set.
*
* Returns: An array of header fields
* terminated by %G_DBUS_MESSAGE_HEADER_FIELD_INVALID. Each element
* is a #guchar. Free with g_free().
*
* Since: 2.26
*/
public char[] getHeaderFields()
{
auto p = g_dbus_message_get_header_fields(gDBusMessage);
return p[0 .. getArrayLength(p)];
}
/**
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
*
* Returns: The value.
*
* Since: 2.26
*/
public string getInterface()
{
return Str.toString(g_dbus_message_get_interface(gDBusMessage));
}
/**
* Checks whether @message is locked. To monitor changes to this
* value, conncet to the #GObject::notify signal to listen for changes
* on the #GDBusMessage:locked property.
*
* Returns: %TRUE if @message is locked, %FALSE otherwise.
*
* Since: 2.26
*/
public bool getLocked()
{
return g_dbus_message_get_locked(gDBusMessage) != 0;
}
/**
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
*
* Returns: The value.
*
* Since: 2.26
*/
public string getMember()
{
return Str.toString(g_dbus_message_get_member(gDBusMessage));
}
/**
* Gets the type of @message.
*
* Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
*
* Since: 2.26
*/
public GDBusMessageType getMessageType()
{
return g_dbus_message_get_message_type(gDBusMessage);
}
/**
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
*
* Returns: The value.
*
* Since: 2.26
*/
public uint getNumUnixFds()
{
return g_dbus_message_get_num_unix_fds(gDBusMessage);
}
/**
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
*
* Returns: The value.
*
* Since: 2.26
*/
public string getPath()
{
return Str.toString(g_dbus_message_get_path(gDBusMessage));
}
/**
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
*
* Returns: The value.
*
* Since: 2.26
*/
public uint getReplySerial()
{
return g_dbus_message_get_reply_serial(gDBusMessage);
}
/**
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
*
* Returns: The value.
*
* Since: 2.26
*/
public string getSender()
{
return Str.toString(g_dbus_message_get_sender(gDBusMessage));
}
/**
* Gets the serial for @message.
*
* Returns: A #guint32.
*
* Since: 2.26
*/
public uint getSerial()
{
return g_dbus_message_get_serial(gDBusMessage);
}
/**
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
*
* Returns: The value.
*
* Since: 2.26
*/
public string getSignature()
{
return Str.toString(g_dbus_message_get_signature(gDBusMessage));
}
/**
* Gets the UNIX file descriptors associated with @message, if any.
*
* This method is only available on UNIX.
*
* Returns: A #GUnixFDList or %NULL if no file descriptors are
* associated. Do not free, this object is owned by @message.
*
* Since: 2.26
*/
public UnixFDList getUnixFdList()
{
auto p = g_dbus_message_get_unix_fd_list(gDBusMessage);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(UnixFDList)(cast(GUnixFDList*) p);
}
/**
* If @message is locked, does nothing. Otherwise locks the message.
*
* Since: 2.26
*/
public void lock()
{
g_dbus_message_lock(gDBusMessage);
}
/**
* Creates a new #GDBusMessage that is an error reply to @method_call_message.
*
* Params:
* errorName = A valid D-Bus error name.
* errorMessage = The D-Bus error message.
*
* Returns: A #GDBusMessage. Free with g_object_unref().
*
* Since: 2.26
*/
public DBusMessage newMethodErrorLiteral(string errorName, string errorMessage)
{
auto p = g_dbus_message_new_method_error_literal(gDBusMessage, Str.toStringz(errorName), Str.toStringz(errorMessage));
if(p is null)
{
return null;
}
return ObjectG.getDObject!(DBusMessage)(cast(GDBusMessage*) p, true);
}
/**
* Like g_dbus_message_new_method_error() but intended for language bindings.
*
* Params:
* errorName = A valid D-Bus error name.
* errorMessageFormat = The D-Bus error message in a printf() format.
* varArgs = Arguments for @error_message_format.
*
* Returns: A #GDBusMessage. Free with g_object_unref().
*
* Since: 2.26
*/
public DBusMessage newMethodErrorValist(string errorName, string errorMessageFormat, void* varArgs)
{
auto p = g_dbus_message_new_method_error_valist(gDBusMessage, Str.toStringz(errorName), Str.toStringz(errorMessageFormat), varArgs);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(DBusMessage)(cast(GDBusMessage*) p, true);
}
/**
* Creates a new #GDBusMessage that is a reply to @method_call_message.
*
* Returns: #GDBusMessage. Free with g_object_unref().
*
* Since: 2.26
*/
public DBusMessage newMethodReply()
{
auto p = g_dbus_message_new_method_reply(gDBusMessage);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(DBusMessage)(cast(GDBusMessage*) p, true);
}
/**
* Produces a human-readable multi-line description of @message.
*
* The contents of the description has no ABI guarantees, the contents
* and formatting is subject to change at any time. Typical output
* looks something like this:
* |[
* Flags: none
* Version: 0
* Serial: 4
* Headers:
* path -> objectpath '/org/gtk/GDBus/TestObject'
* interface -> 'org.gtk.GDBus.TestInterface'
* member -> 'GimmeStdout'
* destination -> ':1.146'
* Body: ()
* UNIX File Descriptors:
* (none)
* ]|
* or
* |[
* Flags: no-reply-expected
* Version: 0
* Serial: 477
* Headers:
* reply-serial -> uint32 4
* destination -> ':1.159'
* sender -> ':1.146'
* num-unix-fds -> uint32 1
* Body: ()
* UNIX File Descriptors:
* fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
* ]|
*
* Params:
* indent = Indentation level.
*
* Returns: A string that should be freed with g_free().
*
* Since: 2.26
*/
public string print(uint indent)
{
auto retStr = g_dbus_message_print(gDBusMessage, indent);
scope(exit) Str.freeString(retStr);
return Str.toString(retStr);
}
/**
* Sets the body @message. As a side-effect the
* %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
* type string of @body (or cleared if @body is %NULL).
*
* If @body is floating, @message assumes ownership of @body.
*
* Params:
* bod = Either %NULL or a #GVariant that is a tuple.
*
* Since: 2.26
*/
public void setBody(Variant bod)
{
g_dbus_message_set_body(gDBusMessage, (bod is null) ? null : bod.getVariantStruct());
}
/**
* Sets the byte order of @message.
*
* Params:
* byteOrder = The byte order.
*/
public void setByteOrder(GDBusMessageByteOrder byteOrder)
{
g_dbus_message_set_byte_order(gDBusMessage, byteOrder);
}
/**
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
*
* Params:
* value = The value to set.
*
* Since: 2.26
*/
public void setDestination(string value)
{
g_dbus_message_set_destination(gDBusMessage, Str.toStringz(value));
}
/**
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
*
* Params:
* value = The value to set.
*
* Since: 2.26
*/
public void setErrorName(string value)
{
g_dbus_message_set_error_name(gDBusMessage, Str.toStringz(value));
}
/**
* Sets the flags to set on @message.
*
* Params:
* flags = Flags for @message that are set (typically values from the #GDBusMessageFlags
* enumeration bitwise ORed together).
*
* Since: 2.26
*/
public void setFlags(GDBusMessageFlags flags)
{
g_dbus_message_set_flags(gDBusMessage, flags);
}
/**
* Sets a header field on @message.
*
* If @value is floating, @message assumes ownership of @value.
*
* Params:
* headerField = A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
* value = A #GVariant to set the header field or %NULL to clear the header field.
*
* Since: 2.26
*/
public void setHeader(GDBusMessageHeaderField headerField, Variant value)
{
g_dbus_message_set_header(gDBusMessage, headerField, (value is null) ? null : value.getVariantStruct());
}
/**
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
*
* Params:
* value = The value to set.
*
* Since: 2.26
*/
public void setInterface(string value)
{
g_dbus_message_set_interface(gDBusMessage, Str.toStringz(value));
}
/**
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
*
* Params:
* value = The value to set.
*
* Since: 2.26
*/
public void setMember(string value)
{
g_dbus_message_set_member(gDBusMessage, Str.toStringz(value));
}
/**
* Sets @message to be of @type.
*
* Params:
* type = A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
*
* Since: 2.26
*/
public void setMessageType(GDBusMessageType type)
{
g_dbus_message_set_message_type(gDBusMessage, type);
}
/**
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
*
* Params:
* value = The value to set.
*
* Since: 2.26
*/
public void setNumUnixFds(uint value)
{
g_dbus_message_set_num_unix_fds(gDBusMessage, value);
}
/**
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
*
* Params:
* value = The value to set.
*
* Since: 2.26
*/
public void setPath(string value)
{
g_dbus_message_set_path(gDBusMessage, Str.toStringz(value));
}
/**
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
*
* Params:
* value = The value to set.
*
* Since: 2.26
*/
public void setReplySerial(uint value)
{
g_dbus_message_set_reply_serial(gDBusMessage, value);
}
/**
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
*
* Params:
* value = The value to set.
*
* Since: 2.26
*/
public void setSender(string value)
{
g_dbus_message_set_sender(gDBusMessage, Str.toStringz(value));
}
/**
* Sets the serial for @message.
*
* Params:
* serial = A #guint32.
*
* Since: 2.26
*/
public void setSerial(uint serial)
{
g_dbus_message_set_serial(gDBusMessage, serial);
}
/**
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
*
* Params:
* value = The value to set.
*
* Since: 2.26
*/
public void setSignature(string value)
{
g_dbus_message_set_signature(gDBusMessage, Str.toStringz(value));
}
/**
* Sets the UNIX file descriptors associated with @message. As a
* side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
* field is set to the number of fds in @fd_list (or cleared if
* @fd_list is %NULL).
*
* This method is only available on UNIX.
*
* Params:
* fdList = A #GUnixFDList or %NULL.
*
* Since: 2.26
*/
public void setUnixFdList(UnixFDList fdList)
{
g_dbus_message_set_unix_fd_list(gDBusMessage, (fdList is null) ? null : fdList.getUnixFDListStruct());
}
/**
* Serializes @message to a blob. The byte order returned by
* g_dbus_message_get_byte_order() will be used.
*
* Params:
* capabilities = A #GDBusCapabilityFlags describing what protocol features are supported.
*
* Returns: A pointer to a
* valid binary D-Bus message of @out_size bytes generated by @message
* or %NULL if @error is set. Free with g_free().
*
* Since: 2.26
*
* Throws: GException on failure.
*/
public char[] toBlob(GDBusCapabilityFlags capabilities)
{
size_t outSize;
GError* err = null;
auto p = g_dbus_message_to_blob(gDBusMessage, &outSize, capabilities, &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return p[0 .. outSize];
}
/**
* If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
* nothing and returns %FALSE.
*
* Otherwise this method encodes the error in @message as a #GError
* using g_dbus_error_set_dbus_error() using the information in the
* %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
* well as the first string item in @message's body.
*
* Returns: %TRUE if @error was set, %FALSE otherwise.
*
* Since: 2.26
*
* Throws: GException on failure.
*/
public bool toGerror()
{
GError* err = null;
auto p = g_dbus_message_to_gerror(gDBusMessage, &err) != 0;
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
return p;
}
}
|