Wp.SpaPodParser

Fields

None

Methods

class

new_object (pod, id_name)

class

new_struct (pod)

end ()

get_boolean ()

get_bytes ()

get_double ()

get_fd ()

get_float ()

get_fraction ()

get_id ()

get_int ()

get_long ()

get_pod ()

get_pointer ()

get_rectangle ()

get_string ()

ref ()

unref ()

Details

class Wp.SpaPodParser
classmethod new_object(pod, id_name)
Parameters:
  • pod (Wp.SpaPod) – the object spa pod to parse

  • id_name (str) – the Id name of the object

Returns:

The new spa pod parser

Return type:

Wp.SpaPodParser

Creates an object spa pod parser. The pod object must be valid for the entire life-cycle of the returned parser.

classmethod new_struct(pod)
Parameters:

pod (Wp.SpaPod) – the struct spa pod to parse

Returns:

The new spa pod parser

Return type:

Wp.SpaPodParser

Creates an struct spa pod parser. The pod object must be valid for the entire life-cycle of the returned parser.

end()

Ends the parser process.

get_boolean()
Returns:

True if the value was obtained, False otherwise

value:

the boolean value

Return type:

(bool, value: bool)

Gets the boolean value from a spa pod parser.

get_bytes()
Returns:

True if the value was obtained, False otherwise

value:

the bytes value

len:

the length of the bytes value

Return type:

(bool, value: object, len: int)

Gets the bytes value and its length from a spa pod parser object.

get_double()
Returns:

True if the value was obtained, False otherwise

value:

the double value

Return type:

(bool, value: float)

Gets the double value from a spa pod parser object.

get_fd()
Returns:

True if the value was obtained, False otherwise

value:

the Fd value

Return type:

(bool, value: int)

Gets the Fd value from a spa pod parser object.

get_float()
Returns:

True if the value was obtained, False otherwise

value:

the float value

Return type:

(bool, value: float)

Gets the float value from a spa pod parser object.

get_fraction()
Returns:

True if the value was obtained, False otherwise

num:

the fractions’s numerator value

denom:

the fractions’s denominator value

Return type:

(bool, num: int, denom: int)

Gets the fractions’s numerator and denominator value from a spa pod parser object.

get_id()
Returns:

True if the value was obtained, False otherwise

value:

the Id value

Return type:

(bool, value: int)

Gets the Id value from a spa pod parser object.

get_int()
Returns:

True if the value was obtained, False otherwise

value:

the int value

Return type:

(bool, value: int)

Gets the int value from a spa pod parser object.

get_long()
Returns:

True if the value was obtained, False otherwise

value:

the long value

Return type:

(bool, value: int)

Gets the long value from a spa pod parser object.

get_pod()
Returns:

The spa pod value or None if it could not be obtained

Return type:

Wp.SpaPod

Gets the spa pod value from a spa pod parser object.

get_pointer()
Returns:

True if the value was obtained, False otherwise

value:

the pointer value

Return type:

(bool, value: object)

Gets the pointer value and its type name from a spa pod parser object.

get_rectangle()
Returns:

True if the value was obtained, False otherwise

width:

the rectangle’s width value

height:

the rectangle’s height value

Return type:

(bool, width: int, height: int)

Gets the rectangle’s width and height value from a spa pod parser object.

get_string()
Returns:

True if the value was obtained, False otherwise

value:

the string value

Return type:

(bool, value: str)

Gets the string value from a spa pod parser object.

ref()
Returns:

self with an additional reference count on it

Return type:

Wp.SpaPodParser

Increases the reference count of a spa pod parser.

unref()

Decreases the reference count on self and frees it when the ref count reaches zero.