Commit graph

33 commits

Author SHA1 Message Date
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
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
99cb6cb071
Allow structs with non-marshaled non-canDBus fields (#28) 2017-11-04 15:12:56 +01:00
Harry T. Vennik
9bbd4a3bbf Move UDA stuff for struct support to separate module 2017-10-28 15:28:38 +02:00
Harry T. Vennik
63bbbd0a14 Fix template bug in type conversion for BitFlags 2017-08-19 14:53:55 +02: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
da536be3d1 Implemented selective marshaling of struct fields
- Skips private fields by default
- Allows overriding of that default by an UDA on the struct type
- Allows per-field overriding using UDA on field
2017-07-26 09:45:39 +02:00
Harry T. Vennik
fc9a604e85 Fix demarshaling of private struct fields
Tests now pass again.
2017-07-22 15:25:57 +02:00
Harry T. Vennik
87a06cead1 Improved tests
Moved unittest for struct types from `ddbus.conv` to `ddbus.thin` and
made one struct field private.

Test now fails compile-time because of error "member a is not
accessible".
2017-07-22 15:13:55 +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
Tristan Hume
15ae9fec23 Merge pull request #20 from thaven/feature/enum
Support for enum types
2017-07-17 20:52:08 -07: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
c00efce320 Fix: Expected and actual type swapped in TypeMismatchException 2017-07-17 18:05:57 +02:00
Harry T. Vennik
1690e2cfd8 Gracefully handle unexpected types when reading a message. 2017-07-09 19:20:28 +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
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
455c0a8f0d Change signature type from char[] to const(char)[] 2017-06-05 14:28:20 +02:00
Tristan Hume
dd29457e4c Merge pull request #13 from WebFreak001/fix-skips
Fixed DBusAny skipping values after string or bool
2017-04-23 16:13:13 -04:00
WebFreak001
b7955764b8 Fixed DBusAny skipping values after string or bool 2017-04-23 21:14:25 +02:00
WebFreak001
33a829f95a Merge commit '6cc7ae6' into any-types 2017-04-23 20:56:54 +02:00
WebFreak001
6cc7ae6bf1 Added optimization case for binary data 2017-04-23 20:44:09 +02:00
Tristan Hume
debcc8fbc6 clean up things a little bit 2017-04-23 14:37:19 -04:00
WebFreak001
d395af0f4c Tested & fixed returning Variant!DBusAny 2017-04-23 16:12:52 +02:00
WebFreak001
73122deb8c Support for dynamic variants (fix #9) 2017-04-23 15:19:15 +02:00
WebFreak001
4c416fc6fb Fix dict implementation 2017-04-22 23:24:24 +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
5905d50e1a Switch to structs for thin wrappers. 2015-05-01 16:59:40 -04:00
Tristan Hume
0e0e8971b4 DBus iterator conversion to/from D types 2015-04-27 17:38:01 -04:00