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 FOUNDATION_ACE_NAPI_NATIVE_ENGINE_IMPL_ARK_ARK_NATIVE_OPTIONS_H
17 #define FOUNDATION_ACE_NAPI_NATIVE_ENGINE_IMPL_ARK_ARK_NATIVE_OPTIONS_H
18 
19 namespace NapiProperties {
20 enum NapiProperties : uint32_t {
21     DEFAULT = -1,  // default value 000'0000'0000'0000'0000'0000 -> 0x0
22 };
23 } // namespace NapiProperties
24 
25 class NapiOptions {
26 public:
SetProperties(int properties)27     void SetProperties(int properties)
28     {
29         uint32_t prop = static_cast<uint32_t>(properties);
30         if (prop != NapiProperties::DEFAULT) {
31             napiProperties_ = prop;
32         }
33         ParseProperties();
34         return;
35     }
36 
37 private:
38     // do not remove, extern switch would be added
ParseProperties()39     void ParseProperties()
40     {
41         return;
42     }
43 
GetDefaultProperties()44     uint32_t GetDefaultProperties() const
45     {
46         return 0;
47     }
48 
GetProperties()49     inline int GetProperties() const
50     {
51         return napiProperties_;
52     }
53 
54     uint32_t napiProperties_ = GetDefaultProperties();
55 };
56 
57 #endif /* FOUNDATION_ACE_NAPI_NATIVE_ENGINE_IMPL_ARK_ARK_NATIVE_OPTIONS_H */
58