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.hpp b/extensions/openpower-pels/data_interface.hpp
index a2dd8f2..4883338 100644
--- a/extensions/openpower-pels/data_interface.hpp
+++ b/extensions/openpower-pels/data_interface.hpp
@@ -244,6 +244,36 @@
         return _systemNames;
     }
 
+    /**
+     * @brief Fills in the placeholder 'Ufcs' in the passed in location
+     *        code with the machine feature code and serial number, which
+     *        is needed to create a valid location code.
+     *
+     * @param[in] locationCode - Location code value starting with Ufcs-, and
+     *                           if that isn't present it will be added first.
+     *
+     * @param[in] node - The node number the location is on.
+     *
+     * @return std::string - The expanded location code
+     */
+    virtual std::string expandLocationCode(const std::string& locationCode,
+                                           uint16_t node) const = 0;
+
+    /**
+     * @brief Returns the inventory path for the FRU that the location
+     *        code represents.
+     *
+     * @param[in] locationCode - Location code value starting with Ufcs-, and
+     *                           if that isn't present it will be added first.
+     *
+     * @param[in] node - The node number the location is on.
+     *
+     * @return std::string - The inventory D-Bus object
+     */
+    virtual std::string
+        getInventoryFromLocCode(const std::string& unexpandedLocationCode,
+                                uint16_t node) const = 0;
+
   protected:
     /**
      * @brief Sets the host on/off state and runs any
@@ -434,6 +464,35 @@
     std::string
         getLocationCode(const std::string& inventoryPath) const override;
 
+    /**
+     * @brief Fills in the placeholder 'Ufcs' in the passed in location
+     *        code with the machine feature code and serial number, which
+     *        is needed to create a valid location code.
+     *
+     * @param[in] locationCode - Location code value starting with Ufcs-, and
+     *                           if that isn't present it will be added first.
+     *
+     * @param[in] node - The node number the location is one.
+     *
+     * @return std::string - The expanded location code
+     */
+    std::string expandLocationCode(const std::string& locationCode,
+                                   uint16_t node) const override;
+
+    /**
+     * @brief Returns the inventory path for the FRU that the location
+     *        code represents.
+     *
+     * @param[in] locationCode - Location code value starting with Ufcs-, and
+     *                           if that isn't present it will be added first.
+     *
+     * @param[in] node - The node number the location is on.
+     *
+     * @return std::string - The inventory D-Bus object
+     */
+    std::string getInventoryFromLocCode(const std::string& expandedLocationCode,
+                                        uint16_t node) const override;
+
   private:
     /**
      * @brief Reads the BMC firmware version string and puts it into
@@ -492,6 +551,18 @@
     }
 
     /**
+     * @brief Adds the Ufcs- prefix to the location code passed in.
+     *
+     * Necessary because the location codes that come back from the
+     * message registry and device callout JSON don't have it.
+     *
+     * @param[in] - The location code without a prefix, like P1-C1
+     *
+     * @return std::string - The location code with the prefix
+     */
+    static std::string addLocationCodePrefix(const std::string& locationCode);
+
+    /**
      * @brief The D-Bus property or interface watchers that have callbacks
      *        registered that will set members in this class when
      *        they change.