| 1 |
/* CFCharacterSet.h |
| 2 |
|
| 3 |
Copyright (C) 2012 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
Written by: Stefan Bidigaray |
| 6 |
Date: January, 2012 |
| 7 |
|
| 8 |
This file is part of the GNUstep CoreBase Library. |
| 9 |
|
| 10 |
This library is free software; you can redistribute it and/or |
| 11 |
modify it under the terms of the GNU Lesser General Public |
| 12 |
License as published by the Free Software Foundation; either |
| 13 |
version 2.1 of the License, or (at your option) any later version. |
| 14 |
|
| 15 |
This library is distributed in the hope that it will be useful, |
| 16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 18 |
Lesser General Public License for more details. |
| 19 |
|
| 20 |
You should have received a copy of the GNU Lesser General Public |
| 21 |
License along with this library; see the file COPYING.LIB. |
| 22 |
If not, see <http://www.gnu.org/licenses/> or write to the |
| 23 |
Free Software Foundation, 51 Franklin Street, Fifth Floor, |
| 24 |
Boston, MA 02110-1301, USA. |
| 25 |
*/ |
| 26 |
|
| 27 |
#ifndef __COREFOUNDATION_CFCHARACTERSET_H__ |
| 28 |
#define __COREFOUNDATION_CFCHARACTERSET_H__ |
| 29 |
|
| 30 |
#include "CFBase.h" |
| 31 |
#include "CFData.h" |
| 32 |
|
| 33 |
CF_EXTERN_C_BEGIN |
| 34 |
|
| 35 |
/** \ingroup CFCharacterSetRef */ |
| 36 |
typedef const struct __CFCharacterSet * CFCharacterSetRef; |
| 37 |
/** \ingroup CFMutableCharacterSetRef */ |
| 38 |
typedef struct __CFCharacterSet * CFMutableCharacterSetRef; |
| 39 |
|
| 40 |
/** \defgroup CFCharacterSetRef CFCharacterSet Reference |
| 41 |
\{ |
| 42 |
*/ |
| 43 |
typedef enum |
| 44 |
{ |
| 45 |
kCFCharacterSetControl = 1, |
| 46 |
kCFCharacterSetWhitespace, |
| 47 |
kCFCharacterSetWhitespaceAndNewline, |
| 48 |
kCFCharacterSetDecimalDigit, |
| 49 |
kCFCharacterSetLetter, |
| 50 |
kCFCharacterSetLowercaseLetter, |
| 51 |
kCFCharacterSetUppercaseLetter, |
| 52 |
kCFCharacterSetNonBase, |
| 53 |
kCFCharacterSetDecomposable, |
| 54 |
kCFCharacterSetAlphaNumeric, |
| 55 |
kCFCharacterSetPunctuation, |
| 56 |
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) |
| 57 |
kCFCharacterSetCapitalizedLetter = 13, |
| 58 |
#endif |
| 59 |
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) |
| 60 |
kCFCharacterSetSymbol = 14, |
| 61 |
#endif |
| 62 |
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) |
| 63 |
kCFCharacterSetNewline = 15, |
| 64 |
#endif |
| 65 |
kCFCharacterSetIllegal = 12 |
| 66 |
} CFCharacterSetPredefinedSet; |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
/** \name Creating Character Sets |
| 71 |
\{ |
| 72 |
*/ |
| 73 |
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) |
| 74 |
CF_EXPORT CFCharacterSetRef |
| 75 |
CFCharacterSetCreateCopy (CFAllocatorRef alloc, CFCharacterSetRef set); |
| 76 |
#endif |
| 77 |
|
| 78 |
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) |
| 79 |
CF_EXPORT CFCharacterSetRef |
| 80 |
CFCharacterSetCreateInvertedSet (CFAllocatorRef alloc, CFCharacterSetRef set); |
| 81 |
#endif |
| 82 |
|
| 83 |
CF_EXPORT CFCharacterSetRef |
| 84 |
CFCharacterSetCreateWithCharactersInRange (CFAllocatorRef alloc, |
| 85 |
CFRange range); |
| 86 |
|
| 87 |
CF_EXPORT CFCharacterSetRef |
| 88 |
CFCharacterSetCreateWithCharactersInString (CFAllocatorRef alloc, |
| 89 |
CFStringRef string); |
| 90 |
|
| 91 |
CF_EXPORT CFCharacterSetRef |
| 92 |
CFCharacterSetCreateWithBitmapRepresentation (CFAllocatorRef alloc, |
| 93 |
CFDataRef data); |
| 94 |
/** \} */ |
| 95 |
|
| 96 |
/** \name Getting Predefined Character Sets |
| 97 |
\{ |
| 98 |
*/ |
| 99 |
CF_EXPORT CFCharacterSetRef |
| 100 |
CFCharacterSetGetPredefined (CFCharacterSetPredefinedSet setIdentifier); |
| 101 |
/** \} */ |
| 102 |
|
| 103 |
/** \name Querying Character Sets |
| 104 |
\{ |
| 105 |
*/ |
| 106 |
CF_EXPORT CFDataRef |
| 107 |
CFCharacterSetCreateBitmapRepresentation (CFAllocatorRef alloc, |
| 108 |
CFCharacterSetRef set); |
| 109 |
|
| 110 |
CF_EXPORT Boolean |
| 111 |
CFCharacterSetIsCharacterMember (CFCharacterSetRef set, UniChar c); |
| 112 |
|
| 113 |
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) |
| 114 |
CF_EXPORT Boolean |
| 115 |
CFCharacterSetHasMemberInPlane (CFCharacterSetRef set, CFIndex plane); |
| 116 |
|
| 117 |
CF_EXPORT Boolean |
| 118 |
CFCharacterSetIsLongCharacterMember (CFCharacterSetRef set, UTF32Char c); |
| 119 |
|
| 120 |
CF_EXPORT Boolean |
| 121 |
CFCharacterSetIsSupersetOfSet (CFCharacterSetRef set, |
| 122 |
CFCharacterSetRef otherSet); |
| 123 |
#endif |
| 124 |
/** \} */ |
| 125 |
|
| 126 |
/** \name Getting the Character Set Type Identifier |
| 127 |
\{ |
| 128 |
*/ |
| 129 |
CF_EXPORT CFTypeID |
| 130 |
CFCharacterSetGetTypeID (void); |
| 131 |
/** \} */ |
| 132 |
/** \} */ |
| 133 |
|
| 134 |
/** \defgroup CFMutableCharacterSetRef CFMutableCharacterSet Reference |
| 135 |
\{ |
| 136 |
*/ |
| 137 |
CF_EXPORT CFMutableCharacterSetRef |
| 138 |
CFCharacterSetCreateMutable (CFAllocatorRef alloc); |
| 139 |
|
| 140 |
CF_EXPORT CFMutableCharacterSetRef |
| 141 |
CFCharacterSetCreateMutableCopy (CFAllocatorRef alloc, CFCharacterSetRef set); |
| 142 |
|
| 143 |
CF_EXPORT void |
| 144 |
CFCharacterSetAddCharactersInRange (CFMutableCharacterSetRef set, |
| 145 |
CFRange range); |
| 146 |
|
| 147 |
CF_EXPORT void |
| 148 |
CFCharacterSetAddCharactersInString (CFMutableCharacterSetRef set, |
| 149 |
CFStringRef string); |
| 150 |
|
| 151 |
CF_EXPORT void |
| 152 |
CFCharacterSetRemoveCharactersInRange (CFMutableCharacterSetRef set, |
| 153 |
CFRange range); |
| 154 |
|
| 155 |
CF_EXPORT void |
| 156 |
CFCharacterSetRemoveCharactersInString (CFMutableCharacterSetRef set, |
| 157 |
CFStringRef string); |
| 158 |
|
| 159 |
CF_EXPORT void |
| 160 |
CFCharacterSetIntersect (CFMutableCharacterSetRef set, |
| 161 |
CFCharacterSetRef otherSet); |
| 162 |
|
| 163 |
CF_EXPORT void |
| 164 |
CFCharacterSetInvert (CFMutableCharacterSetRef set); |
| 165 |
|
| 166 |
CF_EXPORT void |
| 167 |
CFCharacterSetUnion (CFMutableCharacterSetRef set, CFCharacterSetRef otherSet); |
| 168 |
/** \} */ |
| 169 |
|
| 170 |
CF_EXTERN_C_END |
| 171 |
|
| 172 |
#endif /* __COREFOUNDATION_CFCHARACTERSET_H__ */ |
| 173 |
|