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_SCOPED_AEDESC_H_
6 #define BASE_SCOPED_AEDESC_H_
9 #import <CoreServices/CoreServices.h>
11 #include "base/basictypes.h"
13 // The scoped_aedesc is used to scope AppleEvent descriptors. On creation,
14 // it will store a NULL descriptor. On destruction, it will dispose of the
17 // This class is parameterized for additional type safety checks. You can use
18 // the generic AEDesc type by not providing a template parameter:
19 // scoped_aedesc<> desc;
20 template <typename AEDescType
= AEDesc
>
24 AECreateDesc(typeNull
, NULL
, 0, &desc_
);
28 AEDisposeDesc(&desc_
);
31 // Used for in parameters.
32 operator const AEDescType
*() {
36 // Used for out parameters.
37 AEDescType
* OutPointer() {
44 DISALLOW_COPY_AND_ASSIGN(scoped_aedesc
);
47 #endif // BASE_SCOPED_AEDESC_H_