Unit 'utility' Package
[Overview][Constants][Types][Procedures and functions][Index] [#aros]

FindNamedObject

Find the next object of a given name.

Declaration

Source position: utility.pas line 244

function FindNamedObject(

  NameSpace: PNamedObject;

  const Name: PChar;

  LastObject: PNamedObject

):PNamedObject;

Arguments

NameSpace

  

The NameSpace to search through. If nil will use the system default NameSpace.

Name

  

The name of the object to search for. If nil, any and all NamedObjects will be matched.

LastObject

  

The (optional) last NamedObject to start the search from.

Function result

If a NamedObject with the name supplied exists, it will be returned. Otherwise will return nil. When you have finised with this NamedObject, you should call ReleaseNamedObject().

Description

Finds an object and adds to the open count of the object. The object is guaranteed not to be freed until ReleaseNamedObject() is called. The name comparison is caseless, using the current locale string comparison routines.

If name is nil, then all objects will be matched.

If lastObject is non-nil, it must be an object from the same NameSpace found on a previous call to FindNamedObject(). It will not be freed by this call. The search will start at the node after lastobject, if non-nil.

nameSpace is the name space from the named object given or the root name space if nil is given.

If you are going to use a returned NamedObject to be the starting point for another search you must call ReleaseNamedObject()after searching, as the ReleaseNamedObject() call can cause the NamedObject to be freed, leaving you with an invalid pointer.

See also

ReleaseNamedObject

  

Free a named object.


Documentation generated on: 2021-07-30