Samond Classes Library 1.2.1-RELEASE build 181
SCStrings.h
См. документацию.
1 //
2 // SCStrings.h
3 // scl
4 //
5 // Created by Viacheslav Smolensky on 05.02.13.
6 // Copyright (c) 2007 - 2017 by Samond Development Corporation. All rights reserved.
7 //
8 
22 #import <scl/SCObject.h>
23 #import <scl/SCArray.h>
24 #import <scl/SCTextDelegate.h>
25 
26 #pragma mark -
27 #pragma mark Class Constants
28 
32 #define SCStringsClass @"SCStrings"
33 
34 
67 @interface SCStrings : SCObject {
68  SCArray *fStrings; // Internal data storage
69  BOOL fModified; // Modified flag
70  BOOL fCaseInsensitive; // Case insensitive flag
71  id<SCTextDelegate> fDelegate; // Delegate object
72 }
73 
74 #pragma mark -
75 #pragma mark Instance Properties
76 
85 @property (nonatomic, retain, getter=name, setter=setName:) NSString *name;
86 
91 @property (nonatomic, assign, getter=readOnly, setter=setReadOnly:) BOOL readOnly;
92 
97 @property (nonatomic, assign, getter=caseInsensitive, setter=setCaseInsensitive:) BOOL caseInsensitive;
98 
103 @property (nonatomic, retain, getter=delegate, setter=setDelegate:) id<SCTextDelegate> delegate;
104 
109 @property (nonatomic, assign, readonly, getter=count) SCIndex count;
110 
115 @property (nonatomic, assign, readonly, getter=empty) BOOL empty;
116 
121 @property (nonatomic, retain, readonly, getter=description) NSString *description;
122 
127 @property (nonatomic, assign, readonly, getter=modified) BOOL modified;
128 
148 @property (nonatomic, retain, readonly, getter=stringEnumerator) NSEnumerator *stringEnumerator;
149 
154 @property (nonatomic, retain, readonly, getter=reverseStringEnumerator) NSEnumerator *reverseStringEnumerator;
155 
165 @property (nonatomic, retain, readonly, getter=array) SCArray *array;
166 
171 @property (nonatomic, retain, readonly, getter=foundationArray) NSArray *foundationArray;
172 
182 @property (nonatomic, retain, readonly, getter=sortedStrings) SCStrings *sortedStrings;
183 
201 @property (nonatomic, retain, readonly, getter=reversedStrings) SCStrings *reversedStrings;
202 
212 @property (nonatomic, retain, readonly, getter=firstString) NSString *firstString;
213 
218 @property (nonatomic, retain, readonly, getter=lastString) NSString *lastString;
219 
229 @property (nonatomic, assign, readonly, getter=indexOfLastString) SCIndex indexOfLastString;
230 
233 #pragma mark -
234 #pragma mark Accessing to Instance Properties
235 - (NSString *)name;
236 - (BOOL)readOnly;
237 - (BOOL)caseInsensitive;
238 - (id)delegate;
239 - (SCIndex)count;
240 - (BOOL)empty;
241 - (BOOL)modified;
242 
243 - (void)setName:(NSString *)name;
244 - (void)setReadOnly:(BOOL)readOnly;
245 - (void)setCaseInsensitive:(BOOL)caseInsensitive;
246 - (void)setDelegate:(id<SCTextDelegate>)delegate;
247 
248 #pragma mark -
249 #pragma mark Creating Strings Lists
250 + (instancetype)stringsWithCoder:(NSCoder *)coder;
251 + (instancetype)stringsWithContentsOfSerializedFile:(NSString *)path;
252 + (instancetype)stringsWithDataDictionary:(NSDictionary *)dictionary;
253 + (instancetype)stringsWithDataDictionaryFromFile:(NSString *)path;
254 + (instancetype)stringsWithStream:(SCStream *)stream;
255 + (instancetype)stringsWithFileStream:(NSString *)path;
256 
257 + (instancetype)stringsWithName:(NSString *)name;
258 + (instancetype)stringsWithString:(NSString *)string;
259 + (instancetype)stringsWithCollection:(id<SCCollection>)collection;
260 + (instancetype)stringsWithStrings:(SCStrings *)strings;
261 + (instancetype)strings;
262 
263 #pragma mark -
264 #pragma mark Initializing Strings Lists
265 - (instancetype)initWithName:(NSString *)name;
266 - (instancetype)initWithString:(NSString *)string;
267 - (instancetype)initWithCollection:(id<SCCollection>)collection;
268 - (instancetype)initWithStrings:(SCStrings *)strings;
269 - (instancetype)init;
270 
271 #pragma mark -
272 #pragma mark Copying Strings Lists
273 - (void)setStrings:(SCStrings *)strings;
274 - (void)setCollection:(id<SCCollection>)collection;
275 - (void)setString:(NSString *)string;
276 
277 #pragma mark -
278 #pragma mark Comparing Strings Lists
279 - (BOOL)isEqualToStrings:(SCStrings *)strings;
280 - (BOOL)isEqualToCollection:(id<SCCollection>)collection;
281 - (BOOL)isEqualTo:(id)object;
282 - (BOOL)isEqual:(id)object;
283 
284 #pragma mark -
285 #pragma mark Strings Enumerators
286 - (NSEnumerator *)stringEnumerator;
287 - (NSEnumerator *)reverseStringEnumerator;
288 - (void)enumerateWithDelegate:(id<SCTextDelegate>)delegate;
289 - (void)enumerate;
290 - (void)reverseEnumerateWithDelegate:(id<SCTextDelegate>)delegate;
291 - (void)reverseEnumerate;
292 
293 #pragma mark -
294 #pragma mark Converting Strings Lists
295 - (SCArray *)array;
296 - (NSArray *)foundationArray;
297 
298 #pragma mark -
299 #pragma mark Sorting Strings Lists
300 - (void)sortAscendingWithSorter:(id<SCSorter>)sorter;
301 - (void)sortDescendingWithSorter:(id<SCSorter>)sorter;
302 - (void)sortWithSorter:(id<SCSorter>)sorter;
303 - (void)sortAscending;
304 - (void)sortDescending;
305 - (void)sort;
306 - (SCStrings *)ascendingSortedStringsWithSorter:(id<SCSorter>)sorter;
307 - (SCStrings *)descendingSortedStringsWithSorter:(id<SCSorter>)sorter;
308 - (SCStrings *)sortedStringsWithSorter:(id<SCSorter>)sorter;
309 - (SCStrings *)ascendingSortedStrings;
310 - (SCStrings *)descendingSortedStrings;
311 - (SCStrings *)sortedStrings;
312 
313 #pragma mark -
314 #pragma mark Adding Strings
315 - (void)addString:(NSString *)string;
316 - (void)addCollection:(id<SCCollection>)collection;
317 - (void)addStrings:(SCStrings *)strings;
318 - (void)addLine;
319 
320 - (void)insertString:(NSString *)string atIndex:(SCIndex)index;
321 - (void)insertStrings:(SCStrings *)strings atIndex:(SCIndex)index;
322 - (void)insertCollection:(id<SCCollection>)collection atIndex:(SCIndex)index;
323 - (void)insertStrings:(SCStrings *)strings atIndexes:(NSIndexSet *)indexes;
324 - (void)insertCollection:(id<SCCollection>)collection atIndexes:(NSIndexSet *)indexes;
325 - (void)insertLineAtIndex:(SCIndex)index;
326 
327 #pragma mark -
328 #pragma mark Removing Strings
329 - (void)removeAllStrings;
330 - (void)removeFirstString;
331 - (void)removeLastString;
332 - (void)removeStringAtIndex:(SCIndex)index;
333 - (void)removeStringsAtIndexes:(NSIndexSet *)indexes;
334 - (void)removeString:(NSString *)string;
335 - (void)removeStrings:(SCStrings *)strings;
336 - (void)removeCollection:(id<SCCollection>)collection;
337 - (void)removeStringsWithSubstring:(NSString *)substring;
338 - (void)removeStringsNotAtIndexes:(NSIndexSet *)indexes;
339 - (void)removeStringsNotEqualTo:(NSString *)string;
340 - (void)removeStringsNotInStrings:(SCStrings *)strings;
341 - (void)removeStringsNotInCollection:(id<SCCollection>)collection;
342 - (void)removeStringsWithoutSubstring:(NSString *)substring;
343 - (void)removeDuplicatedStrings;
344 
345 #pragma mark -
346 #pragma mark Replacing Strings
347 - (void)replaceStringAtIndex:(SCIndex)index withString:(NSString *)string;
348 - (void)replaceStringsAtIndexes:(NSIndexSet *)indexes withStrings:(SCStrings *)strings;
349 - (void)replaceStringsAtIndexes:(NSIndexSet *)indexes withCollection:(id<SCCollection>)collection;
350 - (void)replaceString:(NSString *)string withString:(NSString *)newString;
351 
352 #pragma mark -
353 #pragma mark Copying and Moving Strings
354 - (void)exchangeStringAtIndex:(SCIndex)index withStringAtIndex:(SCIndex)destination;
355 - (void)duplicateStringAtIndex:(SCIndex)index;
356 - (void)duplicateAllStrings;
357 - (void)duplicate;
358 - (void)copyStringAtIndex:(SCIndex)index toIndex:(SCIndex)destination;
359 - (void)moveStringAtIndex:(SCIndex)index toIndex:(SCIndex)destination;
360 - (void)forwardMoveStringAtIndex:(SCIndex)index steps:(SCIndex)steps;
361 - (void)forwardMoveStringAtIndex:(SCIndex)index;
362 - (void)backwardMoveStringAtIndex:(SCIndex)index steps:(SCIndex)steps;
363 - (void)backwardMoveStringAtIndex:(SCIndex)index;
364 - (void)moveToFirstPositionStringAtIndex:(SCIndex)index;
365 - (void)moveToLastPositionStringAtIndex:(SCIndex)index;
366 - (void)reverse;
367 - (SCStrings *)reversedStrings;
368 
369 #pragma mark -
370 #pragma mark Querying a Strings List
371 - (NSString *)firstString;
372 - (NSString *)lastString;
373 - (NSString *)stringAtIndex:(SCIndex)index;
374 - (SCStrings *)stringsAtIndexes:(NSIndexSet *)indexes;
375 
376 #pragma mark -
377 #pragma mark Finding Strings in a Strings List
378 - (BOOL)containsString:(NSString *)string;
379 - (BOOL)containsStrings:(SCStrings *)strings;
380 - (BOOL)containsCollection:(id<SCCollection>)collection;
381 - (BOOL)containsAnyString:(SCStrings *)strings;
382 - (BOOL)containsAnyStringFromCollection:(id<SCCollection>)collection;
383 - (BOOL)containsSubstring:(NSString *)substring;
384 - (BOOL)containsSubstrings:(SCStrings *)substrings;
385 - (BOOL)containsSubstringsFromCollection:(id<SCCollection>)collection;
386 - (BOOL)containsAnySubstring:(SCStrings *)substrings;
387 - (BOOL)containsAnySubstringFromCollection:(id<SCCollection>)collection;
388 - (BOOL)containsDuplicatedStrings;
389 
390 - (SCIndex)indexOfString:(NSString *)string;
391 - (SCIndex)indexOfLastString;
392 - (SCIndex)indexOfSubstring:(NSString *)substring;
393 
394 - (SCStrings *)stringsWithSubstring:(NSString *)substring;
395 - (SCStrings *)stringsWithSubstrings:(SCStrings *)substrings;
396 - (SCStrings *)stringsWithSubstringsFromCollection:(id<SCCollection>)collection;
397 - (SCStrings *)stringsWithAnySubstring:(SCStrings *)substrings;
398 - (SCStrings *)stringsWithAnySubstringFromCollection:(id<SCCollection>)collection;
399 - (SCStrings *)stringsWithoutSubstring:(NSString *)substring;
400 - (SCStrings *)stringsWithoutSubstrings:(SCStrings *)substrings;
401 - (SCStrings *)stringsWithoutSubstringsFromCollection:(id<SCCollection>)collection;
402 
403 - (SCULong)countOfString:(NSString *)string;
404 - (SCULong)countOfSubstring:(NSString *)substring;
405 - (SCULong)countOfStringsWithSubstring:(NSString *)substring;
406 
407 @end
NSString * description
Definition: SCStrings.h:121
SCIndex count
Definition: SCStrings.h:109
uint64_t SCULong
Definition: SCTypes.h:82
BOOL caseInsensitive
Definition: SCStrings.h:97
SCStrings * reversedStrings
Definition: SCStrings.h:201
NSEnumerator * stringEnumerator
Definition: SCStrings.h:148
NSString * name
Definition: SCStrings.h:85
NSArray * foundationArray
Definition: SCStrings.h:171
Класс списка строк
Definition: SCStrings.h:67
NSString * firstString
Definition: SCStrings.h:212
Общий предок всех остальных классов библиотеки
Definition: SCObject.h:53
Класс абстрактного алгоритма сортировки данных
Definition: SCSorter.h:130
SCStrings * sortedStrings
Definition: SCStrings.h:182
NSString * lastString
Definition: SCStrings.h:218
Класс обработчика событий список строк, текстов и текстовых файлов
Definition: SCTextDelegate.h:710
SCArray * array
Definition: SCStrings.h:165
NSEnumerator * reverseStringEnumerator
Definition: SCStrings.h:154
NSUInteger SCIndex
Definition: SCTypes.h:238
id< SCTextDelegate > delegate
Definition: SCStrings.h:103
SCIndex indexOfLastString
Definition: SCStrings.h:229
Абстрактный класс механизма коллекций библиотеки
Definition: SCCollection.h:94
BOOL empty
Definition: SCStrings.h:115
BOOL readOnly
Definition: SCStrings.h:91
Класс массивов объектов
Definition: SCArray.h:75
BOOL modified
Definition: SCStrings.h:127
Абстрактный класс потоков библиотеки
Definition: SCStream.h:242