Re: c++ exceptions
Re: c++ exceptions
- Subject: Re: c++ exceptions
- From: "Stephen J. Butler" <email@hidden>
- Date: Tue, 16 Mar 2010 02:25:30 -0500
On Tue, Mar 16, 2010 at 2:12 AM, Joel Reymont <email@hidden> wrote:
> Are there examples of Apple using C++ exceptions in their code?
>
> Anything at http://opensource.apple.com?
Yes, although with the one example I've run across I can't say I'd use
them the same way (uggg). Take a look at the LDAPv3 plugin in the
DirectoryService package. In particular the CLDAPv3Plugin.cpp. Whoever
wrote it constantly does stuff like this:
tDirStatus CLDAPv3Plugin::CloseDirNode ( sCloseDirNode *inData )
{
tDirStatus siResult = eDSNoErr;
sLDAPContextData *pContext = nil;
try
{
pContext = gLDAPContextTable->GetObjectForRefNum( inData->fInNodeRef );
if ( pContext == nil )
throw( eDSBadContextData );
// our last chance to clean up anything we missed for that node
gLDAPContinueTable->RemovePointersForRefNum( inData->fInNodeRef );
// clean up continues before we remove the first context itself..
gLDAPContextTable->RemoveRefNum( inData->fInNodeRef );
DSRelease( pContext );
}
catch ( tDirStatus err )
{
siResult = err;
}
return( siResult );
} // CloseDirNode
tDirStatus is an integer, in case you didn't figure that out.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden