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_EXPORT_DESCRIPTOR_IMPL_H 17 #define CPP_ABCKIT_CORE_EXPORT_DESCRIPTOR_IMPL_H 18 19 #include "./export_descriptor.h" 20 #include "module.h" 21 22 namespace abckit::core { 23 GetFile()24inline const File *ExportDescriptor::GetFile() const 25 { 26 return GetResource(); 27 } 28 GetName()29inline std::string ExportDescriptor::GetName() const 30 { 31 AbckitString *abcName = GetApiConfig()->cIapi_->exportDescriptorGetName(GetView()); 32 CheckError(GetApiConfig()); 33 std::string name = GetApiConfig()->cIapi_->abckitStringToString(abcName); 34 CheckError(GetApiConfig()); 35 return name; 36 } 37 GetExportingModule()38inline Module ExportDescriptor::GetExportingModule() const 39 { 40 AbckitCoreModule *mod = GetApiConfig()->cIapi_->exportDescriptorGetExportingModule(GetView()); 41 CheckError(GetApiConfig()); 42 return Module(mod, GetApiConfig(), GetResource()); 43 } 44 GetExportedModule()45inline Module ExportDescriptor::GetExportedModule() const 46 { 47 AbckitCoreModule *mod = GetApiConfig()->cIapi_->exportDescriptorGetExportedModule(GetView()); 48 CheckError(GetApiConfig()); 49 return Module(mod, GetApiConfig(), GetResource()); 50 } 51 GetAlias()52inline std::string ExportDescriptor::GetAlias() const 53 { 54 AbckitString *abcAlias = GetApiConfig()->cIapi_->exportDescriptorGetAlias(GetView()); 55 CheckError(GetApiConfig()); 56 std::string alias = GetApiConfig()->cIapi_->abckitStringToString(abcAlias); 57 CheckError(GetApiConfig()); 58 return alias; 59 } 60 61 } // namespace abckit::core 62 63 #endif // CPP_ABCKIT_CORE_EXPORT_DESCRIPTOR_IMPL_H 64