Commit graph

29 commits

Author SHA1 Message Date
95a29d0578 Merge branch 'master' of https://github.com/trishume/ddbus 2021-01-22 00:30:12 +01:00
3b1cc9b453 Added FileDescriptor support
Some DBus methods return file descriptors, such as
"org.freedesktop.login1.Manager.Inhibit". This commit adds support for
these.

I followed the same enum type defining pattern I've seen in the code,
such as with InterfaceNames and BusNames, to prevent integers and
fileDescriptors implicitly casting to each other.

Note that it is kinda hard to test with reading and writing
fileDescriptors, as DBus will duplicate the file descriptor
when reading, leading to relatively unpredicatable behaviour.

I also must admit I focussed most of my attention to reading file
descriptors and less to writing file descriptors, as I don't know a good
way to test those.
2021-01-22 00:20:43 +01:00
WebFreak001
2fde2e12af fix immutable/const types & add type convenience
Before it was not properly possible to use
static immutable name = interfaceName(...)
in a message, which is now fixed
2021-01-12 11:04:34 +01:00
H. S. Teoh
50a517f4fb Replace 'byte' with 'ubyte'.
Because 'y' is unsigned in the DBus spec.
2021-01-12 01:40:07 -08:00
WebFreak001
db86451c7f safer API with ObjectPath, InterfaceName, BusName
the busName and interfacePath types transparently cast down to a string,
(but not the other way around) so they are a perfect upgrade to
 type-safety. The only downside to them is that templates can often get
them wrong. std.conv.to will return with a cast(T) prefix, which could
slightly break existing code.

I think the type-safety advantages are outweighing this corner case
though. The current API has been fully upgraded and examples still run
and work.
2019-03-17 10:33:55 +01:00
Harry Vennik
137b3c36b7 Improved code formatting (#33)
- Used dfmt (otbs style)
- Added some empty lines and braces on all block statements
- Add .editorconfig

Closes #29
2017-12-18 19:19:27 +01:00
thaven
ce7716463d
Add get!T method to DBusAny (#27)
* Add ddbus.util.BasicTypes

* Implement DBusAny.get and DBusAny.typeSig

* Add unittest for DBusAny.get

* Make TypeMismatchException constructor public
2017-11-11 11:42:55 +01:00
thaven
99cb6cb071
Allow structs with non-marshaled non-canDBus fields (#28) 2017-11-04 15:12:56 +01:00
Harry T. Vennik
e4186bcc5c Deprecate ddbus.util.isVariant
Closes #22
2017-08-14 20:25:31 +02:00
Harry T. Vennik
e6d03252d2 Added support for Phobos-style variants
Only variants that are limited to contain types supported by ddbus are allowed.
2017-08-14 20:22:38 +02:00
Harry T. Vennik
6bce6cf649 Added support for POD structs
Note: structs are deliberately considered last, because other stuff may
be implemented as structs as well. So we need to take care of special
cases before trying struct (de)serialization.
2017-07-20 17:01:42 +02:00
Harry T. Vennik
e2d128ccea Added support for BitFlags 2017-07-17 20:54:35 +02:00
Harry T. Vennik
6dca60d5ea Add support for enum types 2017-07-17 20:04:51 +02:00
Harry T. Vennik
0439a1e8db Added support for object path type 2017-06-25 18:33:57 +02:00
Tristan Hume
56f90644ce Merge pull request #16 from thaven/fix/dictionary
Dictionary related improvements
2017-06-20 19:57:15 -07:00
Harry T. Vennik
111b5c5af3 Cleanup typeSig implementation for DictionaryEntry 2017-06-20 21:23:53 +02:00
Harry T. Vennik
3fa88ee9f7 Fix various template instantiation errors
Some templates broke because canDBus!(DictionaryEntry!(K,V)) now returns false.
Also, associative arrays are now handled without using a DictionaryEntry type. This is a first step in eliminating DictionaryEntry.
2017-06-18 17:43:19 +02:00
Harry T. Vennik
227d0085ca Add check for correct typecode for tuple to unittest 2017-06-06 07:10:11 +02:00
Harry T. Vennik
7b826ec80c Return correct typecode for tuple 2017-06-05 13:39:56 +02:00
Harry T. Vennik
a6aa85ac74 Some dictionary related typesystem fixes
- Keys in a dictionary are required to be basic types
- A DictionaryEntry on it's own cannot be sent over DBus, it has to be wrapped in an array to form a dictionary. So, canDBus should be false for DictionaryEntry, but true for an array of DictionaryEntry.
2017-06-04 17:44:15 +02:00
WebFreak001
73122deb8c Support for dynamic variants (fix #9) 2017-04-23 15:19:15 +02:00
Tristan Hume
408cda19bc Merge pull request #8 from WebFreak001/maps
Support for maps/dictionaries
2017-04-22 23:43:53 -04:00
WebFreak001
2552888693 return tuple should be treated as multiple returns 2017-04-22 23:10:51 +02:00
WebFreak001
4017e95aba Support for maps/dictionaries 2017-04-22 23:10:15 +02:00
xentec
98bc5bddc1 Added basic variant type support
This also enables reading properties of DBus interfaces.
2015-12-31 00:47:19 +01:00
Tristan Hume
2af2db0020 Type checking and groundwork for introspection. 2015-05-01 21:38:41 -04:00
Tristan Hume
e370a57a42 Add routing infrastructure. 2015-04-30 19:22:08 -04:00
Tristan Hume
0e0e8971b4 DBus iterator conversion to/from D types 2015-04-27 17:38:01 -04:00
Tristan Hume
fd19791f8d Add handy utilities 2015-04-26 19:31:39 -04:00