diff options
author | Patrick Venture <venture@google.com> | 2018-10-21 13:03:01 -0700 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2018-10-30 08:28:31 -0700 |
commit | f0f1ab9f94c58cdddae3c5036c1cbc6a95a7016d (patch) | |
tree | ab1a44642c9024e0945c70b6597ff987121d8674 /fru_area.hpp | |
parent | 740d8c00d3947dccb08611545f49da2bc5094189 (diff) | |
download | ipmi-fru-parser-f0f1ab9f94c58cdddae3c5036c1cbc6a95a7016d.tar.gz ipmi-fru-parser-f0f1ab9f94c58cdddae3c5036c1cbc6a95a7016d.zip |
IPMIFruArea: use vector instead of raw byte pointer
Use vector of bytes instead of raw byte pointer.
Change-Id: I20a2beec3cbbc44c8cc3a48cefd73f3f27bdcc8f
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'fru_area.hpp')
-rw-r--r-- | fru_area.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fru_area.hpp b/fru_area.hpp index 28d50be..5294be2 100644 --- a/fru_area.hpp +++ b/fru_area.hpp @@ -38,7 +38,7 @@ class IPMIFruArea // Returns the length. size_t getLength() const { - return len; + return data.size(); } // Returns the type of the current fru area @@ -72,9 +72,9 @@ class IPMIFruArea } // Returns the data portion - inline uint8_t* getData() const + inline const uint8_t* getData() const { - return data; + return data.data(); } // Accepts a pointer to data and sets it in the object. @@ -93,9 +93,6 @@ class IPMIFruArea // Name of the fru area. ( BOARD/CHASSIS/PRODUCT ) std::string name; - // Length of a specific fru area. - size_t len = 0; - // Special bit for BMC readable eeprom only. bool bmcOnlyFru = false; @@ -106,7 +103,7 @@ class IPMIFruArea bool isValid = false; // Actual area data. - uint8_t* data = nullptr; + std::vector<uint8_t> data; // fru inventory dbus name std::string busName; |