PEL: Add location code related stubs

Add 2 location code related API stubs to DataInterface:
* expandLocationCode - Fills in the 'Ufcs' template with the actual
                       feature code and SN.
* getInventoryFromLocCode - Returns the inventory D-Bus object path
                            that that location code represents.

These will eventually wrap D-Bus method calls to the VPD daemon when
that gets implemented.  In the meantime, these can't return
valid data on real hardware but they can be mocked to do so.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I955d8bac626d45ffbed63c29c497ad0db37d9b21
diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index 74da2e2..db80757 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -356,5 +356,33 @@
     return std::get<std::string>(locCode);
 }
 
+std::string
+    DataInterface::addLocationCodePrefix(const std::string& locationCode)
+{
+    static const std::string locationCodePrefix{"Ufcs-"};
+
+    if (locationCode.find(locationCodePrefix) == std::string::npos)
+    {
+        return locationCodePrefix + locationCode;
+    }
+
+    return locationCode;
+}
+
+std::string DataInterface::expandLocationCode(const std::string& locationCode,
+                                              uint16_t node) const
+{
+    // TODO: fill in when that API is available
+    return addLocationCodePrefix(locationCode);
+}
+
+std::string DataInterface::getInventoryFromLocCode(
+    const std::string& unexpandedLocationCode, uint16_t node) const
+{
+    // TODO: fill in when that API is available and  call on
+    // addLocationCodePrefix(unexpandedLocationCode);
+    return {};
+}
+
 } // namespace pels
 } // namespace openpower