]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_transform/lib/c++utils.h
1 #ifndef __CPLUSPLUS_UTILS__
2 #define __CPLUSPLUS_UTILS__
5 #include <CoreFoundation/CoreFoundation.h>
7 std::string
StringFromCFString(CFStringRef theString
);
8 CFStringRef
CFStringFromString(std::string theString
) CF_RETURNS_RETAINED
;
10 // class to automatically manage the lifetime of a CFObject
18 CFTypeRefHolder(CFTypeRef typeRef
) : mTypeRef(typeRef
) {}
19 virtual ~CFTypeRefHolder();
21 void Set(CFTypeRef typeRef
); // replace the value in the holder with another -- releases the current value
22 CFTypeRef
Get() {return mTypeRef
;}