From 834c813cc9129926a6825a3e93433a8335f8f78b Mon Sep 17 00:00:00 2001 From: Dimitrios Stoupis <dimitris.apple@gmail.com> Date: Tue, 26 Mar 2019 10:28:54 +0000 Subject: [PATCH] Added a byte skipping method. Fixes #21 --- inc/Message.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/inc/Message.hpp b/inc/Message.hpp index 83c91727..3c6cfe3a 100644 --- a/inc/Message.hpp +++ b/inc/Message.hpp @@ -466,6 +466,16 @@ public: return size; // Return the string size } + /** + * @brief Skip read bytes in the read string + * @details Skips the provided number of bytes, by incrementing the readPosition and this is + * done to avoid accessing the `readPosition` variable directly + * @param numberOfBytes The number of bytes to be skipped + */ + void skipBytes(uint16_t numberOfBytes) { + readPosition += numberOfBytes; + } + /** * Reset the message reading status, and start reading data from it again */ -- GitLab