|
|
| 251 |
/** |
251 |
/** |
| 252 |
* \return the byte read in the buffer. |
252 |
* \return the byte read in the buffer. |
| 253 |
* |
253 |
* |
|
|
254 |
* Read data, but do not advance the Iterator read. |
| 255 |
*/ |
| 256 |
inline uint8_t PeekU8 (void); |
| 257 |
|
| 258 |
/** |
| 259 |
* \return the byte read in the buffer. |
| 260 |
* |
| 254 |
* Read data and advance the Iterator by the number of bytes |
261 |
* Read data and advance the Iterator by the number of bytes |
| 255 |
* read. |
262 |
* read. |
| 256 |
*/ |
263 |
*/ |
|
|
| 332 |
* \param size number of bytes to copy |
339 |
* \param size number of bytes to copy |
| 333 |
* |
340 |
* |
| 334 |
* Copy size bytes of data from the internal buffer to the |
341 |
* Copy size bytes of data from the internal buffer to the |
| 335 |
* input buffer and avance the Iterator by the number of |
342 |
* input buffer and advance the Iterator by the number of |
| 336 |
* bytes read. |
343 |
* bytes read. |
| 337 |
*/ |
344 |
*/ |
| 338 |
void Read (uint8_t *buffer, uint32_t size); |
345 |
void Read (uint8_t *buffer, uint32_t size); |
| 339 |
|
346 |
|
| 340 |
/** |
347 |
/** |
|
|
348 |
* \param start start iterator of the buffer to copy data into |
| 349 |
* \param size number of bytes to copy |
| 350 |
* |
| 351 |
* Copy size bytes of data from the internal buffer to the input buffer via |
| 352 |
* the provided iterator and advance the Iterator by the number of bytes |
| 353 |
* read. |
| 354 |
*/ |
| 355 |
inline void Read (Iterator start, uint32_t size); |
| 356 |
|
| 357 |
/** |
| 341 |
* \brief Calculate the checksum. |
358 |
* \brief Calculate the checksum. |
| 342 |
* \param size size of the buffer. |
359 |
* \param size size of the buffer. |
| 343 |
* \return checksum |
360 |
* \return checksum |
|
Lines 814-819
Buffer::Iterator::ReadNtohU32 (void)
|
Link Here
|
|---|
|
| 814 |
} |
831 |
} |
| 815 |
|
832 |
|
| 816 |
uint8_t |
833 |
uint8_t |
|
|
834 |
Buffer::Iterator::PeekU8 (void) |
| 835 |
{ |
| 836 |
uint8_t ret = ReadU8 (); |
| 837 |
Prev (); |
| 838 |
return ret; |
| 839 |
} |
| 840 |
|
| 841 |
uint8_t |
| 817 |
Buffer::Iterator::ReadU8 (void) |
842 |
Buffer::Iterator::ReadU8 (void) |
| 818 |
{ |
843 |
{ |
| 819 |
NS_ASSERT_MSG (m_current >= m_dataStart && |
844 |
NS_ASSERT_MSG (m_current >= m_dataStart && |
|
Lines 851-856
Buffer::Iterator::ReadU16 (void)
|
Link Here
|
|---|
|
| 851 |
return data; |
876 |
return data; |
| 852 |
} |
877 |
} |
| 853 |
|
878 |
|
|
|
879 |
void |
| 880 |
Buffer::Iterator::Read (Buffer::Iterator start, uint32_t size) |
| 881 |
{ |
| 882 |
Buffer::Iterator end = *this; |
| 883 |
end.Next (size); |
| 884 |
|
| 885 |
start.Write (*this, end); |
| 886 |
} |
| 887 |
|
| 888 |
|
| 854 |
Buffer::Buffer (Buffer const&o) |
889 |
Buffer::Buffer (Buffer const&o) |
| 855 |
: m_data (o.m_data), |
890 |
: m_data (o.m_data), |
| 856 |
m_maxZeroAreaStart (o.m_zeroAreaStart), |
891 |
m_maxZeroAreaStart (o.m_zeroAreaStart), |
| 857 |
- |
|
|