12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef BASE_MAC_SCOPED_AEDESC_H_
- #define BASE_MAC_SCOPED_AEDESC_H_
- #import <CoreServices/CoreServices.h>
- #include "base/macros.h"
- namespace base {
- namespace mac {
- template <typename AEDescType = AEDesc>
- class ScopedAEDesc {
- public:
- ScopedAEDesc() {
- AECreateDesc(typeNull, NULL, 0, &desc_);
- }
- ~ScopedAEDesc() {
- AEDisposeDesc(&desc_);
- }
-
- operator const AEDescType*() {
- return &desc_;
- }
-
- AEDescType* OutPointer() {
- return &desc_;
- }
- private:
- AEDescType desc_;
- DISALLOW_COPY_AND_ASSIGN(ScopedAEDesc);
- };
- }
- }
- #endif
|