/usr/include/GNUstep/Foundation/NSIndexSet.h is in libgnustep-base-dev 1.22.1-4+deb7u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | /** Interface for NSIndexSet, NSMutableIndexSet for GNUStep
Copyright (C) 2004 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <rfm@gnu.org>
Created: Feb 2004
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
AutogsdocSource: NSIndexSet.m
*/
#ifndef _NSIndexSet_h_GNUSTEP_BASE_INCLUDE
#define _NSIndexSet_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
#import <Foundation/NSObject.h>
#import <Foundation/NSRange.h>
#if defined(__cplusplus)
extern "C" {
#endif
/**
* Instances of this class are collections of unsigned integers in the
* range 0 to NSNotFound-1.<br />
* Each integer can appear in a collection only once.
*/
@interface NSIndexSet : NSObject <NSCopying, NSMutableCopying, NSCoding>
{
#if GS_EXPOSE(NSIndexSet)
void *_data;
#endif
}
/**
* Return an empty set.
*/
+ (id) indexSet;
/**
* Return a set containing the single value anIndex, or returns nil if
* anIndex is NSNotFound.
*/
+ (id) indexSetWithIndex: (NSUInteger)anIndex;
/**
* Return a set containing all the values in aRange, or returns nil if
* aRange contains NSNotFound.
*/
+ (id) indexSetWithIndexesInRange: (NSRange)aRange;
/**
* Returns YES if the receiver contains anIndex, NO otherwise.
*/
- (BOOL) containsIndex: (NSUInteger)anIndex;
/**
* Returns YES if the receiver contains all the index values present
* in aSet, NO otherwise.
*/
- (BOOL) containsIndexes: (NSIndexSet*)aSet;
/**
* Returns YES if the receiver contains all the index values present
* in aRange, NO otherwise.
*/
- (BOOL) containsIndexesInRange: (NSRange)aRange;
/**
* Returns the number of index values present in the receiver.
*/
- (NSUInteger) count;
#if OS_API_VERSION(100500,GS_API_LATEST)
/** Not implemented
* Returns the number of indexes set within the specified range.
*/
- (NSUInteger) countOfIndexesInRange: (NSRange)range;
#endif
/**
* Returns the first index value in the receiver or NSNotFound if the
* receiver is empty.
*/
- (NSUInteger) firstIndex;
/**
* Copies index values into aBuffer until there are no index values left or
* aBuffer is full (assuming that the size of aBuffer is given by aCount).<br />
* Only copies index values present in aRange and copies them in order.<br />
* Returns the number of index values placed in aBuffer.<br />
* Modifies aRange to start after the last index value copied.<br />
* If aRange is a null pointer, this method attempts to get <em>all</em>
* index values from the set (and of course no range can be returned in it).
*/
- (NSUInteger) getIndexes: (NSUInteger*)aBuffer
maxCount: (NSUInteger)aCount
inIndexRange: (NSRangePointer)aRange;
/**
* Return the first index value in the receiver which is greater than
* anIndex.
*/
- (NSUInteger) indexGreaterThanIndex: (NSUInteger)anIndex;
/**
* Return the first index value in the receiver which is greater than
* or equal to anIndex.
*/
- (NSUInteger) indexGreaterThanOrEqualToIndex: (NSUInteger)anIndex;
/**
* Return the first index value in the receiver which is less than
* anIndex.
*/
- (NSUInteger) indexLessThanIndex: (NSUInteger)anIndex;
/**
* Return the first index value in the receiver which is less than
* or equal to anIndex.
*/
- (NSUInteger) indexLessThanOrEqualToIndex: (NSUInteger)anIndex;
/**
* Initialise the receiver to contain anIndex. Returns the initialised
* object or nil if anIndex is NSNotFound.
*/
- (id) initWithIndex: (NSUInteger)anIndex;
/** <init />
* Initialise the receiver to contain all index values in aRange.
* Returns the initialised object or nil if aRange contains NSNotFound.
*/
- (id) initWithIndexesInRange: (NSRange)aRange;
/**
* Initialises the receiver with the index values from aSet.
*/
- (id) initWithIndexSet: (NSIndexSet*)aSet;
/**
* Returns YES if the receiver contains any index values which lie in aRange,
* No otherwise.
*/
- (BOOL) intersectsIndexesInRange: (NSRange)aRange;
/**
* Tests two index sets for equality and returns either YES or NO.
*/
- (BOOL) isEqualToIndexSet: (NSIndexSet*)aSet;
/**
* Returns the last index value in the receiver or NSNotFound if the
* receiver is empty.
*/
- (NSUInteger) lastIndex;
@end
@interface NSMutableIndexSet : NSIndexSet
/**
* Adds anIndex to the set of indexes stored in the receiver.
*/
- (void) addIndex: (NSUInteger)anIndex;
/**
* Adds all the indexes from aSet to the set of indexes stored in the receiver.
*/
- (void) addIndexes: (NSIndexSet*)aSet;
/**
* Adds all the indexes in aRange to the set of indexes stored in the receiver.
*/
- (void) addIndexesInRange: (NSRange)aRange;
/**
* Removes all indexes stored in the receiver.
*/
- (void) removeAllIndexes;
/**
* Removes anIndex from the set of indexes stored in the receiver.
*/
- (void) removeIndex: (NSUInteger)anIndex;
/**
* Removes all the indexes in aSet from the set of indexes
* stored in the receiver.
*/
- (void) removeIndexes: (NSIndexSet*)aSet;
/**
* Removes all the indexes in aRange from the set of indexes
* stored in the receiver.
*/
- (void) removeIndexesInRange: (NSRange)aRange;
/**
* Moves all the indexes from anIndex upwards by the amount specified.<br />
* If amount is negative, index values below anIndex will be overwritten
* by the shifted values.<br />
* If amount is positive, a 'hole' will be left in the index range after
* anIndex.
*/
- (void) shiftIndexesStartingAtIndex: (NSUInteger)anIndex
by: (NSInteger)amount;
@end
#if defined(__cplusplus)
}
#endif
#endif
#endif
|