| // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef BASE_MAC_SCOPED_AEDESC_H_ |
| #define BASE_MAC_SCOPED_AEDESC_H_ |
| #import <CoreServices/CoreServices.h> |
| #include "base/basictypes.h" |
| // The ScopedAEDesc is used to scope AppleEvent descriptors. On creation, |
| // it will store a NULL descriptor. On destruction, it will dispose of the |
| // This class is parameterized for additional type safety checks. You can use |
| // the generic AEDesc type by not providing a template parameter: |
| template <typename AEDescType = AEDesc> |
| AECreateDesc(typeNull, NULL, 0, &desc_); |
| // Used for in parameters. |
| operator const AEDescType*() { |
| // Used for out parameters. |
| AEDescType* OutPointer() { |
| DISALLOW_COPY_AND_ASSIGN(ScopedAEDesc); |
| #endif // BASE_MAC_SCOPED_AEDESC_H_ |