• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: c++ exceptions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: c++ exceptions
      • From: Kevin Van Vechten <email@hidden>
References: 
 >c++ exceptions (From: Joel Reymont <email@hidden>)

  • Prev by Date: c++ exceptions
  • Next by Date: Re: c++ exceptions
  • Previous by thread: c++ exceptions
  • Next by thread: Re: c++ exceptions
  • Index(es):
    • Date
    • Thread