Molybden API
Loading...
Searching...
No Matches
js_accessible_detail.hpp
1// Copyright (c) 2000-2024 TeamDev. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_JS_ACCESSIBLE_DETAIL_HPP
6#define MOLYBDEN_JS_ACCESSIBLE_DETAIL_HPP
7
8namespace molybden {
9
10template <class C>
11JsReturnValue JsAccessible<C>::call(const std::string& method_name,
12 const std::vector<JsValue>& args) {
13 return callMethod(method_name, args);
14}
15
16template <class C>
17bool JsAccessible<C>::hasMethod(const std::string& method_name) {
18 return internal::MethodContainer::hasMethod(method_name);
19}
20
21template <class C>
22JsValue JsAccessible<C>::getProperty(const std::string& property_name) {
23 return getFieldValue(property_name);
24}
25
26template <class C>
27bool JsAccessible<C>::hasProperty(const std::string& property_name) {
28 return hasField(property_name);
29}
30
31template <class C>
32bool JsAccessible<C>::setProperty(const std::string& property_name,
33 const JsValue& value) {
34 return setFieldValue(property_name, value);
35}
36
37template <class C>
38std::string JsAccessible<C>::getType() {
39 return "JsAccessibleNativeObject";
40}
41
42template <class C>
43std::vector<std::string> JsAccessible<C>::enumerateMembers() {
44 std::vector<std::string> result;
45 auto properties = propertyNames();
46 result.insert(result.end(), properties.begin(), properties.end());
47 auto methods = methodNames();
48 result.insert(result.end(), methods.begin(), methods.end());
49 return result;
50}
51
52} // namespace molybden
53
54#endif // MOLYBDEN_JS_ACCESSIBLE_DETAIL_HPP