Support a list of CSVs for a file table entry path's value

This commit adds support to the FileTable constructor to accept
a list of comma separated values for the value of the "path"
property in the file entry records declared in fileTable.json. The
list's order defines the priority, meaning the first path, if
it exists will be used, then the next is considered, and so on.
This will allow the file table to support files who should consider
patch directories.

Change-Id: Id543946ef93a9f380576def9d68c1c4ab13bf7fc
Signed-off-by: Christian Geddes <crgeddes@us.ibm.com>
diff --git a/oem/ibm/libpldmresponder/file_table.cpp b/oem/ibm/libpldmresponder/file_table.cpp
index 9a71b30..48388ee 100644
--- a/oem/ibm/libpldmresponder/file_table.cpp
+++ b/oem/ibm/libpldmresponder/file_table.cpp
@@ -45,7 +45,22 @@
         std::string filepath = record.value(path, "");
         traits = static_cast<uint32_t>(record.value(fileTraits, 0));
 
-        fs::path fsPath(filepath);
+        // Split the filepath string using ',' as a delimiter
+        // as the json can define multiple paths to try and use
+        // in order of priority
+        std::istringstream stringstream(filepath);
+        std::string path_substr;
+        fs::path fsPath;
+        while (std::getline(stringstream, path_substr, ','))
+        {
+            fsPath.assign(path_substr);
+            if (fs::exists(fsPath))
+            {
+                break;
+            }
+        }
+
+        // Skip file table entry if it is not a regular file
         if (!fs::is_regular_file(fsPath))
         {
             continue;