Add nameLeafProperty function

Add nameLeafProperty() to provide the function to name an object from the
object's leaf and the property name.
E.g. Below config creates the Fan0_Present on DBus:

 entityID: 29
 entityInstance: 13
 interfaces:
   xyz.openbmc_project.Inventory.Item:
     Present:
       Offsets:
         0:
           assert: true
           deassert: false
           type: bool
 mutability: Mutability::Write|Mutability::Read
 path: /xyz/openbmc_project/inventory/Fan0
 readingType: assertion
 sensorNamePattern: nameLeafProperty
 sensorReadingType: 111
 sensorType: 4
 serviceInterface: org.freedesktop.DBus.Properties

Signed-off-by: Lotus Xu <xuxiaohan@bytedance.com>
Change-Id: I58190c6041530e43f03a70c852f90ef51ebe632e
1 file changed