[*] Update AuByteBuffer::Pad to include bUpdateWriteHead argument. broke previous behavior bc this is more convenient and old users were already doing this after the fact
This commit is contained in:
parent
ac69c4c2ff
commit
daf4552eb2
@ -397,7 +397,7 @@ namespace Aurora::Memory
|
|||||||
|
|
||||||
// Utilities
|
// Utilities
|
||||||
inline bool Trim(AuUInt tail);
|
inline bool Trim(AuUInt tail);
|
||||||
inline bool Pad(AuUInt16 aPowOf2, AuUInt8 magicCharacter = '\x00');
|
inline bool Pad(AuUInt16 aPowOf2, AuUInt8 magicCharacter = '\x00', bool bUpdateWriteHead = true);
|
||||||
inline bool Fill(AuUInt length, AuUInt8 magicCharacter = '\x00');
|
inline bool Fill(AuUInt length, AuUInt8 magicCharacter = '\x00');
|
||||||
|
|
||||||
// Templated read/write for **PODs**
|
// Templated read/write for **PODs**
|
||||||
|
@ -67,7 +67,7 @@ namespace Aurora::Memory
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ByteBuffer::Pad(AuUInt16 aPowOf2, AuUInt8 magicCharacter)
|
bool ByteBuffer::Pad(AuUInt16 aPowOf2, AuUInt8 magicCharacter, bool bUpdateWriteHead)
|
||||||
{
|
{
|
||||||
ByteBufferPushWriteState a(*this);
|
ByteBufferPushWriteState a(*this);
|
||||||
|
|
||||||
@ -85,7 +85,14 @@ namespace Aurora::Memory
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->writePtr = this->base + length;
|
if (bUpdateWriteHead)
|
||||||
|
{
|
||||||
|
this->writePtr = this->base + newLen;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->writePtr = this->base + length;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user