From ca725b9301f2e2274788f6b3e9bc45d6d6986aa5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 2 Aug 2018 21:49:52 +0200 Subject: Add skip method to deserializer --- sibs/SafeDeserializer.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sibs/SafeDeserializer.hpp') 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 { -- cgit v1.2.3