Bonobo API Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# BonoboMoniker

## Name

BonoboMoniker -- The base implementation of our abstract object naming space

## Synopsis

    typedef     BonoboMoniker;
    typedef     BonoboMonikerClass;
    BonoboMoniker* bonobo_moniker_construct     (BonoboMoniker *moniker,
                                                 const char *prefix);
    Bonobo_Moniker bonobo_moniker_get_parent    (BonoboMoniker *moniker,
                                                 CORBA_Environment *ev);
    void        bonobo_moniker_set_parent       (BonoboMoniker *moniker,
                                                 Bonobo_Moniker parent,
                                                 CORBA_Environment *ev);
    const char* bonobo_moniker_get_name         (BonoboMoniker *moniker);
    void        bonobo_moniker_set_name         (BonoboMoniker *moniker,
                                                 const char *unescaped_name,
                                                 int num_chars);
    char*       bonobo_moniker_get_name_escaped (BonoboMoniker *moniker);
    const char* bonobo_moniker_get_name_full    (BonoboMoniker *moniker);
    gboolean    bonobo_moniker_get_case_sensitive
                                                (BonoboMoniker *moniker);
    void        bonobo_moniker_set_case_sensitive
                                                (BonoboMoniker *moniker,
                                                 gboolean sensitive);
    const char* bonobo_moniker_get_prefix       (BonoboMoniker *moniker);

## Description

Monikers are used to name objects, they effectively implement an object naming space. You can obtain monikers either because you created the moniker manually, or from a stringified representation of a moniker.

For more information see bonobo/doc/Monikers, relatively few people want to implement monikers, mostly they just want to use them. To do this you need the bonobo-moniker-util API.

To implement your own moniker, it is most likely that you want to use BonoboMonikerSimple, BonoboMoniker is a mostly abstract base class that in some obscure cases might provide a more powerful feature set. Most people use BonoboMonikerSimple.

## Details

### BonoboMoniker

    typedef struct {
            BonoboXObject         object;

    	BonoboMonikerPrivate *priv;
    } BonoboMoniker;

### BonoboMonikerClass

    typedef struct {
    	BonoboXObjectClass      parent_class;

    	POA_Bonobo_Moniker__epv epv;

    	/*
    	 * virtual methods
    	 */
    	Bonobo_Moniker (*get_parent)         (BonoboMoniker               *moniker,
    					      CORBA_Environment           *ev);
    	void           (*set_parent)         (BonoboMoniker               *moniker,
    					      const Bonobo_Moniker         parent,
    					      CORBA_Environment           *ev);
    	CORBA_char    *(*get_display_name)   (BonoboMoniker               *moniker,
    					      CORBA_Environment           *ev);
    	Bonobo_Moniker (*parse_display_name) (BonoboMoniker               *moniker,
    					      Bonobo_Moniker               parent,
    					      const CORBA_char            *name,
    					      CORBA_Environment           *ev);
    	Bonobo_Unknown (*resolve)            (BonoboMoniker               *moniker,
    					      const Bonobo_ResolveOptions *options,
    					      const CORBA_char            *requested_interface,
    					      CORBA_Environment           *ev);
    	CORBA_long     (*equal)              (BonoboMoniker               *moniker,
    					      const CORBA_char            *display_name,
    					      CORBA_Environment           *ev);

    	void           (*set_name)           (BonoboMoniker               *moniker,
    					      const char                  *unescaped_name);
    	const char    *(*get_name)           (BonoboMoniker               *moniker);

    	gpointer        dummy;
    } BonoboMonikerClass;

### bonobo_moniker_construct ()

    BonoboMoniker* bonobo_moniker_construct     (BonoboMoniker *moniker,
                                                 const char *prefix);

Constructs a newly created bonobo moniker with the given arguments.

`moniker` : | an un-constructed moniker object.
`prefix` : | the prefix name of the moniker eg. 'file:', '!' or 'tar:' or NULL
Returns : | the constructed moniker or NULL on failure.

### bonobo_moniker_get_parent ()

    Bonobo_Moniker bonobo_moniker_get_parent    (BonoboMoniker *moniker,
                                                 CORBA_Environment *ev);

See bonobo_moniker_set_parent;

`moniker` : | the moniker
`ev` : | a corba exception environment
Returns : | the parent of this moniker

### bonobo_moniker_set_parent ()

    void        bonobo_moniker_set_parent       (BonoboMoniker *moniker,
                                                 Bonobo_Moniker parent,
                                                 CORBA_Environment *ev);

This sets the monikers parent; a moniker is really a long chain of hierarchical monikers; referenced by the most local moniker. This sets the parent pointer.

`moniker` : | the moniker
`parent` : | the parent
`ev` : | a corba exception environment

### bonobo_moniker_get_name ()

    const char* bonobo_moniker_get_name         (BonoboMoniker *moniker);

gets the unescaped name of the moniker less the prefix eg file:/tmp/hash\#.gz returns /tmp/hash#.gz

`moniker` : | the moniker
Returns : | the string

### bonobo_moniker_set_name ()

    void        bonobo_moniker_set_name         (BonoboMoniker *moniker,
                                                 const char *unescaped_name,
                                                 int num_chars);

This functions sets the moniker name in `moniker` to be `name`.

`moniker` : | the BonoboMoniker to configure.
`unescaped_name` : |
`num_chars` : | number of characters in name to copy.

### bonobo_moniker_get_name_escaped ()

    char*       bonobo_moniker_get_name_escaped (BonoboMoniker *moniker);

Get the full, escaped display name of the moniker eg. file:/tmp/hash\#.gz returns file:/tmp/hash\#.gz

`moniker` : | a moniker
Returns : | the dynamically allocated string, or NULL in case of failure. Must release with g_free().

### bonobo_moniker_get_name_full ()

    const char* bonobo_moniker_get_name_full    (BonoboMoniker *moniker);

gets the full unescaped display name of the moniker eg. file:/tmp/hash\#.gz returns file:/tmp/hash#.gz

`moniker` : | the moniker
Returns : | the string

### bonobo_moniker_get_case_sensitive ()

    gboolean    bonobo_moniker_get_case_sensitive
                                                (BonoboMoniker *moniker);

`moniker` : | the moniker
Returns : | whether we use case sensitivity for the default equal impl.

### bonobo_moniker_set_case_sensitive ()

    void        bonobo_moniker_set_case_sensitive
                                                (BonoboMoniker *moniker,
                                                 gboolean sensitive);

Sets up whether we use case sensitivity for the default equal impl.

`moniker` : | the moniker
`sensitive` : | whether to see case on equality compare

### bonobo_moniker_get_prefix ()

    const char* bonobo_moniker_get_prefix       (BonoboMoniker *moniker);

`moniker` : | a moniker
Returns : | the registered prefix for this moniker or NULL if there isn't one. eg "file:"

## See Also

bonobo-moniker-util BonoboMonikerSimple

<<< Previous Page | Home | Up | Next Page >>>
Writing Monikers | BonoboMonikerSimple