But, if I have:
Send:
sf::Packet packet;
packet << (int); //saved length
packet << string; //saved type of packet
packet.append(somedata, somelength);
//... sending packet
Recive:
sf::Packet packet;
//... reciving packet
packet >> (int);
packet >> string;
void* read = packet.getData();
From what position should read data added using append?
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: 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().