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