OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_QUIC_QUIC_DATA_READER_H_ | 5 #ifndef NET_QUIC_QUIC_DATA_READER_H_ |
6 #define NET_QUIC_QUIC_DATA_READER_H_ | 6 #define NET_QUIC_QUIC_DATA_READER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
10 #include "net/base/int128.h" | 10 #include "net/base/int128.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Reads a 64-bit unsigned integer into the given output parameter. | 52 // Reads a 64-bit unsigned integer into the given output parameter. |
53 // Forwards the internal iterator on success. | 53 // Forwards the internal iterator on success. |
54 // Returns true on success, false otherwise. | 54 // Returns true on success, false otherwise. |
55 bool ReadUInt64(uint64* result); | 55 bool ReadUInt64(uint64* result); |
56 | 56 |
57 // Reads a 128-bit unsigned integer into the given output parameter. | 57 // Reads a 128-bit unsigned integer into the given output parameter. |
58 // Forwards the internal iterator on success. | 58 // Forwards the internal iterator on success. |
59 // Returns true on success, false otherwise. | 59 // Returns true on success, false otherwise. |
60 bool ReadUInt128(uint128* result); | 60 bool ReadUInt128(uint128* result); |
| 61 |
61 // Reads a string prefixed with 16-bit length into the given output parameter. | 62 // Reads a string prefixed with 16-bit length into the given output parameter. |
62 // | 63 // |
63 // NOTE: Does not copy but rather references strings in the underlying buffer. | 64 // NOTE: Does not copy but rather references strings in the underlying buffer. |
64 // This should be kept in mind when handling memory management! | 65 // This should be kept in mind when handling memory management! |
65 // | 66 // |
66 // Forwards the internal iterator on success. | 67 // Forwards the internal iterator on success. |
67 // Returns true on success, false otherwise. | 68 // Returns true on success, false otherwise. |
68 bool ReadStringPiece16(base::StringPiece* result); | 69 bool ReadStringPiece16(base::StringPiece* result); |
69 | 70 |
70 // Reads a given number of bytes into the given buffer. The buffer | 71 // Reads a given number of bytes into the given buffer. The buffer |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // The length of the data buffer that we're reading from. | 117 // The length of the data buffer that we're reading from. |
117 const size_t len_; | 118 const size_t len_; |
118 | 119 |
119 // The location of the next read from our data buffer. | 120 // The location of the next read from our data buffer. |
120 size_t pos_; | 121 size_t pos_; |
121 }; | 122 }; |
122 | 123 |
123 } // namespace net | 124 } // namespace net |
124 | 125 |
125 #endif // NET_QUIC_QUIC_DATA_READER_H_ | 126 #endif // NET_QUIC_QUIC_DATA_READER_H_ |
OLD | NEW |