CFArray.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:7k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       CFArray.h
  3.  
  4.      Contains:   CoreFoundation array collection
  5.  
  6.      Version:    Technology: Mac OS X
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1999-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CFARRAY__
  18. #define __CFARRAY__
  19. #ifndef __CFBASE__
  20. #include "CFBase.h"
  21. #endif
  22. #if PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #if PRAGMA_IMPORT
  29. #pragma import on
  30. #endif
  31. #if PRAGMA_STRUCT_ALIGN
  32.     #pragma options align=mac68k
  33. #elif PRAGMA_STRUCT_PACKPUSH
  34.     #pragma pack(push, 2)
  35. #elif PRAGMA_STRUCT_PACK
  36.     #pragma pack(2)
  37. #endif
  38. typedef CALLBACK_API_C( const void *, CFArrayRetainCallBack )(CFAllocatorRef allocator, const void *ptr);
  39. typedef CALLBACK_API_C( void , CFArrayReleaseCallBack )(CFAllocatorRef allocator, const void *ptr);
  40. typedef CALLBACK_API_C( CFStringRef , CFArrayCopyDescriptionCallBack )(const void *ptr);
  41. typedef CALLBACK_API_C( Boolean , CFArrayEqualCallBack )(const void *ptr1, const void *ptr2);
  42. struct CFArrayCallBacks {
  43.     CFIndex                         version;
  44.     CFArrayRetainCallBack           retain;
  45.     CFArrayReleaseCallBack          release;
  46.     CFArrayCopyDescriptionCallBack  copyDescription;
  47.     CFArrayEqualCallBack            equal;
  48. };
  49. typedef struct CFArrayCallBacks         CFArrayCallBacks;
  50. extern const CFArrayCallBacks kCFTypeArrayCallBacks;
  51. typedef CALLBACK_API_C( void , CFArrayApplierFunction )(const void *val, void *context);
  52. typedef const struct __CFArray * CFArrayRef;
  53. typedef struct __CFArray * CFMutableArrayRef;
  54. EXTERN_API_C( CFTypeID )
  55. CFArrayGetTypeID                (void);
  56. EXTERN_API_C( CFArrayRef )
  57. CFArrayCreate                   (CFAllocatorRef         allocator,
  58.                                  const void **          values,
  59.                                  CFIndex                numValues,
  60.                                  const CFArrayCallBacks * callBacks);
  61. EXTERN_API_C( CFArrayRef )
  62. CFArrayCreateCopy               (CFAllocatorRef         allocator,
  63.                                  CFArrayRef             srcArray);
  64. EXTERN_API_C( CFMutableArrayRef )
  65. CFArrayCreateMutable            (CFAllocatorRef         allocator,
  66.                                  CFIndex                capacity,
  67.                                  const CFArrayCallBacks * callBacks);
  68. EXTERN_API_C( CFMutableArrayRef )
  69. CFArrayCreateMutableCopy        (CFAllocatorRef         allocator,
  70.                                  CFIndex                capacity,
  71.                                  CFArrayRef             srcArray);
  72. EXTERN_API_C( CFIndex )
  73. CFArrayGetCount                 (CFArrayRef             theArray);
  74. EXTERN_API_C( CFIndex )
  75. CFArrayGetCountOfValue          (CFArrayRef             theArray,
  76.                                  CFRange                range,
  77.                                  const void *           value);
  78. EXTERN_API_C( Boolean )
  79. CFArrayContainsValue            (CFArrayRef             theArray,
  80.                                  CFRange                range,
  81.                                  const void *           value);
  82. EXTERN_API_C( const void *)
  83. CFArrayGetValueAtIndex          (CFArrayRef             theArray,
  84.                                  CFIndex                idx);
  85. EXTERN_API_C( void )
  86. CFArrayGetValues                (CFArrayRef             theArray,
  87.                                  CFRange                range,
  88.                                  const void **          values);
  89. EXTERN_API_C( void )
  90. CFArrayApplyFunction            (CFArrayRef             theArray,
  91.                                  CFRange                range,
  92.                                  CFArrayApplierFunction  applier,
  93.                                  void *                 context);
  94. EXTERN_API_C( CFIndex )
  95. CFArrayGetFirstIndexOfValue     (CFArrayRef             theArray,
  96.                                  CFRange                range,
  97.                                  const void *           value);
  98. EXTERN_API_C( CFIndex )
  99. CFArrayGetLastIndexOfValue      (CFArrayRef             theArray,
  100.                                  CFRange                range,
  101.                                  const void *           value);
  102. EXTERN_API_C( CFIndex )
  103. CFArrayBSearchValues            (CFArrayRef             theArray,
  104.                                  CFRange                range,
  105.                                  const void *           value,
  106.                                  CFComparatorFunction   comparator,
  107.                                  void *                 context);
  108. EXTERN_API_C( void )
  109. CFArrayAppendValue              (CFMutableArrayRef      theArray,
  110.                                  const void *           value);
  111. EXTERN_API_C( void )
  112. CFArrayInsertValueAtIndex       (CFMutableArrayRef      theArray,
  113.                                  CFIndex                idx,
  114.                                  const void *           value);
  115. EXTERN_API_C( void )
  116. CFArraySetValueAtIndex          (CFMutableArrayRef      theArray,
  117.                                  CFIndex                idx,
  118.                                  const void *           value);
  119. EXTERN_API_C( void )
  120. CFArrayRemoveValueAtIndex       (CFMutableArrayRef      theArray,
  121.                                  CFIndex                idx);
  122. EXTERN_API_C( void )
  123. CFArrayRemoveAllValues          (CFMutableArrayRef      theArray);
  124. EXTERN_API_C( void )
  125. CFArrayReplaceValues            (CFMutableArrayRef      theArray,
  126.                                  CFRange                range,
  127.                                  const void **          newValues,
  128.                                  CFIndex                newCount);
  129. EXTERN_API_C( void )
  130. CFArrayExchangeValuesAtIndices  (CFMutableArrayRef      theArray,
  131.                                  CFIndex                idx1,
  132.                                  CFIndex                idx2);
  133. EXTERN_API_C( void )
  134. CFArraySortValues               (CFMutableArrayRef      theArray,
  135.                                  CFRange                range,
  136.                                  CFComparatorFunction   comparator,
  137.                                  void *                 context);
  138. #if PRAGMA_STRUCT_ALIGN
  139.     #pragma options align=reset
  140. #elif PRAGMA_STRUCT_PACKPUSH
  141.     #pragma pack(pop)
  142. #elif PRAGMA_STRUCT_PACK
  143.     #pragma pack()
  144. #endif
  145. #ifdef PRAGMA_IMPORT_OFF
  146. #pragma import off
  147. #elif PRAGMA_IMPORT
  148. #pragma import reset
  149. #endif
  150. #ifdef __cplusplus
  151. }
  152. #endif
  153. #endif /* __CFARRAY__ */