Hi benj,
Giving direct control to the read pointer means you have to first know where you are in the buffer so you can then skip the required number of bytes which could get a bit messy.
To use this function i would use the buffer so it was configured to "store x values first", so once the buffer was full no more data would be placed into the buffer. After flushing the buffer and loading data into the buffer, the data will go from byte 0 through to byte N. A "get byte" operation at the moment will get byte 0 and then the next "get byte" operation would get byte 1 and so on. So in this mode setting the pointer to say byte 15 and then doing a "get byte" operation gets the contents of byte 15 without having to a whole lot of reads to access this data.
Would you be throwing the skipped data away or would you still need to access it?
With any skipped data it would be fine to leave that alone. Once the data from the string that has been placed into the buffer has been processed a "flush buffer" operation would be used to clear the buffer out and set the pointer back to zero ready for the next string of data to be placed into the buffer.
I could do a GetByteFromIdx macro but you would also probably need a GetReadIdx macro and so it starts getting complicated.
I can see what you mean with things getting messy, if the buffer was configured as a "store last x values" so it kept overwriting itself you would always need to know where the pointer was. It would be my intention to use this function only when you were in the "store x values first" mode. Could it be made so this function was only available when the buffer was configured in this mode? Does this sound like it is a workable idea?
Thanks