2 * Copyright (C) 2014 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include <utils/KeyedVector.h>
21 #include <utils/SortedVector.h>
22 #include <utils/String8.h>
23 #include <utils/Vector.h>
27 android::Vector<android::String8> split(const android::String8& str, const char sep);
28 android::Vector<android::String8> splitAndLowerCase(const android::String8& str, const char sep);
30 template <typename KEY, typename VALUE>
31 void appendValue(android::KeyedVector<KEY, android::Vector<VALUE> >& keyedVector,
32 const KEY& key, const VALUE& value);
34 template <typename KEY, typename VALUE>
35 void appendValue(android::KeyedVector<KEY, android::SortedVector<VALUE> >& keyedVector,
36 const KEY& key, const VALUE& value);
42 template <typename KEY, typename VALUE>
43 void appendValue(android::KeyedVector<KEY, android::Vector<VALUE> >& keyedVector,
44 const KEY& key, const VALUE& value) {
45 ssize_t idx = keyedVector.indexOfKey(key);
47 idx = keyedVector.add(key, android::Vector<VALUE>());
49 keyedVector.editValueAt(idx).add(value);
52 template <typename KEY, typename VALUE>
53 void appendValue(android::KeyedVector<KEY, android::SortedVector<VALUE> >& keyedVector,
54 const KEY& key, const VALUE& value) {
55 ssize_t idx = keyedVector.indexOfKey(key);
57 idx = keyedVector.add(key, android::SortedVector<VALUE>());
59 keyedVector.editValueAt(idx).add(value);
62 } // namespace AaptUtil