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_EXTENDS = "ets.extends"; 29 inline constexpr std::string_view ATTR_IMPLEMENTS = "ets.implements"; 30 31 inline constexpr std::string_view ATTR_ABSTRACT = "ets.abstract"; 32 inline constexpr std::string_view ATTR_NOIMPL = "noimpl"; 33 inline constexpr std::string_view ATTR_EXTERNAL = "external"; 34 inline constexpr std::string_view ATTR_FINAL = "final"; 35 inline constexpr std::string_view ATTR_STATIC = "static"; 36 inline constexpr std::string_view ATTR_CTOR = "ctor"; 37 inline constexpr std::string_view ATTR_CCTOR = "cctor"; 38 39 inline constexpr std::array<std::string_view, 2> ATTR_INTERFACE = {"ets.interface", ATTR_ABSTRACT}; 40 41 inline constexpr std::array<std::string_view, 2> ATTR_ABSTRACT_METHOD = {ATTR_ABSTRACT, ATTR_NOIMPL}; 42 43 inline constexpr std::string_view TYPE_OBJECT = "std.core.Object"; 44 inline constexpr std::string_view TYPE_BOXED_PREFIX = "std.core."; 45 46 inline constexpr std::string_view FUNCTION_GET_OBJECTS_FOR_CCTOR = "std.core.TypeCreatorCtx.getObjectsArrayForCCtor"; 47 inline constexpr std::string_view TYPE_TYPE_CREATOR_CTX = 48 FUNCTION_GET_OBJECTS_FOR_CCTOR.substr(0, FUNCTION_GET_OBJECTS_FOR_CCTOR.rfind('.')); 49 static_assert(TYPE_TYPE_CREATOR_CTX.back() != '.'); 50 51 inline constexpr std::string_view CREATOR_CTX_DATA_PREFIX = "TypeAPI$CtxData$"; 52 } // namespace ark::ets::typeapi_create_consts 53 54 #endif // PANDA_PLUGINS_ETS_TYPEAPI_CREATE_PANDA_CONSTANTS_H 55