Implement buildFileTable interface
The buildFileTable interface will be used by the ReadFileIntoMemory
and WriteFileFromMemory commands to get the file table and map the
file handle to the file path.
Change-Id: Ibdc01737d8925ef918c4fbe2919108d96a2807ab
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/libpldmresponder/file_table.cpp b/libpldmresponder/file_table.cpp
index 85f417c..9264f21 100644
--- a/libpldmresponder/file_table.cpp
+++ b/libpldmresponder/file_table.cpp
@@ -115,5 +115,15 @@
return table;
}
+FileTable& buildFileTable(const std::string& fileTablePath)
+{
+ static FileTable table;
+ if (table.isEmpty())
+ {
+ table = std::move(FileTable(fileTablePath));
+ }
+ return table;
+}
+
} // namespace filetable
} // namespace pldm