1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #ifndef CPP_ABCKIT_CORE_ANNOTATION_INTERFACE_FIELD_IMPL_H
17 #define CPP_ABCKIT_CORE_ANNOTATION_INTERFACE_FIELD_IMPL_H
18
19 #include "annotation_interface_field.h"
20 #include "annotation_interface.h"
21 #include "../value.h"
22
23 namespace abckit::core {
24
GetFile()25 inline const File *AnnotationInterfaceField::GetFile() const
26 {
27 return GetResource();
28 }
29
GetName()30 inline std::string AnnotationInterfaceField::GetName() const
31 {
32 const ApiConfig *conf = GetApiConfig();
33 AbckitString *abcStr = conf->cIapi_->annotationInterfaceFieldGetName(GetView());
34 CheckError(conf);
35 std::string str = conf->cIapi_->abckitStringToString(abcStr);
36 CheckError(conf);
37 return str;
38 }
39
GetInterface()40 inline core::AnnotationInterface AnnotationInterfaceField::GetInterface() const
41 {
42 auto *ai = GetApiConfig()->cIapi_->annotationInterfaceFieldGetInterface(GetView());
43 CheckError(GetApiConfig());
44 return AnnotationInterface(ai, GetApiConfig(), GetResource());
45 }
46
GetType()47 inline Type AnnotationInterfaceField::GetType() const
48 {
49 auto t = GetApiConfig()->cIapi_->annotationInterfaceFieldGetType(GetView());
50 CheckError(GetApiConfig());
51 return Type(t, GetApiConfig(), GetResource());
52 }
53
GetDefaultValue()54 inline Value AnnotationInterfaceField::GetDefaultValue() const
55 {
56 auto dv = GetApiConfig()->cIapi_->annotationInterfaceFieldGetDefaultValue(GetView());
57 CheckError(GetApiConfig());
58 return Value(dv, GetApiConfig(), GetResource());
59 }
60
61 } // namespace abckit::core
62
63 #endif // CPP_ABCKIT_CORE_ANNOTATION_INTERFACE_FIELD_IMPL_H
64