1
Feature requests / Re: Add readCurrentReadPosition in sf::Packet
« on: July 10, 2016, 09:22:20 am »
The proposed readCurrentReadPosition isn't sufficient without another method to advance the read position (m_readPos).
I think perhaps it's ideal to merely have one method that does both, something like:
Of course, getData() already exists to access packet data from the beginning, so you'd have to find a better name or overload it. Overloading it would perhaps require a second parameter to specify start position (defaulting to 0). Though just naming it something else would perhaps be less confusing for people already using getData().
I think perhaps it's ideal to merely have one method that does both, something like:
const void* getData(std::size_t sizeInBytes);
Of course, getData() already exists to access packet data from the beginning, so you'd have to find a better name or overload it. Overloading it would perhaps require a second parameter to specify start position (defaulting to 0). Though just naming it something else would perhaps be less confusing for people already using getData().