Lines Matching refs:key

58 bool getValue(const android::String16& key, T* out, const std::map<android::String16, T>& map) {
59 const auto& it = map.find(key);
79 #define RETURN_IF_ENTRY_ERASED(map, key) \
81 size_t num_erased = map.erase(key); \
152 size_t PersistableBundle::erase(const String16& key) {
153 RETURN_IF_ENTRY_ERASED(mBoolMap, key);
154 RETURN_IF_ENTRY_ERASED(mIntMap, key);
155 RETURN_IF_ENTRY_ERASED(mLongMap, key);
156 RETURN_IF_ENTRY_ERASED(mDoubleMap, key);
157 RETURN_IF_ENTRY_ERASED(mStringMap, key);
158 RETURN_IF_ENTRY_ERASED(mBoolVectorMap, key);
159 RETURN_IF_ENTRY_ERASED(mIntVectorMap, key);
160 RETURN_IF_ENTRY_ERASED(mLongVectorMap, key);
161 RETURN_IF_ENTRY_ERASED(mDoubleVectorMap, key);
162 RETURN_IF_ENTRY_ERASED(mStringVectorMap, key);
163 return mPersistableBundleMap.erase(key);
166 void PersistableBundle::putBoolean(const String16& key, bool value) {
167 erase(key);
168 mBoolMap[key] = value;
171 void PersistableBundle::putInt(const String16& key, int32_t value) {
172 erase(key);
173 mIntMap[key] = value;
176 void PersistableBundle::putLong(const String16& key, int64_t value) {
177 erase(key);
178 mLongMap[key] = value;
181 void PersistableBundle::putDouble(const String16& key, double value) {
182 erase(key);
183 mDoubleMap[key] = value;
186 void PersistableBundle::putString(const String16& key, const String16& value) {
187 erase(key);
188 mStringMap[key] = value;
191 void PersistableBundle::putBooleanVector(const String16& key, const std::vector<bool>& value) {
192 erase(key);
193 mBoolVectorMap[key] = value;
196 void PersistableBundle::putIntVector(const String16& key, const std::vector<int32_t>& value) {
197 erase(key);
198 mIntVectorMap[key] = value;
201 void PersistableBundle::putLongVector(const String16& key, const std::vector<int64_t>& value) {
202 erase(key);
203 mLongVectorMap[key] = value;
206 void PersistableBundle::putDoubleVector(const String16& key, const std::vector<double>& value) {
207 erase(key);
208 mDoubleVectorMap[key] = value;
211 void PersistableBundle::putStringVector(const String16& key, const std::vector<String16>& value) {
212 erase(key);
213 mStringVectorMap[key] = value;
216 void PersistableBundle::putPersistableBundle(const String16& key, const PersistableBundle& value) {
217 erase(key);
218 mPersistableBundleMap[key] = value;
221 bool PersistableBundle::getBoolean(const String16& key, bool* out) const {
222 return getValue(key, out, mBoolMap);
225 bool PersistableBundle::getInt(const String16& key, int32_t* out) const {
226 return getValue(key, out, mIntMap);
229 bool PersistableBundle::getLong(const String16& key, int64_t* out) const {
230 return getValue(key, out, mLongMap);
233 bool PersistableBundle::getDouble(const String16& key, double* out) const {
234 return getValue(key, out, mDoubleMap);
237 bool PersistableBundle::getString(const String16& key, String16* out) const {
238 return getValue(key, out, mStringMap);
241 bool PersistableBundle::getBooleanVector(const String16& key, std::vector<bool>* out) const {
242 return getValue(key, out, mBoolVectorMap);
245 bool PersistableBundle::getIntVector(const String16& key, std::vector<int32_t>* out) const {
246 return getValue(key, out, mIntVectorMap);
249 bool PersistableBundle::getLongVector(const String16& key, std::vector<int64_t>* out) const {
250 return getValue(key, out, mLongVectorMap);
253 bool PersistableBundle::getDoubleVector(const String16& key, std::vector<double>* out) const {
254 return getValue(key, out, mDoubleVectorMap);
257 bool PersistableBundle::getStringVector(const String16& key, std::vector<String16>* out) const {
258 return getValue(key, out, mStringVectorMap);
261 bool PersistableBundle::getPersistableBundle(const String16& key, PersistableBundle* out) const {
262 return getValue(key, out, mPersistableBundleMap);
268 * frameworks/base/core/java/android/os/Parcel.java, the number of key
269 * value pairs must be written into the parcel before writing the key-value
359 * key-value pairs must be read from the parcel before reading the key-value
367 String16 key;
369 RETURN_IF_FAILED(parcel->readString16(&key));
378 RETURN_IF_FAILED(parcel->readString16(&mStringMap[key]));
382 RETURN_IF_FAILED(parcel->readInt32(&mIntMap[key]));
386 RETURN_IF_FAILED(parcel->readInt64(&mLongMap[key]));
390 RETURN_IF_FAILED(parcel->readDouble(&mDoubleMap[key]));
394 RETURN_IF_FAILED(parcel->readBool(&mBoolMap[key]));
398 RETURN_IF_FAILED(parcel->readString16Vector(&mStringVectorMap[key]));
402 RETURN_IF_FAILED(parcel->readInt32Vector(&mIntVectorMap[key]));
406 RETURN_IF_FAILED(parcel->readInt64Vector(&mLongVectorMap[key]));
410 RETURN_IF_FAILED(parcel->readBoolVector(&mBoolVectorMap[key]));
414 RETURN_IF_FAILED(mPersistableBundleMap[key].readFromParcel(parcel));
418 RETURN_IF_FAILED(parcel->readDoubleVector(&mDoubleVectorMap[key]));