21 #import <scl/SCObject.h>
22 #import <scl/SCArray.h>
23 #import <scl/SCTextDelegateProtocol.h>
26 #pragma mark Константы класса
31 #define SCStringsClass @"SCStrings"
68 BOOL fCaseInsensitive;
69 id<SCTextDelegate> fDelegate;
73 #pragma mark Свойства экземпляра класса
83 @property (nonatomic, retain, getter=
name, setter=setName:) NSString *name;
89 @property (nonatomic, assign, getter=
readOnly, setter=setReadOnly:) BOOL readOnly;
95 @property (nonatomic, assign, getter=
caseInsensitive, setter=setCaseInsensitive:) BOOL caseInsensitive;
101 @property (nonatomic, retain, getter=
delegate, setter=setDelegate:) id<SCTextDelegate> delegate;
113 @property (nonatomic, assign, readonly, getter=
empty) BOOL empty;
119 @property (nonatomic, retain, readonly, getter=
description) NSString *description;
125 @property (nonatomic, assign, readonly, getter=
modified) BOOL modified;
146 @property (nonatomic, retain, readonly, getter=
stringEnumerator) NSEnumerator *stringEnumerator;
169 @property (nonatomic, retain, readonly, getter=
foundationArray) NSArray *foundationArray;
210 @property (nonatomic, retain, readonly, getter=
firstString) NSString *firstString;
216 @property (nonatomic, retain, readonly, getter=
lastString) NSString *lastString;
232 #pragma mark Свойства экземпляра класса
235 - (BOOL)caseInsensitive;
239 - (NSString *)description;
242 - (void)setName:(NSString *)name;
243 - (void)setReadOnly:(BOOL)readOnly;
244 - (void)setCaseInsensitive:(BOOL)caseInsensitive;
248 #pragma mark Создание списков строк
249 + (
SCStrings *)stringsWithCoder:(NSCoder *)coder;
250 + (
SCStrings *)stringsWithContentsOfSerializedFile:(NSString *)path;
251 + (
SCStrings *)stringsWithDataDictionary:(NSDictionary *)dictionary;
252 + (
SCStrings *)stringsWithDataDictionaryFromFile:(NSString *)path;
254 + (
SCStrings *)stringsWithFileStream:(NSString *)path;
256 + (
SCStrings *)stringsWithName:(NSString *)name;
257 + (
SCStrings *)stringsWithString:(NSString *)string;
258 + (
SCStrings *)stringsWithCollection:(
id)collection;
263 #pragma mark Инициализация списков строк
264 - (id)initWithName:(NSString *)name;
265 - (id)initWithString:(NSString *)string;
266 - (id)initWithCollection:(
id)collection;
267 - (id)initWithStrings:(
SCStrings *)strings;
271 #pragma mark Копирование списков строк
273 - (void)setCollection:(
id)collection;
274 - (void)setString:(NSString *)string;
277 #pragma mark Сравнение списков строк
278 - (BOOL)isEqualToStrings:(
SCStrings *)strings;
279 - (BOOL)isEqualToCollection:(
id)collection;
280 - (BOOL)isEqualTo:(
id)object;
281 - (BOOL)isEqual:(
id)object;
284 #pragma mark Счетчики строк
285 - (NSEnumerator *)stringEnumerator;
286 - (NSEnumerator *)reverseStringEnumerator;
289 - (void)reverseEnumerateWithDelegate:(
id<
SCTextDelegate>)delegate;
290 - (void)reverseEnumerate;
293 #pragma mark Преобразование списков строк
295 - (NSArray *)foundationArray;
298 #pragma mark Сортировка списков строк
299 - (void)sortAscendingWithSorter:(
id<
SCSorter>)sorter;
300 - (void)sortDescendingWithSorter:(
id<
SCSorter>)sorter;
301 - (void)sortWithSorter:(
id<
SCSorter>)sorter;
302 - (void)sortAscending;
303 - (void)sortDescending;
313 #pragma mark Добавление строк
314 - (void)addString:(NSString *)string;
315 - (void)addCollection:(
id)collection;
319 - (void)insertString:(NSString *)string atIndex:(
SCIndex)index;
321 - (void)insertCollection:(
id)collection atIndex:(
SCIndex)index;
322 - (void)insertStrings:(
SCStrings *)strings atIndexes:(NSIndexSet *)indexes;
323 - (void)insertCollection:(
id)collection atIndexes:(NSIndexSet *)indexes;
324 - (void)insertLineAtIndex:(
SCIndex)index;
327 #pragma mark Удаление строк
328 - (void)removeAllStrings;
329 - (void)removeFirstString;
330 - (void)removeLastString;
331 - (void)removeStringAtIndex:(
SCIndex)index;
332 - (void)removeStringsAtIndexes:(NSIndexSet *)indexes;
333 - (void)removeString:(NSString *)string;
334 - (void)removeStrings:(
SCStrings *)strings;
335 - (void)removeCollection:(
id)collection;
336 - (void)removeStringsWithSubstring:(NSString *)substring;
337 - (void)removeStringsNotAtIndexes:(NSIndexSet *)indexes;
338 - (void)removeStringsNotEqualTo:(NSString *)string;
339 - (void)removeStringsNotInStrings:(
SCStrings *)strings;
340 - (void)removeStringsNotInCollection:(
id)collection;
341 - (void)removeStringsWithoutSubstring:(NSString *)substring;
342 - (void)removeDuplicatedStrings;
345 #pragma mark Замена строк
346 - (void)replaceStringAtIndex:(
SCIndex)index withString:(NSString *)string;
347 - (void)replaceStringsAtIndexes:(NSIndexSet *)indexes withStrings:(
SCStrings *)strings;
348 - (void)replaceStringsAtIndexes:(NSIndexSet *)indexes withCollection:(
id)collection;
349 - (void)replaceString:(NSString *)string withString:(NSString *)newString;
352 #pragma mark Копирование и перемещение строк
353 - (void)exchangeStringAtIndex:(
SCIndex)index withStringAtIndex:(
SCIndex)destination;
354 - (void)duplicateStringAtIndex:(
SCIndex)index;
355 - (void)duplicateAllStrings;
357 - (void)copyStringAtIndex:(
SCIndex)index toIndex:(
SCIndex)destination;
358 - (void)moveStringAtIndex:(
SCIndex)index toIndex:(
SCIndex)destination;
359 - (void)forwardMoveStringAtIndex:(
SCIndex)index steps:(
SCULong)steps;
360 - (void)forwardMoveStringAtIndex:(
SCIndex)index;
361 - (void)backwardMoveStringAtIndex:(
SCIndex)index steps:(
SCULong)steps;
362 - (void)backwardMoveStringAtIndex:(
SCIndex)index;
363 - (void)moveToFirstPositionStringAtIndex:(
SCIndex)index;
364 - (void)moveToLastPositionStringAtIndex:(
SCIndex)index;
369 #pragma mark Доступ к строкам
370 - (NSString *)firstString;
371 - (NSString *)lastString;
372 - (NSString *)stringAtIndex:(
SCIndex)index;
373 - (
SCStrings *)stringsAtIndexes:(NSIndexSet *)indexes;
376 #pragma mark Поиск строк
377 - (BOOL)containsString:(NSString *)string;
378 - (BOOL)containsStrings:(
SCStrings *)strings;
379 - (BOOL)containsCollection:(
id)collection;
380 - (BOOL)containsAnyString:(
SCStrings *)strings;
381 - (BOOL)containsAnyStringFromCollection:(
id)collection;
382 - (BOOL)containsSubstring:(NSString *)substring;
383 - (BOOL)containsSubstrings:(
SCStrings *)substrings;
384 - (BOOL)containsSubstringsFromCollection:(
id)collection;
385 - (BOOL)containsAnySubstring:(
SCStrings *)substrings;
386 - (BOOL)containsAnySubstringFromCollection:(
id)collection;
387 - (BOOL)containsDuplicatedStrings;
389 - (
SCIndex)indexOfString:(NSString *)string;
391 - (
SCIndex)indexOfSubstring:(NSString *)substring;
393 - (
SCStrings *)stringsWithSubstring:(NSString *)substring;
395 - (
SCStrings *)stringsWithSubstringsFromCollection:(
id)collection;
397 - (
SCStrings *)stringsWithAnySubstringFromCollection:(
id)collection;
398 - (
SCStrings *)stringsWithoutSubstring:(NSString *)substring;
400 - (
SCStrings *)stringsWithoutSubstringsFromCollection:(
id)collection;
402 - (
SCULong)countOfString:(NSString *)string;
403 - (
SCULong)countOfSubstring:(NSString *)substring;
404 - (
SCULong)countOfStringsWithSubstring:(NSString *)substring;
NSString * description
Definition: SCStrings.h:119
uint64_t SCULong
Definition: SCTypes.h:78
SCULong SCIndex
Index data type.
Definition: SCTypes.h:240
BOOL caseInsensitive
Definition: SCStrings.h:95
SCStrings * reversedStrings
Definition: SCStrings.h:199
NSEnumerator * stringEnumerator
Definition: SCStrings.h:146
NSString * name
Definition: SCStrings.h:83
NSArray * foundationArray
Definition: SCStrings.h:169
Strings list class.
Definition: SCStrings.h:65
NSString * firstString
Definition: SCStrings.h:210
Parent class of all library classes.
Definition: SCObject.h:57
Abstract implementation of the protocol SCSorter.
Definition: SCSorter.h:37
SCStrings * sortedStrings
Definition: SCStrings.h:180
NSString * lastString
Definition: SCStrings.h:216
Text object event handlers class.
Definition: SCTextDelegate.h:45
SCArray * array
Definition: SCStrings.h:163
NSEnumerator * reverseStringEnumerator
Definition: SCStrings.h:152
SCIndex indexOfLastString
Definition: SCStrings.h:227
BOOL empty
Definition: SCStrings.h:113
id< SCTextDelegate > delegate
Definition: SCStrings.h:101
SCULong count
Definition: SCStrings.h:107
BOOL readOnly
Definition: SCStrings.h:89
Array class.
Definition: SCArray.h:77
BOOL modified
Definition: SCStrings.h:125
Abstract parent class of the stream classes hierarchy.
Definition: SCStream.h:242