runtimepy.primitives.string
index
/home/vkottler/src/vkottler/workspace/runtimepy/runtimepy/primitives/string.py

A module implementing integer-prefixed string reading and writing.

 
Classes
       
builtins.object
StringPrimitive

 
class StringPrimitive(builtins.object)
    StringPrimitive(value: str = '', kind: type[runtimepy.primitives.base.Primitive[int]] = <class 'runtimepy.primitives.int.Uint16Primitive'>, byte_order: runtimepy.primitives.byte_order.ByteOrder = <ByteOrder.NETWORK: 4>) -> None
 
A class implementing a string-primitive interface.
 
  Methods defined here:
__eq__(self, other) -> bool
Determine if this instance is equivalent to another.
__hash__(self) -> int
Get a hash for this instance.
__init__(self, value: str = '', kind: type[runtimepy.primitives.base.Primitive[int]] = <class 'runtimepy.primitives.int.Uint16Primitive'>, byte_order: runtimepy.primitives.byte_order.ByteOrder = <ByteOrder.NETWORK: 4>) -> None
Initialize this string primitive.
__str__(self) -> str
Get this instance as a string.
read(self, stream: <class 'BinaryIO'>) -> str
Read a string from the stream.
set(self, value: str) -> None
Set a new value for the underlying string.
write(self, stream: <class 'BinaryIO'>) -> int
Write this string's size and value to the stream.

Static methods defined here:
from_stream(stream: <class 'BinaryIO'>, kind: type[runtimepy.primitives.base.Primitive[int]] = <class 'runtimepy.primitives.int.Uint16Primitive'>, byte_order: runtimepy.primitives.byte_order.ByteOrder = <ByteOrder.NETWORK: 4>) -> 'StringPrimitive'
Create a new string primitive from a stream.

Readonly properties defined here:
size
Get the overall size of this string primitive.
value
Get the value of this string.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object