Nyx Node
Loading...
Searching...
No Matches
nyx.json.json_string.NyxString Class Reference

JSON string object. More...

Inheritance diagram for nyx.json.json_string.NyxString:
Collaboration diagram for nyx.json.json_string.NyxString:

Public Member Functions

 __init__ (self, str|bytes|None value=None, int|None ptr=None)
 Allocates a new JSON string object or wraps one.
str value (self)
 Gets the text value of this JSON string object.
bytes buff (self)
 Gets the content of this JSON string object as a byte buffer.
bool value (self, str value)
 Sets the text value of this JSON string object.
bool buff (self, bytes value)
 Sets the content of this JSON string object as a byte buffer.
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 string object.

Definition at line 17 of file json_string.py.

Constructor & Destructor Documentation

◆ __init__()

nyx.json.json_string.NyxString.__init__ ( self,
str | bytes | None value = None,
int | None ptr = None )

Allocates a new JSON string object or wraps one.

Parameters
valueOptional default value.
ptrOptional JSON string object pointer.

Definition at line 24 of file json_string.py.

Member Function Documentation

◆ value() [1/2]

str nyx.json.json_string.NyxString.value ( self)

Gets the text value of this JSON string object.

Returns
The current text value.
Note
The returned text value remains valid until the object is modified or released.

Definition at line 74 of file json_string.py.

◆ buff() [1/2]

bytes nyx.json.json_string.NyxString.buff ( self)

Gets the content of this JSON string object as a byte buffer.

Returns
The current content bytes.
Note
The returned buffer remains valid until the object is modified or released.

Definition at line 88 of file json_string.py.

◆ value() [2/2]

bool nyx.json.json_string.NyxString.value ( self,
str value )

Sets the text value of this JSON string object.

Returns
True if the value was modified, False otherwise.

Definition at line 102 of file json_string.py.

◆ buff() [2/2]

bool nyx.json.json_string.NyxString.buff ( self,
bytes value )

Sets the content of this JSON string object as a byte buffer.

Returns
True if the value was modified, False otherwise.

Definition at line 126 of file json_string.py.


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