fru-device: add offset variant of FRUReader abstraction

The caching FRUReader class is now joined by OffsetFRUReader, both of
which now derive from a common BaseFRUReader class.  OffsetFRUReader is
constructed in terms of an existing BaseFRUReader (probably a FRUReader)
and simply applies a fixed offset to all reads performed on it.

Tested: on an ASRock Rack romed8hm3, fru-device successfully recognizes
and parses the baseboard FRU EEPROM as it did prior to this patch.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I13f3bc48110b8ffdf1d3f135c57ae9f0736a8e53
diff --git a/src/fru_reader.cpp b/src/fru_reader.cpp
index 61d4020..b0ee8fe 100644
--- a/src/fru_reader.cpp
+++ b/src/fru_reader.cpp
@@ -89,3 +89,8 @@
 
     return done;
 }
+
+ssize_t OffsetFRUReader::read(off_t start, size_t len, uint8_t* outbuf)
+{
+    return inner.read(start + offset, len, outbuf);
+}
diff --git a/src/fru_utils.cpp b/src/fru_utils.cpp
index e030ac8..5e8e695 100644
--- a/src/fru_utils.cpp
+++ b/src/fru_utils.cpp
@@ -590,7 +590,7 @@
     return true;
 }
 
-bool findFRUHeader(FRUReader& reader, const std::string& errorHelp,
+bool findFRUHeader(BaseFRUReader& reader, const std::string& errorHelp,
                    std::array<uint8_t, I2C_SMBUS_BLOCK_MAX>& blockData,
                    off_t& baseOffset)
 {
@@ -634,7 +634,7 @@
     return false;
 }
 
-std::vector<uint8_t> readFRUContents(FRUReader& reader,
+std::vector<uint8_t> readFRUContents(BaseFRUReader& reader,
                                      const std::string& errorHelp)
 {
     std::array<uint8_t, I2C_SMBUS_BLOCK_MAX> blockData{};