summaryrefslogtreecommitdiffstats
path: root/libpit/Source/libpit.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libpit/Source/libpit.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/libpit/Source/libpit.h b/libpit/Source/libpit.h
index 9e6c452..eb37647 100644
--- a/libpit/Source/libpit.h
+++ b/libpit/Source/libpit.h
@@ -250,7 +250,8 @@ namespace libpit
enum
{
kFileIdentifier = 0x12349876,
- kHeaderDataSize = 28
+ kHeaderDataSize = 28,
+ kPaddedSizeMultiplicand = 4096
};
private:
@@ -349,6 +350,22 @@ namespace libpit
return entryCount;
}
+ unsigned int GetDataSize(void) const
+ {
+ return PitData::kHeaderDataSize + entryCount * PitEntry::kDataSize;
+ }
+
+ unsigned int GetPaddedSize(void) const
+ {
+ unsigned int dataSize = GetDataSize();
+ unsigned int paddedSize = (dataSize / kPaddedSizeMultiplicand) * kPaddedSizeMultiplicand;
+
+ if (dataSize % kPaddedSizeMultiplicand != 0)
+ paddedSize += kPaddedSizeMultiplicand;
+
+ return paddedSize;
+ }
+
unsigned int GetUnknown1(void) const
{
return unknown1;