Nyx Node
Loading...
Searching...
No Matches
nyx.json.json_list.NyxList Class Reference

JSON list object. More...

Inheritance diagram for nyx.json.json_list.NyxList:
Collaboration diagram for nyx.json.json_list.NyxList:

Public Member Functions

 __init__ (self, int|None ptr=None)
 Allocates a new JSON list object or wraps one.
None clear (self)
 Clears the content of this JSON list object.
None __delitem__ (self, int idx)
 Deletes the entry at the provided index.
obj.NyxObject __getitem__ (self, int idx)
 Gets the JSON object at the provided index.
bool __setitem__ (self, int idx, obj.NyxObject value)
 Sets a JSON object at the provided index.
bool append (self, obj.NyxObject value)
 Appends a JSON object in this JSON list object.
int __len__ (self)
 Gets the number of items in this JSON list object.
typing.Iterator[obj.NyxObject__iter__ (self)
 Iterates over the values of this JSON list object.
typing.Iterator[int] indices (self)
 Iterates over the indices of this JSON list object.
typing.Iterator[obj.NyxObjectvalues (self)
 Iterates over the values of this JSON list object.
typing.Iterator[typing.Tuple[int, obj.NyxObject]] items (self)
 Iterates over the index/value pairs of this JSON list 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 list object.

Definition at line 22 of file json_list.py.

Constructor & Destructor Documentation

◆ __init__()

nyx.json.json_list.NyxList.__init__ ( self,
int | None ptr = None )

Allocates a new JSON list object or wraps one.

Parameters
ptrOptional JSON list object pointer.

Definition at line 29 of file json_list.py.

Member Function Documentation

◆ clear()

None nyx.json.json_list.NyxList.clear ( self)

Clears the content of this JSON list object.

Returns
None

Definition at line 48 of file json_list.py.

◆ __delitem__()

None nyx.json.json_list.NyxList.__delitem__ ( self,
int idx )

Deletes the entry at the provided index.

Parameters
idxIndex.
Returns
None

Definition at line 59 of file json_list.py.

◆ __getitem__()

obj.NyxObject nyx.json.json_list.NyxList.__getitem__ ( self,
int idx )

Gets the JSON object at the provided index.

Parameters
idxIndex.
Returns
The JSON object at the provided index.

Definition at line 71 of file json_list.py.

◆ __setitem__()

bool nyx.json.json_list.NyxList.__setitem__ ( self,
int idx,
obj.NyxObject value )

Sets a JSON object at the provided index.

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

Definition at line 93 of file json_list.py.

◆ append()

bool nyx.json.json_list.NyxList.append ( self,
obj.NyxObject value )

Appends a JSON object in this JSON list object.

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

Definition at line 110 of file json_list.py.

◆ __len__()

int nyx.json.json_list.NyxList.__len__ ( self)

Gets the number of items in this JSON list object.

Returns
The number of items.

Definition at line 122 of file json_list.py.

◆ __iter__()

typing.Iterator[obj.NyxObject] nyx.json.json_list.NyxList.__iter__ ( self)

Iterates over the values of this JSON list object.

Returns
An iterator over the values.

Definition at line 167 of file json_list.py.

◆ indices()

typing.Iterator[int] nyx.json.json_list.NyxList.indices ( self)

Iterates over the indices of this JSON list object.

Returns
An iterator over the indices.

Definition at line 180 of file json_list.py.

◆ values()

typing.Iterator[obj.NyxObject] nyx.json.json_list.NyxList.values ( self)

Iterates over the values of this JSON list object.

Returns
An iterator over the values.

Definition at line 193 of file json_list.py.

◆ items()

typing.Iterator[typing.Tuple[int, obj.NyxObject]] nyx.json.json_list.NyxList.items ( self)

Iterates over the index/value pairs of this JSON list object.

Returns
An iterator over the index/value pairs.

Definition at line 206 of file json_list.py.


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