blob: 2d7996b9d88002fa23ad64fc506834c8f0f4cf90 [file] [log] [blame]
Ryan Mitchellefcdb952021-04-14 17:31:37 -07001/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#include "ValueTransformer.h"
18
19#include "ResourceValues.h"
20
21namespace aapt {
22
23#define VALUE_CREATE_VALUE_DECL(T) \
24 std::unique_ptr<Value> ValueTransformer::TransformValue(const T* value) { \
25 return TransformDerived(value); \
26 }
27
28#define VALUE_CREATE_ITEM_DECL(T) \
29 std::unique_ptr<Item> ValueTransformer::TransformItem(const T* value) { \
30 return TransformDerived(value); \
31 } \
32 std::unique_ptr<Value> ValueTransformer::TransformValue(const T* value) { \
33 return TransformItem(value); \
34 }
35
36VALUE_CREATE_ITEM_DECL(Id);
37VALUE_CREATE_ITEM_DECL(Reference);
38VALUE_CREATE_ITEM_DECL(RawString);
39VALUE_CREATE_ITEM_DECL(String);
40VALUE_CREATE_ITEM_DECL(StyledString);
41VALUE_CREATE_ITEM_DECL(FileReference);
42VALUE_CREATE_ITEM_DECL(BinaryPrimitive);
43
44VALUE_CREATE_VALUE_DECL(Attribute);
45VALUE_CREATE_VALUE_DECL(Style);
46VALUE_CREATE_VALUE_DECL(Array);
47VALUE_CREATE_VALUE_DECL(Plural);
48VALUE_CREATE_VALUE_DECL(Styleable);
Ryan Mitchell326e35ff2021-04-12 07:50:42 -070049VALUE_CREATE_VALUE_DECL(Macro);
Ryan Mitchellefcdb952021-04-14 17:31:37 -070050
51} // namespace aapt