T-quark

Gnome::Glib::T-quark

#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------

Class initialization

new

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

method new ( )

#------------------------------------------------------------------------------- #--[Standalone Functions]------------------------------------------------------- #-------------------------------------------------------------------------------

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 )
  • $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 )
  • $string; a string.

Return value; a canonical representation for the string.

#-------------------------------------------------------------------------------

quark-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 quark-from-static-string ( Str $string --> UInt )
  • $string; a string.

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

#-------------------------------------------------------------------------------

quark-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 quark-from-string ( Str $string --> UInt )
  • $string; a string.

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

#-------------------------------------------------------------------------------

quark-to-string

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

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

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

#-------------------------------------------------------------------------------

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 quark-try-string ( Str $string --> UInt )
  • $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.

Gnome::Glib v0.1.12

Modules for package Gnome::Glib:api<2>. The language binding to GNOME's lowest level library

Authors

    License

    Artistic-2.0

    Dependencies

    Gnome::N:api<2>

    Test Dependencies

    Provides

    • Gnome::Glib::N-Array
    • Gnome::Glib::N-ByteArray
    • Gnome::Glib::N-Bytes
    • Gnome::Glib::N-Error
    • Gnome::Glib::N-List
    • Gnome::Glib::N-MainContext
    • Gnome::Glib::N-MainLoop
    • Gnome::Glib::N-PtrArray
    • Gnome::Glib::N-SList
    • Gnome::Glib::N-Variant
    • Gnome::Glib::N-VariantBuilder
    • Gnome::Glib::N-VariantDict
    • Gnome::Glib::N-VariantIter
    • Gnome::Glib::N-VariantType
    • Gnome::Glib::T-array
    • Gnome::Glib::T-error
    • Gnome::Glib::T-list
    • Gnome::Glib::T-main
    • Gnome::Glib::T-quark
    • Gnome::Glib::T-slist
    • Gnome::Glib::T-variant
    • Gnome::Glib::T-varianttype

    The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.