About my projects, examples and tutorials
NO_TITLE

NO_TITLE

Gnome::Glib::T-quark§

Class initialization§

new§

Initialization of a type class is simple and only needed when the standalone functions are used.

method new ( )
Code

Standalone Functions§

intern-static-string§

Returns a canonical representation for $string. Interned strings can be compared for equality by comparing the pointers, instead of using strcmp(). g_intern_static_string() does not copy the string, therefore $string must not be freed or modified.

This function must not be used before library constructors have finished running. In particular, this means it cannot be used to initialize global variables in C++.

method intern-static-string ( Str $string --> Str )
Code
  • $string; a static string.

Return value; a canonical representation for the string.

intern-string§

Returns a canonical representation for $string. Interned strings can be compared for equality by comparing the pointers, instead of using strcmp().

This function must not be used before library constructors have finished running. In particular, this means it cannot be used to initialize global variables in C++.

method intern-string ( Str $string --> Str )
Code
  • $string; a string.

Return value; a canonical representation for the string.

from-static-string§

Gets the Gnome::Glib::quark identifying the given (static) string. If the string does not currently have an associated Gnome::Glib::quark, a new Gnome::Glib::quark is created, linked to the given string.

Note that this function is identical to .from-string() except that if a new Gnome::Glib::quark is created the string itself is used rather than a copy. This saves memory, but can only be used if the string will continue to exist until the program terminates. It can be used with statically allocated strings in the main program, but not with statically allocated memory in dynamically loaded modules, if you expect to ever unload the module again (e.g. do not use this function in GTK theme engines).

This function must not be used before library constructors have finished running. In particular, this means it cannot be used to initialize global variables in C++.

method from-static-string ( Str $string --> UInt )
Code
  • $string; a string.

Return value; the Gnome::Glib::quark identifying the string, or 0 if $string is undefined.

from-string§

Gets the Gnome::Glib::quark identifying the given string. If the string does not currently have an associated Gnome::Glib::quark, a new Gnome::Glib::quark is created, using a copy of the string.

This function must not be used before library constructors have finished running. In particular, this means it cannot be used to initialize global variables in C++.

method from-string ( Str $string --> UInt )
Code
  • $string; a string.

Return value; the Gnome::Glib::quark identifying the string, or 0 if $string is undefined.

to-string§

Gets the string associated with the given Gnome::Glib::quark.

method to-string ( UInt $quark --> Str )
Code
  • $quark; a Gnome::Glib::quark..

Return value; the string associated with the Gnome::Glib::quark.

try-string§

Gets the Gnome::Glib::quark associated with the given string, or 0 if string is undefined or it has no associated Gnome::Glib::quark.

If you want the GQuark to be created if it doesn't already exist, use .from-string() or .from-static-string().

This function must not be used before library constructors have finished running.

method try-string ( Str $string --> UInt )
Code
  • $string; a string.

Return value; the Gnome::Glib::quark associated with the string, or 0 if $string is undefined or there is no Gnome::Glib::quark associated with it.