MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / ObjectReference

Class ObjectReference

napi.h:1807–1843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1805};
1806
1807class ObjectReference : public Reference<Object> {
1808 public:
1809 ObjectReference();
1810 ObjectReference(napi_env env, napi_ref ref);
1811
1812 // A reference can be moved but cannot be copied.
1813 ObjectReference(Reference<Object>&& other);
1814 ObjectReference& operator=(Reference<Object>&& other);
1815 ObjectReference(ObjectReference&& other);
1816 ObjectReference& operator=(ObjectReference&& other);
1817 NAPI_DISALLOW_ASSIGN(ObjectReference)
1818
1819 MaybeOrValue<Napi::Value> Get(const char* utf8name) const;
1820 MaybeOrValue<Napi::Value> Get(const std::string& utf8name) const;
1821 MaybeOrValue<bool> Set(const char* utf8name, napi_value value) const;
1822 MaybeOrValue<bool> Set(const char* utf8name, Napi::Value value) const;
1823 MaybeOrValue<bool> Set(const char* utf8name, const char* utf8value) const;
1824 MaybeOrValue<bool> Set(const char* utf8name, bool boolValue) const;
1825 MaybeOrValue<bool> Set(const char* utf8name, double numberValue) const;
1826 MaybeOrValue<bool> Set(const std::string& utf8name, napi_value value) const;
1827 MaybeOrValue<bool> Set(const std::string& utf8name, Napi::Value value) const;
1828 MaybeOrValue<bool> Set(const std::string& utf8name,
1829 const std::string& utf8value) const;
1830 MaybeOrValue<bool> Set(const std::string& utf8name, bool boolValue) const;
1831 MaybeOrValue<bool> Set(const std::string& utf8name, double numberValue) const;
1832
1833 MaybeOrValue<Napi::Value> Get(uint32_t index) const;
1834 MaybeOrValue<bool> Set(uint32_t index, const napi_value value) const;
1835 MaybeOrValue<bool> Set(uint32_t index, const Napi::Value value) const;
1836 MaybeOrValue<bool> Set(uint32_t index, const char* utf8value) const;
1837 MaybeOrValue<bool> Set(uint32_t index, const std::string& utf8value) const;
1838 MaybeOrValue<bool> Set(uint32_t index, bool boolValue) const;
1839 MaybeOrValue<bool> Set(uint32_t index, double numberValue) const;
1840
1841 protected:
1842 ObjectReference(const ObjectReference&);
1843};
1844
1845class FunctionReference : public Reference<Function> {
1846 public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected