Lines Matching refs:val

114     status_t            writeInt32(int32_t val);
115 status_t writeUint32(uint32_t val);
116 status_t writeInt64(int64_t val);
117 status_t writeUint64(uint64_t val);
118 status_t writeFloat(float val);
119 status_t writeDouble(double val);
126 status_t writeStrongBinder(const sp<IBinder>& val);
127 status_t writeInt32Array(size_t len, const int32_t *val);
128 status_t writeByteArray(size_t len, const uint8_t *val);
129 status_t writeBool(bool val);
130 status_t writeChar(char16_t val);
131 status_t writeByte(int8_t val);
138 status_t writeByteVector(const std::optional<std::vector<int8_t>>& val);
139 status_t writeByteVector(const std::unique_ptr<std::vector<int8_t>>& val);
140 status_t writeByteVector(const std::vector<int8_t>& val);
141 status_t writeByteVector(const std::optional<std::vector<uint8_t>>& val);
142 status_t writeByteVector(const std::unique_ptr<std::vector<uint8_t>>& val);
143 status_t writeByteVector(const std::vector<uint8_t>& val);
144 status_t writeInt32Vector(const std::optional<std::vector<int32_t>>& val);
145 status_t writeInt32Vector(const std::unique_ptr<std::vector<int32_t>>& val);
146 status_t writeInt32Vector(const std::vector<int32_t>& val);
147 status_t writeInt64Vector(const std::optional<std::vector<int64_t>>& val);
148 status_t writeInt64Vector(const std::unique_ptr<std::vector<int64_t>>& val);
149 status_t writeInt64Vector(const std::vector<int64_t>& val);
150 status_t writeUint64Vector(const std::optional<std::vector<uint64_t>>& val);
151 status_t writeUint64Vector(const std::unique_ptr<std::vector<uint64_t>>& val);
152 status_t writeUint64Vector(const std::vector<uint64_t>& val);
153 status_t writeFloatVector(const std::optional<std::vector<float>>& val);
154 status_t writeFloatVector(const std::unique_ptr<std::vector<float>>& val);
155 status_t writeFloatVector(const std::vector<float>& val);
156 status_t writeDoubleVector(const std::optional<std::vector<double>>& val);
157 status_t writeDoubleVector(const std::unique_ptr<std::vector<double>>& val);
158 status_t writeDoubleVector(const std::vector<double>& val);
159 status_t writeBoolVector(const std::optional<std::vector<bool>>& val);
160 status_t writeBoolVector(const std::unique_ptr<std::vector<bool>>& val);
161 status_t writeBoolVector(const std::vector<bool>& val);
162 status_t writeCharVector(const std::optional<std::vector<char16_t>>& val);
163 status_t writeCharVector(const std::unique_ptr<std::vector<char16_t>>& val);
164 status_t writeCharVector(const std::vector<char16_t>& val);
166 const std::optional<std::vector<std::optional<String16>>>& val);
168 const std::unique_ptr<std::vector<std::unique_ptr<String16>>>& val);
169 status_t writeString16Vector(const std::vector<String16>& val);
171 const std::optional<std::vector<std::optional<std::string>>>& val);
173 const std::unique_ptr<std::vector<std::unique_ptr<std::string>>>& val);
174 status_t writeUtf8VectorAsUtf16Vector(const std::vector<std::string>& val);
176 status_t writeStrongBinderVector(const std::optional<std::vector<sp<IBinder>>>& val);
177 status_t writeStrongBinderVector(const std::unique_ptr<std::vector<sp<IBinder>>>& val);
178 status_t writeStrongBinderVector(const std::vector<sp<IBinder>>& val);
183 status_t writeEnumVector(const std::vector<T>& val);
185 status_t writeEnumVector(const std::optional<std::vector<T>>& val);
187 status_t writeEnumVector(const std::unique_ptr<std::vector<T>>& val);
190 status_t writeEnumVector(const std::vector<T>& val);
192 status_t writeEnumVector(const std::optional<std::vector<T>>& val);
194 status_t writeEnumVector(const std::unique_ptr<std::vector<T>>& val);
197 status_t writeParcelableVector(const std::optional<std::vector<std::optional<T>>>& val);
199 status_t writeParcelableVector(const std::unique_ptr<std::vector<std::unique_ptr<T>>>& val);
201 status_t writeParcelableVector(const std::shared_ptr<std::vector<std::unique_ptr<T>>>& val);
203 status_t writeParcelableVector(const std::vector<T>& val);
213 status_t write(const Flattenable<T>& val);
216 status_t write(const LightFlattenable<T>& val);
219 status_t writeVectorSize(const std::vector<T>& val);
221 status_t writeVectorSize(const std::optional<std::vector<T>>& val);
223 status_t writeVectorSize(const std::unique_ptr<std::vector<T>>& val);
258 const std::optional<std::vector<base::unique_fd>>& val);
260 const std::unique_ptr<std::vector<base::unique_fd>>& val);
262 const std::vector<base::unique_fd>& val);
277 status_t writeObject(const flat_binder_object& val, bool nullMetaData);
321 status_t readStrongBinder(sp<IBinder>* val) const;
322 status_t readNullableStrongBinder(sp<IBinder>* val) const;
327 status_t readEnumVector(std::vector<T>* val) const;
329 status_t readEnumVector(std::unique_ptr<std::vector<T>>* val) const;
331 status_t readEnumVector(std::optional<std::vector<T>>* val) const;
334 status_t readEnumVector(std::vector<T>* val) const;
336 status_t readEnumVector(std::unique_ptr<std::vector<T>>* val) const;
338 status_t readEnumVector(std::optional<std::vector<T>>* val) const;
342 std::optional<std::vector<std::optional<T>>>* val) const;
345 std::unique_ptr<std::vector<std::unique_ptr<T>>>* val) const;
347 status_t readParcelableVector(std::vector<T>* val) const;
357 status_t readStrongBinder(sp<T>* val) const;
360 status_t readNullableStrongBinder(sp<T>* val) const;
362 status_t readStrongBinderVector(std::optional<std::vector<sp<IBinder>>>* val) const;
363 status_t readStrongBinderVector(std::unique_ptr<std::vector<sp<IBinder>>>* val) const;
364 status_t readStrongBinderVector(std::vector<sp<IBinder>>* val) const;
366 status_t readByteVector(std::optional<std::vector<int8_t>>* val) const;
367 status_t readByteVector(std::unique_ptr<std::vector<int8_t>>* val) const;
368 status_t readByteVector(std::vector<int8_t>* val) const;
369 status_t readByteVector(std::optional<std::vector<uint8_t>>* val) const;
370 status_t readByteVector(std::unique_ptr<std::vector<uint8_t>>* val) const;
371 status_t readByteVector(std::vector<uint8_t>* val) const;
372 status_t readInt32Vector(std::optional<std::vector<int32_t>>* val) const;
373 status_t readInt32Vector(std::unique_ptr<std::vector<int32_t>>* val) const;
374 status_t readInt32Vector(std::vector<int32_t>* val) const;
375 status_t readInt64Vector(std::optional<std::vector<int64_t>>* val) const;
376 status_t readInt64Vector(std::unique_ptr<std::vector<int64_t>>* val) const;
377 status_t readInt64Vector(std::vector<int64_t>* val) const;
378 status_t readUint64Vector(std::optional<std::vector<uint64_t>>* val) const;
379 status_t readUint64Vector(std::unique_ptr<std::vector<uint64_t>>* val) const;
380 status_t readUint64Vector(std::vector<uint64_t>* val) const;
381 status_t readFloatVector(std::optional<std::vector<float>>* val) const;
382 status_t readFloatVector(std::unique_ptr<std::vector<float>>* val) const;
383 status_t readFloatVector(std::vector<float>* val) const;
384 status_t readDoubleVector(std::optional<std::vector<double>>* val) const;
385 status_t readDoubleVector(std::unique_ptr<std::vector<double>>* val) const;
386 status_t readDoubleVector(std::vector<double>* val) const;
387 status_t readBoolVector(std::optional<std::vector<bool>>* val) const;
388 status_t readBoolVector(std::unique_ptr<std::vector<bool>>* val) const;
389 status_t readBoolVector(std::vector<bool>* val) const;
390 status_t readCharVector(std::optional<std::vector<char16_t>>* val) const;
391 status_t readCharVector(std::unique_ptr<std::vector<char16_t>>* val) const;
392 status_t readCharVector(std::vector<char16_t>* val) const;
394 std::optional<std::vector<std::optional<String16>>>* val) const;
396 std::unique_ptr<std::vector<std::unique_ptr<String16>>>* val) const;
397 status_t readString16Vector(std::vector<String16>* val) const;
399 std::optional<std::vector<std::optional<std::string>>>* val) const;
401 std::unique_ptr<std::vector<std::unique_ptr<std::string>>>* val) const;
402 status_t readUtf8VectorFromUtf16Vector(std::vector<std::string>* val) const;
405 status_t read(Flattenable<T>& val) const;
408 status_t read(LightFlattenable<T>& val) const;
411 status_t resizeOutVector(std::vector<T>* val) const;
413 status_t resizeOutVector(std::optional<std::vector<T>>* val) const;
415 status_t resizeOutVector(std::unique_ptr<std::vector<T>>* val) const;
417 status_t reserveOutVector(std::vector<T>* val, size_t* size) const;
419 status_t reserveOutVector(std::optional<std::vector<T>>* val,
422 status_t reserveOutVector(std::unique_ptr<std::vector<T>>* val,
449 base::unique_fd* val) const;
452 status_t readUniqueParcelFileDescriptor(base::unique_fd* val) const;
457 std::optional<std::vector<base::unique_fd>>* val) const;
459 std::unique_ptr<std::vector<base::unique_fd>>* val) const;
461 std::vector<base::unique_fd>* val) const;
508 status_t writePointer(uintptr_t val);
529 status_t writeAligned(T val);
535 status_t writeEnum(const T& val);
537 status_t writeEnum(const T& val);
546 status_t readByteVectorInternal(std::vector<T>* val, size_t size) const;
549 status_t unsafeReadTypedVector(std::vector<T>* val,
552 status_t readNullableTypedVector(std::optional<std::vector<T>>* val,
555 status_t readNullableTypedVector(std::unique_ptr<std::vector<T>>* val,
558 status_t readTypedVector(std::vector<T>* val,
561 status_t unsafeWriteTypedVector(const std::vector<T>& val,
564 status_t writeNullableTypedVector(const std::optional<std::vector<T>>& val,
567 status_t writeNullableTypedVector(const std::unique_ptr<std::vector<T>>& val,
570 status_t writeNullableTypedVector(const std::optional<std::vector<T>>& val,
573 status_t writeNullableTypedVector(const std::unique_ptr<std::vector<T>>& val,
576 status_t writeTypedVector(const std::vector<T>& val,
579 status_t writeTypedVector(const std::vector<T>& val,
650 const Flattenable<T>& val;
651 explicit FlattenableHelper(const Flattenable<T>& _val) : val(_val) { }
657 return val.getFlattenedSize();
660 return val.getFdCount();
663 return val.flatten(buffer, size, fds, count);
666 return const_cast<Flattenable<T>&>(val).unflatten(buffer, size, fds, count);
669 status_t write(const FlattenableHelperInterface& val);
670 status_t read(FlattenableHelperInterface& val) const;
698 status_t Parcel::write(const Flattenable<T>& val) {
699 const FlattenableHelper<T> helper(val);
704 status_t Parcel::write(const LightFlattenable<T>& val) {
705 size_t size(val.getFlattenedSize());
706 if (!val.isFixedSize()) {
719 return val.flatten(buffer, size);
725 status_t Parcel::read(Flattenable<T>& val) const {
726 FlattenableHelper<T> helper(val);
731 status_t Parcel::read(LightFlattenable<T>& val) const {
733 if (val.isFixedSize()) {
734 size = val.getFlattenedSize();
746 val.unflatten(buffer, size);
752 status_t Parcel::writeVectorSize(const std::vector<T>& val) {
753 if (val.size() > INT32_MAX) {
756 return writeInt32(static_cast<int32_t>(val.size()));
760 status_t Parcel::writeVectorSize(const std::optional<std::vector<T>>& val) {
761 if (!val) {
765 return writeVectorSize(*val);
769 status_t Parcel::writeVectorSize(const std::unique_ptr<std::vector<T>>& val) {
770 if (!val) {
774 return writeVectorSize(*val);
778 status_t Parcel::resizeOutVector(std::vector<T>* val) const {
788 val->resize(size_t(size));
793 status_t Parcel::resizeOutVector(std::optional<std::vector<T>>* val) const {
800 val->reset();
802 val->emplace(size_t(size));
809 status_t Parcel::resizeOutVector(std::unique_ptr<std::vector<T>>* val) const {
816 val->reset();
818 val->reset(new std::vector<T>(size_t(size)));
825 status_t Parcel::reserveOutVector(std::vector<T>* val, size_t* size) const {
836 val->reserve(*size);
841 status_t Parcel::reserveOutVector(std::optional<std::vector<T>>* val, size_t* size) const {
850 val->emplace();
851 (*val)->reserve(*size);
853 val->reset();
860 status_t Parcel::reserveOutVector(std::unique_ptr<std::vector<T>>* val,
870 val->reset(new std::vector<T>());
871 (*val)->reserve(*size);
873 val->reset();
880 status_t Parcel::readStrongBinder(sp<T>* val) const {
885 *val = interface_cast<T>(tmp);
887 if (val->get() == nullptr) {
896 status_t Parcel::readNullableStrongBinder(sp<T>* val) const {
901 *val = interface_cast<T>(tmp);
903 if (val->get() == nullptr && tmp.get() != nullptr) {
913 std::vector<T>* val,
926 if (val->max_size() < static_cast<size_t>(size)) {
930 val->resize(static_cast<size_t>(size));
932 if (val->size() < static_cast<size_t>(size)) {
936 for (auto& v: *val) {
948 status_t Parcel::readTypedVector(std::vector<T>* val,
950 return unsafeReadTypedVector(val, read_func);
954 status_t Parcel::readNullableTypedVector(std::optional<std::vector<T>>* val,
959 val->reset();
966 val->emplace();
968 status = unsafeReadTypedVector(&**val, read_func);
971 val->reset();
978 status_t Parcel::readNullableTypedVector(std::unique_ptr<std::vector<T>>* val,
983 val->reset();
990 val->reset(new std::vector<T>());
992 status = unsafeReadTypedVector(val->get(), read_func);
995 val->reset();
1002 status_t Parcel::unsafeWriteTypedVector(const std::vector<T>& val,
1004 if (val.size() > std::numeric_limits<int32_t>::max()) {
1008 status_t status = this->writeInt32(static_cast<int32_t>(val.size()));
1014 for (const auto& item : val) {
1026 status_t Parcel::writeTypedVector(const std::vector<T>& val,
1028 return unsafeWriteTypedVector(val, write_func);
1032 status_t Parcel::writeTypedVector(const std::vector<T>& val,
1034 return unsafeWriteTypedVector(val, write_func);
1038 status_t Parcel::writeNullableTypedVector(const std::optional<std::vector<T>>& val,
1040 if (!val) {
1044 return unsafeWriteTypedVector(*val, write_func);
1048 status_t Parcel::writeNullableTypedVector(const std::unique_ptr<std::vector<T>>& val,
1050 if (val.get() == nullptr) {
1054 return unsafeWriteTypedVector(*val, write_func);
1058 status_t Parcel::writeNullableTypedVector(const std::optional<std::vector<T>>& val,
1060 if (!val) {
1064 return unsafeWriteTypedVector(*val, write_func);
1068 status_t Parcel::writeNullableTypedVector(const std::unique_ptr<std::vector<T>>& val,
1070 if (val.get() == nullptr) {
1074 return unsafeWriteTypedVector(*val, write_func);
1078 status_t Parcel::readParcelableVector(std::vector<T>* val) const {
1079 return unsafeReadTypedVector<T, Parcelable>(val, &Parcel::readParcelable);
1083 status_t Parcel::readParcelableVector(std::optional<std::vector<std::optional<T>>>* val) const {
1087 val->reset();
1094 val->emplace();
1097 status = unsafeReadTypedVector<NullableT, NullableT>(&**val, &Parcel::readParcelable);
1100 val->reset();
1107 status_t Parcel::readParcelableVector(std::unique_ptr<std::vector<std::unique_ptr<T>>>* val) const {
1111 val->reset();
1118 val->reset(new std::vector<std::unique_ptr<T>>());
1121 status = unsafeReadTypedVector<NullableT, NullableT>(val->get(), &Parcel::readParcelable);
1124 val->reset();
1187 status_t Parcel::writeParcelableVector(const std::vector<T>& val) {
1188 return unsafeWriteTypedVector<T,const Parcelable&>(val, &Parcel::writeParcelable);
1192 status_t Parcel::writeParcelableVector(const std::optional<std::vector<std::optional<T>>>& val) {
1193 if (!val) {
1198 return unsafeWriteTypedVector<NullableT, const NullableT&>(*val, &Parcel::writeNullableParcelable);
1202 status_t Parcel::writeParcelableVector(const std::unique_ptr<std::vector<std::unique_ptr<T>>>& val) {
1203 if (val.get() == nullptr) {
1207 return unsafeWriteTypedVector(*val, &Parcel::writeNullableParcelable<T>);
1211 status_t Parcel::writeParcelableVector(const std::shared_ptr<std::vector<std::unique_ptr<T>>>& val) {
1212 if (val.get() == nullptr) {
1217 return unsafeWriteTypedVector<NullableT, const NullableT&>(*val, &Parcel::writeNullableParcelable);
1221 status_t Parcel::writeEnum(const T& val) {
1222 return writeInt32(static_cast<int32_t>(val));
1225 status_t Parcel::writeEnum(const T& val) {
1226 return writeInt64(static_cast<int64_t>(val));
1230 status_t Parcel::writeEnumVector(const std::vector<T>& val) {
1231 return writeByteVectorInternal(reinterpret_cast<const int8_t*>(val.data()), val.size());
1234 status_t Parcel::writeEnumVector(const std::optional<std::vector<T>>& val) {
1235 if (!val) return writeInt32(-1);
1236 return writeByteVectorInternal(reinterpret_cast<const int8_t*>(val->data()), val->size());
1239 status_t Parcel::writeEnumVector(const std::unique_ptr<std::vector<T>>& val) {
1240 if (!val) return writeInt32(-1);
1241 return writeByteVectorInternal(reinterpret_cast<const int8_t*>(val->data()), val->size());
1244 status_t Parcel::writeEnumVector(const std::vector<T>& val) {
1245 return writeTypedVector(val, &Parcel::writeEnum);
1248 status_t Parcel::writeEnumVector(const std::optional<std::vector<T>>& val) {
1249 return writeNullableTypedVector(val, &Parcel::writeEnum);
1252 status_t Parcel::writeEnumVector(const std::unique_ptr<std::vector<T>>& val) {
1253 return writeNullableTypedVector(val, &Parcel::writeEnum);
1266 inline status_t Parcel::readByteVectorInternal(std::vector<T>* val, size_t size) const {
1271 val->clear();
1272 val->insert(val->begin(), data, data+size);
1277 status_t Parcel::readEnumVector(std::vector<T>* val) const {
1279 if (status_t status = reserveOutVector(val, &size); status != OK) return status;
1280 return readByteVectorInternal(val, size);
1283 status_t Parcel::readEnumVector(std::optional<std::vector<T>>* val) const {
1285 if (status_t status = reserveOutVector(val, &size); status != OK) return status;
1286 if (!*val) {
1291 return readByteVectorInternal(&**val, size);
1294 status_t Parcel::readEnumVector(std::unique_ptr<std::vector<T>>* val) const {
1296 if (status_t status = reserveOutVector(val, &size); status != OK) return status;
1297 if (val->get() == nullptr) {
1302 return readByteVectorInternal(val->get(), size);
1305 status_t Parcel::readEnumVector(std::vector<T>* val) const {
1306 return readTypedVector(val, &Parcel::readEnum);
1309 status_t Parcel::readEnumVector(std::optional<std::vector<T>>* val) const {
1310 return readNullableTypedVector(val, &Parcel::readEnum);
1313 status_t Parcel::readEnumVector(std::unique_ptr<std::vector<T>>* val) const {
1314 return readNullableTypedVector(val, &Parcel::readEnum);