Lines Matching defs:CFType
45 template <class CFType> struct CFTraits { };
73 template <class CFType> class CFRef {
76 CFRef(CFType ref) : mRef(ref) { }
82 : mRef(CFType(ref))
84 if (ref && !CFTraits<CFType>::check(ref))
88 CFRef &take(CFType ref)
91 CFType yield()
92 { CFType r = mRef; mRef = NULL; return r; }
94 CFRef &operator = (CFType ref)
100 // take variant for when newly created CFType is returned
101 // via a ptr-to-CFType argument.
102 CFType *take()
105 operator CFType () const { return mRef; }
109 CFType get() const { return mRef; }
111 CFType &aref()
114 CFType retain() const
124 static CFType check(OldType cf, OSStatus err)
126 if (cf && !CFTraits<CFType>::check(cf))
128 return CFType(cf);
138 CFType mRef;
142 template <class CFType> class CFCopyRef : public CFRef<CFType> {
143 typedef CFRef<CFType> _Base;
146 CFCopyRef(CFType ref) : _Base(ref) { this->retain(); }
151 CFCopyRef &take(CFType ref)
154 CFCopyRef &operator = (CFType ref)
481 template <class CFType>
482 CFType get(CFStringRef key, OSStatus err = errSecSuccess) const
485 return CFRef<CFType>::check(elem, err ? err : mDefaultError);
488 template <class CFType>
489 CFType get(const char *key, OSStatus err = errSecSuccess) const
490 { return get<CFType>(CFTempString(key), err); }