diff options
author | Benjamin Dobell <benjamin.dobell@glassechidna.com.au> | 2011-07-07 21:02:18 +0200 |
---|---|---|
committer | Benjamin Dobell <benjamin.dobell@glassechidna.com.au> | 2011-07-07 21:02:18 +0200 |
commit | 5ce92c078692bb7fb5020d9ddec7ade6dacac1e9 (patch) | |
tree | 7fd4b4cecb9e222b11fd5927b6f30155dd3815fc /libpit/Source/libpit.cpp | |
parent | Major 1.3 updates (diff) | |
download | Heimdall-5ce92c078692bb7fb5020d9ddec7ade6dacac1e9.tar Heimdall-5ce92c078692bb7fb5020d9ddec7ade6dacac1e9.tar.gz Heimdall-5ce92c078692bb7fb5020d9ddec7ade6dacac1e9.tar.bz2 Heimdall-5ce92c078692bb7fb5020d9ddec7ade6dacac1e9.tar.lz Heimdall-5ce92c078692bb7fb5020d9ddec7ade6dacac1e9.tar.xz Heimdall-5ce92c078692bb7fb5020d9ddec7ade6dacac1e9.tar.zst Heimdall-5ce92c078692bb7fb5020d9ddec7ade6dacac1e9.zip |
Diffstat (limited to 'libpit/Source/libpit.cpp')
-rwxr-xr-x | libpit/Source/libpit.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libpit/Source/libpit.cpp b/libpit/Source/libpit.cpp index 030a80b..1eb3e76 100755 --- a/libpit/Source/libpit.cpp +++ b/libpit/Source/libpit.cpp @@ -43,6 +43,21 @@ PitEntry::~PitEntry() { } +bool PitEntry::Matches(const PitEntry *otherPitEntry) const +{ + if (unused == otherPitEntry->unused && partitionType == otherPitEntry->partitionType && partitionIdentifier == otherPitEntry->partitionIdentifier + && partitionFlags == otherPitEntry->partitionFlags && unknown1 == otherPitEntry->unknown1 && partitionBlockSize == otherPitEntry->partitionBlockSize + && partitionBlockCount == otherPitEntry->partitionBlockCount && unknown2 == otherPitEntry->unknown2 && unknown3 == otherPitEntry->unknown3 + && strcmp(partitionName, otherPitEntry->partitionName) == 0 && strcmp(filename, otherPitEntry->filename) == 0) + { + return (true); + } + else + { + return (false); + } +} + PitData::PitData() @@ -179,6 +194,26 @@ void PitData::Pack(unsigned char *data) const } } +bool PitData::Matches(const PitData *otherPitData) const +{ + if (entryCount == otherPitData->entryCount && unknown1 == otherPitData->unknown1 && unknown2 == otherPitData->unknown2 + && unknown3 == otherPitData->unknown3 && unknown4 == otherPitData->unknown4 && unknown5 == otherPitData->unknown5 + && unknown6 == otherPitData->unknown6 && unknown7 == otherPitData->unknown7 && unknown8 == otherPitData->unknown8) + { + for (unsigned int i = 0; i < entryCount; i++) + { + if (!entries[i]->Matches(otherPitData->entries[i])) + return (false); + } + + return (true); + } + else + { + return (false); + } +} + void PitData::Clear(void) { entryCount = 0; |