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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       CFCharacterSet.h
  3.  
  4.      Contains:   CoreFoundation character sets
  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 __CFCHARACTERSET__
  18. #define __CFCHARACTERSET__
  19. #ifndef __CFBASE__
  20. #include "CFBase.h"
  21. #endif
  22. #ifndef __CFSTRING__
  23. #include "CFString.h"
  24. #endif
  25. #ifndef __CFDATA__
  26. #include "CFData.h"
  27. #endif
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37. #if PRAGMA_STRUCT_ALIGN
  38.     #pragma options align=mac68k
  39. #elif PRAGMA_STRUCT_PACKPUSH
  40.     #pragma pack(push, 2)
  41. #elif PRAGMA_STRUCT_PACK
  42.     #pragma pack(2)
  43. #endif
  44. #if PRAGMA_ENUM_ALWAYSINT
  45.     #if defined(__fourbyteints__) && !__fourbyteints__ 
  46.         #define __CFCHARACTERSET__RESTORE_TWOBYTEINTS
  47.         #pragma fourbyteints on
  48.     #endif
  49.     #pragma enumsalwaysint on
  50. #elif PRAGMA_ENUM_OPTIONS
  51.     #pragma option enum=int
  52. #elif PRAGMA_ENUM_PACK
  53.     #if __option(pack_enums)
  54.         #define __CFCHARACTERSET__RESTORE_PACKED_ENUMS
  55.         #pragma options(!pack_enums)
  56.     #endif
  57. #endif
  58. typedef const struct __CFCharacterSet * CFCharacterSetRef;
  59. typedef struct __CFCharacterSet * CFMutableCharacterSetRef;
  60. /* Used by CFCharacterSetCreateWithPredefinedSet */
  61. enum CFCharacterSetPredefinedSet {
  62.     kCFCharacterSetControl      = 1,
  63.     kCFCharacterSetWhitespace   = 2,
  64.     kCFCharacterSetWhitespaceAndNewline = 3,
  65.     kCFCharacterSetDecimalDigit = 4,
  66.     kCFCharacterSetLetter       = 5,
  67.     kCFCharacterSetLowercaseLetter = 6,
  68.     kCFCharacterSetUppercaseLetter = 7,
  69.     kCFCharacterSetNonBase      = 8,
  70.     kCFCharacterSetDecomposable = 9,
  71.     kCFCharacterSetAlphaNumeric = 10,
  72.     kCFCharacterSetPunctuation  = 11,
  73.     kCFCharacterSetIllegal      = 12
  74. };
  75. typedef enum CFCharacterSetPredefinedSet CFCharacterSetPredefinedSet;
  76. /* CFCharacterSet type ID */
  77. EXTERN_API_C( CFTypeID )
  78. CFCharacterSetGetTypeID         (void);
  79. /*** CharacterSet creation ***/
  80. /* Functions to create basic immutable characterset. */
  81. EXTERN_API_C( CFCharacterSetRef )
  82. CFCharacterSetGetPredefined     (CFCharacterSetPredefinedSet  theSetIdentifier);
  83. EXTERN_API_C( CFCharacterSetRef )
  84. CFCharacterSetCreateWithCharactersInRange (CFAllocatorRef  alloc,
  85.                                  CFRange                theRange);
  86. EXTERN_API_C( CFCharacterSetRef )
  87. CFCharacterSetCreateWithCharactersInString (CFAllocatorRef  alloc,
  88.                                  CFStringRef            theString);
  89. EXTERN_API_C( CFCharacterSetRef )
  90. CFCharacterSetCreateWithBitmapRepresentation (CFAllocatorRef  alloc,
  91.                                  CFDataRef              theData);
  92. /* Functions to create mutable characterset. */
  93. EXTERN_API_C( CFMutableCharacterSetRef )
  94. CFCharacterSetCreateMutable     (CFAllocatorRef         alloc);
  95. EXTERN_API_C( CFMutableCharacterSetRef )
  96. CFCharacterSetCreateMutableCopy (CFAllocatorRef         alloc,
  97.                                  CFCharacterSetRef      theSet);
  98. /*** Basic accessors ***/
  99. EXTERN_API_C( Boolean )
  100. CFCharacterSetIsCharacterMember (CFCharacterSetRef      theSet,
  101.                                  UniChar                theChar);
  102. EXTERN_API_C( CFDataRef )
  103. CFCharacterSetCreateBitmapRepresentation (CFAllocatorRef  alloc,
  104.                                  CFCharacterSetRef      theSet);
  105. /*** MutableCharacterSet functions ***/
  106. EXTERN_API_C( void )
  107. CFCharacterSetAddCharactersInRange (CFMutableCharacterSetRef  theSet,
  108.                                  CFRange                theRange);
  109. EXTERN_API_C( void )
  110. CFCharacterSetRemoveCharactersInRange (CFMutableCharacterSetRef  theSet,
  111.                                  CFRange                theRange);
  112. EXTERN_API_C( void )
  113. CFCharacterSetAddCharactersInString (CFMutableCharacterSetRef  theSet,
  114.                                  CFStringRef            theString);
  115. EXTERN_API_C( void )
  116. CFCharacterSetRemoveCharactersInString (CFMutableCharacterSetRef  theSet,
  117.                                  CFStringRef            theString);
  118. EXTERN_API_C( void )
  119. CFCharacterSetUnion             (CFMutableCharacterSetRef  theSet,
  120.                                  CFCharacterSetRef      theOtherSet);
  121. EXTERN_API_C( void )
  122. CFCharacterSetIntersect         (CFMutableCharacterSetRef  theSet,
  123.                                  CFCharacterSetRef      theOtherSet);
  124. EXTERN_API_C( void )
  125. CFCharacterSetInvert            (CFMutableCharacterSetRef  theSet);
  126. #if PRAGMA_ENUM_ALWAYSINT
  127.     #pragma enumsalwaysint reset
  128.     #ifdef __CFCHARACTERSET__RESTORE_TWOBYTEINTS
  129.         #pragma fourbyteints off
  130.     #endif
  131. #elif PRAGMA_ENUM_OPTIONS
  132.     #pragma option enum=reset
  133. #elif defined(__CFCHARACTERSET__RESTORE_PACKED_ENUMS)
  134.     #pragma options(pack_enums)
  135. #endif
  136. #if PRAGMA_STRUCT_ALIGN
  137.     #pragma options align=reset
  138. #elif PRAGMA_STRUCT_PACKPUSH
  139.     #pragma pack(pop)
  140. #elif PRAGMA_STRUCT_PACK
  141.     #pragma pack()
  142. #endif
  143. #ifdef PRAGMA_IMPORT_OFF
  144. #pragma import off
  145. #elif PRAGMA_IMPORT
  146. #pragma import reset
  147. #endif
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151. #endif /* __CFCHARACTERSET__ */