pldm: inband code update: clear the image LIDs when pldm daemon comes up

Clear the LID_STAGING_DIR path when pldm daemon comes up. This function
will also be used during code update process.

Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com>
Change-Id: I2a757caaa3e204e4089235d9e3baf6d425f5bec5
diff --git a/oem/ibm/libpldmresponder/inband_code_update.cpp b/oem/ibm/libpldmresponder/inband_code_update.cpp
index 01d3725..7055c46 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.cpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.cpp
@@ -192,6 +192,15 @@
     oemPlatformHandler = handler;
 }
 
+void CodeUpdate::clearDirPath(const std::string& dirPath)
+{
+    for (auto& path : fs::directory_iterator(dirPath.c_str()))
+    {
+        fs::remove_all(path);
+    }
+    return;
+}
+
 uint8_t fetchBootSide(uint16_t entityInstance, CodeUpdate* codeUpdate)
 {
     uint8_t sensorOpState = tSideNum;