* Runs the specified function for every single byte in the DynamicBuffer * in the reverse order. * * @param func Function to run for every byte. */
| 211 | * @param func Function to run for every byte. |
| 212 | */ |
| 213 | void DynamicBuffer::forEachReverse(const std::function<void(uint8_t&)>& func) |
| 214 | { |
| 215 | for (std::vector<uint8_t>::reverse_iterator itr = _data.rbegin(); |
| 216 | itr != _data.rend(); |
| 217 | ++itr) |
| 218 | { |
| 219 | uint8_t& byte = *itr; |
| 220 | func(byte); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * Reads the null or length terminated string from the buffer. |