Permalink
Browse files

adding conversion API's for NSMutableArray<->CFMutableArrayRef and NS…

…Error<->CFErrorRef
  • Loading branch information...
Machx committed May 4, 2011
1 parent bfed390 commit a4f9ae2e4868d322702d17a2a27b8556365afa13
Showing with 20 additions and 0 deletions.
  1. +20 −0 Source/CWCFConversionMacros.h
@@ -34,6 +34,16 @@ NS_INLINE CFArrayRef CWNSToCFArray(NSArray *array) {
return (CFArrayRef)array;
}
+/* NSMutableArray & CFMutableArrayRef */
+
+NS_INLINE NSMutableArray* CWCFToNSMutableArray(CFMutableArrayRef array) {
+ return (NSMutableArray *)array;
+}
+
+NS_INLINE CFMutableArrayRef CWNSToCFMutableArrayRef(NSMutableArray *array) {
+ return (CFMutableArrayRef)array;
+}
+
/* NSSet & CFSetRef */
NS_INLINE NSSet* CWCFToNSSet(CFSetRef set) {
@@ -73,3 +83,13 @@ NS_INLINE NSNumber* CWCFToNSNumber(CFNumberRef cfnumber) {
NS_INLINE CFNumberRef CWNSToCFNumberRef(NSNumber *nsnumber) {
return (CFNumberRef)nsnumber;
}
+
+/* NSError & CFErrorRef */
+
+NS_INLINE NSError* CWCFToNSError(CFErrorRef cferr) {
+ return (NSError *)cferr;
+}
+
+NS_INLINE CFErrorRef CWNSToCFErrorRef(NSError *nserr) {
+ return (CFErrorRef)nserr;
+}

0 comments on commit a4f9ae2

Please sign in to comment.