1 /* 2 * Copyright (c) 2021-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 PANDA_PLUGINS_ETS_TYPEAPI_CREATE_PANDA_CONSTANTS_H 17 #define PANDA_PLUGINS_ETS_TYPEAPI_CREATE_PANDA_CONSTANTS_H 18 19 #include <array> 20 #include <string_view> 21 22 namespace ark::ets::typeapi_create_consts { 23 inline constexpr std::string_view ATTR_ACCESS = "ets.access"; 24 inline constexpr std::string_view ATTR_ACCESS_VAL_PUBLIC = "public"; 25 inline constexpr std::string_view ATTR_ACCESS_VAL_PROTECTED = "protected"; 26 inline constexpr std::string_view ATTR_ACCESS_VAL_PRIVATE = "private"; 27 28 inline constexpr std::string_view ATTR_ACCESS_FUNCTION = "access.function"; 29 inline constexpr std::string_view ATTR_ACCESS_FIELD = "access.field"; 30 31 inline constexpr std::string_view ATTR_EXTENDS = "ets.extends"; 32 inline constexpr std::string_view ATTR_IMPLEMENTS = "ets.implements"; 33 34 inline constexpr std::string_view ATTR_ABSTRACT = "ets.abstract"; 35 inline constexpr std::string_view ATTR_NOIMPL = "noimpl"; 36 inline constexpr std::string_view ATTR_EXTERNAL = "external"; 37 inline constexpr std::string_view ATTR_FINAL = "final"; 38 inline constexpr std::string_view ATTR_STATIC = "static"; 39 inline constexpr std::string_view ATTR_CTOR = "ctor"; 40 inline constexpr std::string_view ATTR_CCTOR = "cctor"; 41 42 inline constexpr std::array<std::string_view, 2> ATTR_INTERFACE = {"ets.interface", ATTR_ABSTRACT}; 43 44 inline constexpr std::array<std::string_view, 2> ATTR_ABSTRACT_METHOD = {ATTR_ABSTRACT, ATTR_NOIMPL}; 45 46 inline constexpr std::string_view TYPE_OBJECT = "std.core.Object"; 47 inline constexpr std::string_view TYPE_BOXED_PREFIX = "std.core."; 48 49 inline constexpr std::string_view FUNCTION_GET_OBJECTS_FOR_CCTOR = "std.core.TypeCreatorCtx.getObjectsArrayForCCtor"; 50 inline constexpr std::string_view TYPE_TYPE_CREATOR_CTX = 51 FUNCTION_GET_OBJECTS_FOR_CCTOR.substr(0, FUNCTION_GET_OBJECTS_FOR_CCTOR.rfind('.')); 52 static_assert(TYPE_TYPE_CREATOR_CTX.back() != '.'); 53 54 inline constexpr std::string_view CREATOR_CTX_DATA_PREFIX = "TypeAPI$CtxData$"; 55 } // namespace ark::ets::typeapi_create_consts 56 57 #endif // PANDA_PLUGINS_ETS_TYPEAPI_CREATE_PANDA_CONSTANTS_H 58