siblingdevice now checks for and removes a leading "^" to

indicate the owner. This allows "^" to be used to reference
the owning device in device callbacks, among other things.
This commit is contained in:
Aaron Giles 2012-01-27 07:21:20 +00:00
parent 52ccf5ffbc
commit 643793cce6

View File

@ -768,6 +768,9 @@ inline device_t *device_t::siblingdevice(const char *tag) const
// empty string or NULL means this device
if (tag == NULL || *tag == 0)
return const_cast<device_t *>(this);
// leading caret implies the owner, just skip it
if (tag[0] == '^') tag++;
// query relative to the parent
return (m_owner != NULL) ? m_owner->subdevice(tag) : NULL;