RB.RefString¶
Fields¶
None
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
Details¶
- class RB.RefString¶
- classmethod equal(ap, bp)¶
- Parameters:
ap (
object
orNone
) – anRB.RefString
- Returns:
True
if the strings are the same- Return type:
Key equality function suitable for use with
GLib.HashTable
. Equality checks forRB.RefString
are just pointer comparisons, since there can only be one refstring for a given string.
- classmethod find(init)¶
- Parameters:
init (
str
) – string to find- Returns:
existing
RB.RefString
, orNone
- Return type:
Returns an existing
RB.RefString
for init if one exists, otherwise returnsNone
. If an existing refstring is found, its reference count is increased.
- classmethod hash(p)¶
- Parameters:
p (
object
orNone
) – anRB.RefString
- Returns:
hash value for the string underlying p
- Return type:
Hash function suitable for use with GHashTable.
- classmethod new(init)¶
- Parameters:
init (
str
) – string to intern- Returns:
RB.RefString
for init- Return type:
Returns an
RB.RefString
for the specified string. If one already exists, its reference count is incremented and it is returned. Otherwise, a newRB.RefString
is created and returned.
- classmethod system_init()¶
Sets up the refstring system. Called on startup.
- classmethod system_shutdown()¶
Frees all data associated with the refstring system. Only called on shutdown.
- get()¶
- Returns:
underlying string, must not be freed
- Return type:
Returns the actual string for a
RB.RefString
.
- get_folded()¶
- Returns:
case-folded string, must not be freed
- Return type:
Returns the case-folded version of the string underlying self. The case-folded string is cached inside the
RB.RefString
for speed. See rb_search_fold for information on case-folding strings.
- get_sort_key()¶
- Returns:
sort key string, must not be freed.
- Return type:
Returns the sort key version of the string underlying self. The sort key string is cached inside the
RB.RefString
for speed. Sort key strings are not generally human readable, so don’t display them anywhere. See g_utf8_collate_key_for_filename for information on sort keys.
- ref()¶
- Returns:
the same refstring
- Return type:
Increases the reference count for an existing
RB.RefString
. The refstring is returned for convenience.
- unref()¶
Drops a reference to an
RB.RefString
. If this is the last reference, the string will be freed.