Nyx Node
Loading...
Searching...
No Matches
nyx.json.json_dict.NyxDict Class Reference

JSON dict object. More...

Inheritance diagram for nyx.json.json_dict.NyxDict:
Collaboration diagram for nyx.json.json_dict.NyxDict:

Public Member Functions

 __init__ (self, int|None ptr=None)
 Allocates a new JSON dict object or wraps one.
None clear (self)
 Clears the content of this JSON dict object.
None __delitem__ (self, str key)
 Deletes the entry of the provided key.
obj.NyxObject __getitem__ (self, str key)
 Gets the JSON object of the provided key.
bool __setitem__ (self, str key, obj.NyxObject value)
 Sets a JSON object in this JSON dict object.
int __len__ (self)
 Gets the number of items in this JSON dict object.
typing.Iterator[str] keys (self)
 Iterates over the keys of this JSON dict object.
typing.Iterator[obj.NyxObjectvalues (self)
 Iterates over the values of this JSON dict object.
typing.Iterator[typing.Tuple[str, obj.NyxObject]] items (self)
 Iterates over the key/value pairs of this JSON dict object.
Public Member Functions inherited from nyx.obj.NyxObject
 __init__ (self, int ptr)
 Wraps a C JSON object pointer.
typing.Callable on (self, typing.Callable callback)
 Registers a callback triggered when clients modify this object.
bool notify (self)
 Notifies this Nyx / INDI object to the clients.
str to_string (self, bool json_string=True)
 Returns a string representing this JSON object.
NyxXMLDoc to_xmldoc (self)
 Converts this JSON Nyx / INDI command to the XML one.

Additional Inherited Members

Static Public Member Functions inherited from nyx.obj.NyxObject
NyxObject from_string (str string)
 Parses a JSON object from a string.

Detailed Description

JSON dict object.

Definition at line 22 of file json_dict.py.

Constructor & Destructor Documentation

◆ __init__()

nyx.json.json_dict.NyxDict.__init__ ( self,
int | None ptr = None )

Allocates a new JSON dict object or wraps one.

Parameters
ptrOptional JSON dict object pointer.

Definition at line 29 of file json_dict.py.

Member Function Documentation

◆ clear()

None nyx.json.json_dict.NyxDict.clear ( self)

Clears the content of this JSON dict object.

Returns
None

Definition at line 48 of file json_dict.py.

◆ __delitem__()

None nyx.json.json_dict.NyxDict.__delitem__ ( self,
str key )

Deletes the entry of the provided key.

Parameters
keyKey.
Returns
None

Definition at line 58 of file json_dict.py.

◆ __getitem__()

obj.NyxObject nyx.json.json_dict.NyxDict.__getitem__ ( self,
str key )

Gets the JSON object of the provided key.

Parameters
keyKey.
Returns
The JSON object.

Definition at line 70 of file json_dict.py.

◆ __setitem__()

bool nyx.json.json_dict.NyxDict.__setitem__ ( self,
str key,
obj.NyxObject value )

Sets a JSON object in this JSON dict object.

Parameters
keyKey.
valueJSON object to be added.
Returns
True if the value was modified, False otherwise.

Definition at line 92 of file json_dict.py.

◆ __len__()

int nyx.json.json_dict.NyxDict.__len__ ( self)

Gets the number of items in this JSON dict object.

Returns
The number of items.

Definition at line 109 of file json_dict.py.

◆ keys()

typing.Iterator[str] nyx.json.json_dict.NyxDict.keys ( self)

Iterates over the keys of this JSON dict object.

Returns
An iterator over the keys.

Definition at line 162 of file json_dict.py.

◆ values()

typing.Iterator[obj.NyxObject] nyx.json.json_dict.NyxDict.values ( self)

Iterates over the values of this JSON dict object.

Returns
An iterator over the values.

Definition at line 175 of file json_dict.py.

◆ items()

typing.Iterator[typing.Tuple[str, obj.NyxObject]] nyx.json.json_dict.NyxDict.items ( self)

Iterates over the key/value pairs of this JSON dict object.

Returns
An iterator over the key/value pairs.

Definition at line 188 of file json_dict.py.


The documentation for this class was generated from the following file: