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_ELEMENT_IMPL_H 17 #define CPP_ABCKIT_CORE_ANNOTATION_ELEMENT_IMPL_H 18 19 #include "annotation_element.h" 20 #include "annotation.h" 21 22 namespace abckit::core { 23 GetFile()24inline const File *AnnotationElement::GetFile() const 25 { 26 return GetResource(); 27 } 28 GetName()29inline std::string AnnotationElement::GetName() const 30 { 31 const ApiConfig *conf = GetApiConfig(); 32 AbckitString *cString = conf->cIapi_->annotationElementGetName(GetView()); 33 CheckError(conf); 34 std::string str = conf->cIapi_->abckitStringToString(cString); 35 CheckError(conf); 36 return str; 37 } 38 GetValue()39inline abckit::Value AnnotationElement::GetValue() const 40 { 41 auto value = GetApiConfig()->cIapi_->annotationElementGetValue(GetView()); 42 CheckError(GetApiConfig()); 43 return Value(value, GetApiConfig(), GetResource()); 44 } 45 GetAnnotation()46inline Annotation AnnotationElement::GetAnnotation() const 47 { 48 auto anno = GetApiConfig()->cIapi_->annotationElementGetAnnotation(GetView()); 49 CheckError(GetApiConfig()); 50 return Annotation(anno, GetApiConfig(), GetResource()); 51 } 52 53 } // namespace abckit::core 54 55 #endif // CPP_ABCKIT_CORE_ANNOTATION_ELEMENT_IMPL_H 56