Arbitrary string to DBus path

Ted Gould ted at gould.cx
Fri Nov 15 14:55:27 PST 2013


On Fri, 2013-11-15 at 18:45 +0100, Lennart Poettering wrote:

> On Fri, 15.11.13 11:21, Ted Gould (ted at gould.cx) wrote:
> > One problem we've had is taking arbitrary string (usually application
> > names) and putting them into object paths on DBus.  The characters
> > allowed in the path is limited, which is fine, but we need some way to
> > represent the string we're passed through that.  libnih has a small
> > function[1] that does this by taking any character that isn't an ASCII
> > character or digit and putting it's value as ASCII digits after an
> > underscore.  We've been using this in various places, and I think it'd
> > be useful if there was an algorithm that was included in the DBus
> > spec.
> 
> Why? The spec is something you should follow to stay interoperable, but
> I don't see how a spec on the precise mappings from some project
> specific identifiers to bus paths would be needed for that.



So that people don't have two mostly similar but slightly incompatible
versions of the same thing ;-)


> And I am pretty sure that exposing a similar call in a dbus library
> implementation certainly would make sense but I really don't see why
> there needs to be a spec about this...


I more figured that if I went to all the dbus libraries and proposed a
patch, they'd say something like: "support a random format you made up,
that's silly!"  So I'm less worried about it being "in the spec" and
more about it being agreed upon as the way to do things.  I think that a
recommendation in the spec is probably the best place to put that for
future implementors.

Ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20131115/3aa4dfaf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20131115/3aa4dfaf/attachment.pgp>


More information about the dbus mailing list