Home | History | Annotate | Download | only in base

Lines Matching refs:iter

99 bool Pickle::ReadBool(void** iter, bool* result) const {
100 DCHECK(iter);
103 if (!ReadInt(iter, &tmp))
110 bool Pickle::ReadInt(void** iter, int* result) const {
111 DCHECK(iter);
112 if (!*iter)
113 *iter = const_cast<char*>(payload());
115 if (!IteratorHasRoomFor(*iter, sizeof(*result)))
120 // Next line is otherwise the same as: memcpy(result, *iter, sizeof(*result));
121 *result = *reinterpret_cast<int*>(*iter);
123 UpdateIter(iter, sizeof(*result));
127 bool Pickle::ReadLong(void** iter, long* result) const {
128 DCHECK(iter);
129 if (!*iter)
130 *iter = const_cast<char*>(payload());
132 if (!IteratorHasRoomFor(*iter, sizeof(*result)))
137 memcpy(result, *iter, sizeof(*result));
139 UpdateIter(iter, sizeof(*result));
143 bool Pickle::ReadSize(void** iter, size_t* result) const {
144 DCHECK(iter);
145 if (!*iter)
146 *iter = const_cast<char*>(payload());
148 if (!IteratorHasRoomFor(*iter, sizeof(*result)))
153 // Next line is otherwise the same as: memcpy(result, *iter, sizeof(*result));
154 *result = *reinterpret_cast<size_t*>(*iter);
156 UpdateIter(iter, sizeof(*result));
160 bool Pickle::ReadUInt16(void** iter, uint16* result) const {
161 DCHECK(iter);
162 if (!*iter)
163 *iter = const_cast<char*>(payload());
165 if (!IteratorHasRoomFor(*iter, sizeof(*result)))
168 memcpy(result, *iter, sizeof(*result));
170 UpdateIter(iter, sizeof(*result));
174 bool Pickle::ReadUInt32(void** iter, uint32* result) const {
175 DCHECK(iter);
176 if (!*iter)
177 *iter = const_cast<char*>(payload());
179 if (!IteratorHasRoomFor(*iter, sizeof(*result)))
182 memcpy(result, *iter, sizeof(*result));
184 UpdateIter(iter, sizeof(*result));
188 bool Pickle::ReadInt64(void** iter, int64* result) const {
189 DCHECK(iter);
190 if (!*iter)
191 *iter = const_cast<char*>(payload());
193 if (!IteratorHasRoomFor(*iter, sizeof(*result)))
196 memcpy(result, *iter, sizeof(*result));
198 UpdateIter(iter, sizeof(*result));
202 bool Pickle::ReadUInt64(void** iter, uint64* result) const {
203 DCHECK(iter);
204 if (!*iter)
205 *iter = const_cast<char*>(payload());
207 if (!IteratorHasRoomFor(*iter, sizeof(*result)))
210 memcpy(result, *iter, sizeof(*result));
212 UpdateIter(iter, sizeof(*result));
216 bool Pickle::ReadString(void** iter, std::string* result) const {
217 DCHECK(iter);
220 if (!ReadLength(iter, &len))
222 if (!IteratorHasRoomFor(*iter, len))
225 char* chars = reinterpret_cast<char*>(*iter);
228 UpdateIter(iter, len);
232 bool Pickle::ReadWString(void** iter, std::wstring* result) const {
233 DCHECK(iter);
236 if (!ReadLength(iter, &len))
241 if (!IteratorHasRoomFor(*iter, len * sizeof(wchar_t)))
244 wchar_t* chars = reinterpret_cast<wchar_t*>(*iter);
247 UpdateIter(iter, len * sizeof(wchar_t));
251 bool Pickle::ReadString16(void** iter, string16* result) const {
252 DCHECK(iter);
255 if (!ReadLength(iter, &len))
257 if (!IteratorHasRoomFor(*iter, len * sizeof(char16)))
260 char16* chars = reinterpret_cast<char16*>(*iter);
263 UpdateIter(iter, len * sizeof(char16));
267 bool Pickle::ReadData(void** iter, const char** data, int* length) const {
268 DCHECK(iter);
274 if (!ReadLength(iter, length))
277 return ReadBytes(iter, data, *length);
280 bool Pickle::ReadBytes(void** iter, const char** data, int length) const {
281 DCHECK(iter);
284 if (!*iter)
285 *iter = const_cast<char*>(payload());
287 if (!IteratorHasRoomFor(*iter, length))
290 *data = reinterpret_cast<const char*>(*iter);
292 UpdateIter(iter, length);
296 bool Pickle::ReadLength(void** iter, int* result) const {
297 if (!ReadInt(iter, result))