3-18
SOMobjects Base Toolkit Programmer’s Reference Manual
Return Value
The lookup_name method returns a sequence of pointers to objects of the given name
contained within the specified Container object, or within objects contained in the
Container object.
Example
Here is a code fragment written in C that uses the lookup_name method:
#include <containr.h>
#include <containd.h>
#include <repostry.h>
...
Container repo;
Environment *ev;
sequence(Contained) sc;
long i;
Identifier nameToFind;
...
repo = (Container) RepositoryNew ();
sc = Container_lookup_name (repo, ev, nameToFind, –1, ”all”,
TRUE);
printf (”%d object%s found:\n”,
sc._length, sc._length == 1 ? ”” : ”s”);
for (i=0; i<sc._length; i++) {
printf (”\t%s\n”,
Contained__get_id (sc._buffer[i], ev));
SOMObject_somFree (sc._buffer[i]);
}
if (sc._length)
SOMFree (sc._buffer);
Original Class
Container
Related Information
Methods: contents, describe_contents
Commenti su questo manuale