diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-08-02 21:49:52 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:16:10 +0200 |
commit | ca725b9301f2e2274788f6b3e9bc45d6d6986aa5 (patch) | |
tree | 8834ccd77c695a821bec4787c1d7e45f6890242e /sibs/SafeDeserializer.hpp | |
parent | 71a8906ae6414df3646ef81e1cd9cd6947eb0a6d (diff) |
Add skip method to deserializer
Diffstat (limited to 'sibs/SafeDeserializer.hpp')
-rw-r--r-- | sibs/SafeDeserializer.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sibs/SafeDeserializer.hpp b/sibs/SafeDeserializer.hpp index 0110920..763140a 100644 --- a/sibs/SafeDeserializer.hpp +++ b/sibs/SafeDeserializer.hpp @@ -97,6 +97,13 @@ namespace sibs { return size; } + + void skip(usize bytesToSkip) + { + bytesToSkip = bytesToSkip < size ? bytesToSkip : size; + size -= bytesToSkip; + data += bytesToSkip; + } private: void verifyExtractSize(usize typeSize) const { |