RB.ExtDBKey

Fields

None

Methods

class

create_lookup (field, value)

class

create_storage (field, value)

add_field (field, value)

add_info (name, value)

copy ()

field_matches (field, value)

free ()

get_field (field)

get_field_names ()

get_field_values (field)

get_info (name)

get_info_names ()

is_lookup ()

matches (b)

to_string ()

Details

class RB.ExtDBKey
classmethod create_lookup(field, value)
Parameters:
  • field (str) – required field name

  • value (str) – value for field

Returns:

the new key

Return type:

RB.ExtDBKey

Creates a new metadata lookup key with a single field. Use rb_ext_db_key_add_field to add more.

classmethod create_storage(field, value)
Parameters:
  • field (str) – required field name

  • value (str) – value for field

Returns:

the new key

Return type:

RB.ExtDBKey

Creates a new metadata storage key with a single field. Use rb_ext_db_key_add_field to add more.

add_field(field, value)
Parameters:
  • field (str) – name of the field to add

  • value (str) – field value

Adds a field to the key, or an additional value to an existing field.

add_info(name, value)
Parameters:
  • name (str) – name of the field to add

  • value (str) – field value

Adds an information field to the key.

copy()
Returns:

copied key

Return type:

RB.ExtDBKey

Copies a key.

field_matches(field, value)
Parameters:
  • field (str) – a field to check

  • value (str) – a value to match against

Returns:

True if the field matches the value

Return type:

bool

Checks whether a specified field in self matches a value. This can be used to match keys against other types of data. To match keys against each other, use rb_ext_db_key_matches.

free()

Frees a key

get_field(field)
Parameters:

field (str) – field to retrieve

Returns:

field value, or None

Return type:

str

Extracts the value for a single-valued field.

get_field_names()
Returns:

array of field names

Return type:

[str]

Returns a None-terminated array containing the names of the fields present in the key.

get_field_values(field)
Parameters:

field (str) – field to retrieve

Returns:

field values, or None

Return type:

[str]

Extracts the values for the specified field.

get_info(name)
Parameters:

name (str) – info field to retrieve

Returns:

field value, or None

Return type:

str

Extracts the value for the specified info field.

get_info_names()
Returns:

array of info field names

Return type:

[str]

Returns a None-terminated array containing the names of the info fields * present in the key.

is_lookup()
Returns:

whether the key is a lookup key

Return type:

bool

Returns True if the key is a lookup key

matches(b)
Parameters:

b (RB.ExtDBKey) – second RB.ExtDBKey

Returns:

True if the keys match

Return type:

bool

Checks whether the fields specified in self match b. For keys to match, they must have the same set of required fields, and the values for all must match. Optional fields must have the same values if present in both. Informational fields are ignored.

to_string()
Returns:

string form of the key

Return type:

str

Generates a readable string format from the key.