Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - wallacoloo

Pages: [1]
1
Feature requests / Re: sf::Packet seek method
« on: July 26, 2012, 08:30:16 pm »
Ah. I had searched the forums and turned up nothing, but there is an issue (that you yourself opened) that proposes this exact functionality. My bad - I'll check the tracker as well next time.

2
Feature requests / sf::Packet seek method
« on: July 25, 2012, 11:06:44 pm »
I recently found myself needing a seek method on sf::Packet in order to read some data from an arbitrary byte offset into the packet. I could have read the entire packet into an array and then parsed it myself using the network-to-host set of functions in C while keeping track of the index I'm at, etc. But that's reimplementing a lot of functionality already provided by the packet class. So I looked into the implementation and found that a Packet just uses a std::vector to store all the data and size_t to keep track of the index. A seek method can literally be implemented in two lines of code by just setting m_readPos and m_isValid.

Would a seek method expose too much of the implementation or does this seem like a reasonable feature to implement?

Pages: [1]