PythonMonkey   v0.8.2 (dev)
Loading...
Searching...
No Matches
JSObjectProxy.hh File Reference

JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would. More...

#include <jsapi.h>
#include <Python.h>
#include <unordered_map>
Include dependency graph for JSObjectProxy.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  JSObjectProxy
 The typedef for the backing store that will be used by JSObjectProxy objects. All it contains is a pointer to the JSObject. More...
 
struct  JSObjectProxyMethodDefinitions
 This struct is a bundle of methods used by the JSObjectProxy type. More...
 

Functions

 PyDoc_STRVAR (getitem__doc__, "__getitem__($self, key, /)\n--\n\nReturn self[key].")
 
 PyDoc_STRVAR (dict_get__doc__, "get($self, key, default=None, /)\n" "--\n" "\n" "Return the value for key if key is in the dictionary, else default.")
 
 PyDoc_STRVAR (dict_setdefault__doc__, "setdefault($self, key, default=None, /)\n" "--\n" "\n" "Insert key with a value of default if key is not in the dictionary.\n" "\n" "Return the value for key if key is in the dictionary, else default.")
 
 PyDoc_STRVAR (dict_pop__doc__, "pop($self, key, default=<unrepresentable>, /)\n" "--\n" "\n" "D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n" "\n" "If the key is not found, return the default if given; otherwise,\n" "raise a KeyError.")
 
 PyDoc_STRVAR (clear__doc__, "D.clear() -> None. Remove all items from D.")
 
 PyDoc_STRVAR (copy__doc__, "D.copy() -> a shallow copy of D")
 
 PyDoc_STRVAR (keys__doc__, "D.keys() -> a set-like object providing a view on D's keys")
 
 PyDoc_STRVAR (items__doc__, "D.items() -> a set-like object providing a view on D's items")
 
 PyDoc_STRVAR (values__doc__, "D.values() -> an object providing a view on D's values")
 
 PyDoc_STRVAR (update__doc__, "D.update([E, ]**F) -> None. Update D from dict/iterable E and F.\n\ If E is present and has a .keys() method, then does: for k in E: D[k] = E[k]\n\ If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v\n\ In either case, this is followed by: for k in F: D[k] = F[k]")
 
 PyDoc_STRVAR (dict_keys__doc__, "D.keys() -> a set-like object providing a view on D's keys")
 
 PyDoc_STRVAR (dict_items__doc__, "D.items() -> a set-like object providing a view on D's items")
 
 PyDoc_STRVAR (dict_values__doc__, "D.values() -> an object providing a view on D's values")
 

Variables

PyTypeObject JSObjectProxyType
 Struct for the JSObjectProxyType, used by all JSObjectProxy objects.
 

Detailed Description

JSObjectProxy is a custom C-implemented python type that derives from dict. It acts as a proxy for JSObjects from Spidermonkey, and behaves like a dict would.

Author
Caleb Aikens (caleb.nosp@m.@dis.nosp@m.tribu.nosp@m.tive.nosp@m..netw.nosp@m.ork), Tom Tang (xmade.nosp@m.r@di.nosp@m.strib.nosp@m.utiv.nosp@m.e.net.nosp@m.work) and Philippe Laporte (phili.nosp@m.ppe@.nosp@m.distr.nosp@m.ibut.nosp@m.ive.n.nosp@m.etwo.nosp@m.rk)
Date
2023-06-26

Function Documentation

◆ PyDoc_STRVAR() [1/13]

PyDoc_STRVAR ( clear__doc__  ,
"D.clear() -> None. Remove all items from D."   
)

◆ PyDoc_STRVAR() [2/13]

PyDoc_STRVAR ( copy__doc__  ,
"D.copy() -> a shallow copy of D"   
)

◆ PyDoc_STRVAR() [3/13]

PyDoc_STRVAR ( dict_get__doc__  ,
"get($self, key, default=None, /)\n" "--\n" "\n" "Return the value for key if key is in the  dictionary,
else default."   
)

◆ PyDoc_STRVAR() [4/13]

PyDoc_STRVAR ( dict_items__doc__  ,
"D.items() -> a set-like object providing a view on D's items"   
)

◆ PyDoc_STRVAR() [5/13]

PyDoc_STRVAR ( dict_keys__doc__  ,
"D.keys() -> a set-like object providing a view on D's keys"   
)

◆ PyDoc_STRVAR() [6/13]

PyDoc_STRVAR ( dict_pop__doc__  ,
"pop($self, key, default=<unrepresentable>, /)\n" "--\n" "\n" "D.pop(k[,d]) ->  v,
remove specified key and return the corresponding value.\n" "\n" "If the key is not  found,
return the default if given;  otherwise,
\n" "raise a KeyError."   
)

◆ PyDoc_STRVAR() [7/13]

PyDoc_STRVAR ( dict_setdefault__doc__  ,
"setdefault($self, key, default=None, /)\n" "--\n" "\n" "Insert key with a value of default if key is not in the dictionary.\n" "\n" "Return the value for key if key is in the  dictionary,
else default."   
)

◆ PyDoc_STRVAR() [8/13]

PyDoc_STRVAR ( dict_values__doc__  ,
"D.values() -> an object providing a view on D's values"   
)

◆ PyDoc_STRVAR() [9/13]

PyDoc_STRVAR ( getitem__doc__  ,
"__getitem__($self, key, /)\n--\n\nReturn self."  [key] 
)

◆ PyDoc_STRVAR() [10/13]

PyDoc_STRVAR ( items__doc__  ,
"D.items() -> a set-like object providing a view on D's items"   
)

◆ PyDoc_STRVAR() [11/13]

PyDoc_STRVAR ( keys__doc__  ,
"D.keys() -> a set-like object providing a view on D's keys"   
)

◆ PyDoc_STRVAR() [12/13]

PyDoc_STRVAR ( update__doc__  ,
"D.update([E, ]**F) -> None. Update D from dict/iterable E and F.\n\If E is present and has a .keys()  method,
then does:for k in E:D  [k] = E[k]\n\If E is present and lacks a .keys() method,
then does:for  k,
v in E:D  [k] = v\n\In either case 
)

◆ PyDoc_STRVAR() [13/13]

PyDoc_STRVAR ( values__doc__  ,
"D.values() -> an object providing a view on D's values"   
)

Variable Documentation

◆ JSObjectProxyType

PyTypeObject JSObjectProxyType
extern

Struct for the JSObjectProxyType, used by all JSObjectProxy objects.