Samond Classes Library 1.2.2-RELEASE build 188
SCText.h
Go to the documentation of this file.
1 //
2 // SCText.h
3 // scl
4 //
5 // Created by Viacheslav Smolensky on 06.02.13.
6 // Copyright (c) 2007 - 2017 by Samond Development Corporation. All rights reserved.
7 //
8 
22 #import <scl/SCStrings.h>
23 #import <scl/SCUniqueStrings.h>
24 #import <scl/SCTextIndex.h>
25 
26 #pragma mark -
27 #pragma mark Class Contants
28 
37 #define SCTextClass @"SCText"
38 
39 
76 @interface SCText : SCStrings
77 
97 @property (nonatomic, readonly, assign) SCStrings *strings;
98 
103 @property (nonatomic, readonly, assign) SCUniqueStrings *uniqueStrings;
104 
107 #pragma mark -
108 #pragma mark Creating Texts
109 + (instancetype)textWithCoder:(NSCoder *)coder;
110 + (instancetype)textWithContentsOfSerializedFile:(NSString *)path;
111 + (instancetype)textWithDataDictionary:(NSDictionary *)dictionary;
112 + (instancetype)textWithDataDictionaryFromFile:(NSString *)path;
113 + (instancetype)textWithStream:(SCStream *)stream;
114 + (instancetype)textWithFileStream:(NSString *)path;
115 
116 + (instancetype)textWithName:(NSString *)name;
117 + (instancetype)textWithString:(NSString *)string;
118 + (instancetype)textWithStrings:(SCStrings *)strings;
119 + (instancetype)textWithCollection:(id<SCCollection>)collection;
120 + (instancetype)textWithText:(SCText *)text;
121 + (instancetype)text;
122 
123 #pragma mark -
124 #pragma mark Initializing Texts
125 - (instancetype)initWithText:(SCText *)text;
126 
127 #pragma mark -
128 #pragma mark Copying Texts
129 - (void)setText:(SCText *)text;
130 
131 #pragma mark -
132 #pragma mark Comparing Texts
133 - (BOOL)isEqualToText:(SCText *)text;
134 
135 #pragma mark -
136 #pragma mark Adding Text
137 - (void)addText:(SCStrings *)text;
138 - (void)insertText:(SCStrings *)text atIndex:(SCIndex)index;
139 
140 #pragma mark -
141 #pragma mark Removing Text
142 - (void)removeAllText;
143 - (void)removeTextInRange:(NSRange)range;
144 - (void)removeTextWithSubstring:(NSString *)substring;
145 - (void)removeTextWithoutSubstring:(NSString *)substring;
146 - (void)removeSubstring:(NSString *)substring;
147 - (SCText *)cutTextInRange:(NSRange)range;
148 - (void)removeText:(SCStrings *)text;
149 
150 #pragma mark -
151 #pragma mark Replacing Text
152 - (void)replaceTextInRange:(NSRange)range withText:(SCStrings *)text;
153 - (void)replaceTextInRange:(NSRange)range withCollection:(id<SCCollection>)collection;
154 - (void)replaceText:(SCStrings *)oldText withText:(SCStrings *)newText;
155 
156 #pragma mark -
157 #pragma mark Copying and Moving Text
158 - (void)exchangeTextInRange:(NSRange)source withTextInRange:(NSRange)destination;
159 - (void)duplicateTextInRange:(NSRange)range;
160 - (void)duplicateStringsInRange:(NSRange)range;
161 - (void)copyTextInRange:(NSRange)range toIndex:(SCIndex)destination;
162 - (void)moveTextInRange:(NSRange)range toIndex:(SCIndex)destination;
163 - (void)forwardMoveTextInRange:(NSRange)range steps:(SCIndex)steps;
164 - (void)forwardMoveTextInRange:(NSRange)range;
165 - (void)backwardMoveTextInRange:(NSRange)range steps:(SCIndex)steps;
166 - (void)backwardMoveTextInRange:(NSRange)range;
167 - (void)moveToFirstPositionTextInRange:(NSRange)range;
168 - (void)moveToLastPositionTextInRange:(NSRange)range;
169 
170 #pragma mark -
171 #pragma mark Querying a Text
172 - (SCText *)textInRange:(NSRange)range;
173 
174 #pragma mark -
175 #pragma mark Finding and Selecting Text
176 - (BOOL)containsText:(SCStrings *)text;
177 - (NSRange)rangeOfText:(SCStrings *)text;
178 - (NSRange)rangeOfCollection:(id<SCCollection>)collection;
179 - (SCIndex)indexOfText:(SCStrings *)text;
180 - (SCIndex)indexOfCollection:(id<SCCollection>)collection;
181 - (SCUInteger)countOfText:(SCStrings *)text;
182 - (SCUInteger)countOfCollection:(id<SCCollection>)collection;
183 - (SCArray *)indexesOfText:(SCStrings *)text;
184 - (SCArray *)indexesOfCollection:(id<SCCollection>)collection;
185 - (SCText *)textWithSubstring:(NSString *)substring;
186 - (SCText *)textWithoutSubstring:(NSString *)substring;
187 - (SCTextIndex *)textIndexOfSubstring:(NSString *)substring;
188 - (SCArray *)textIndexesOfSubstring:(NSString *)substring;
189 
190 @end
Text class.
Definition: SCText.h:76
Class SCTextIndex header file.
void removeAllText()
Definition: SCText.m:409
uint32_t SCUInteger
Definition: SCTypes.h:76
Unique strings list class.
Definition: SCUniqueStrings.h:76
Strings list class.
Definition: SCStrings.h:73
instancetype strings()
Definition: SCStrings.m:611
Class SCStrings header file.
Text index class.
Definition: SCTextIndex.h:53
Class SCUniqueStrings header file.
SCUniqueStrings * uniqueStrings
Definition: SCText.h:103
Abstract collections class.
Definition: SCCollection.h:101
Array class.
Definition: SCArray.h:81
NSUInteger SCIndex
Definition: SCCollectionProtocols.h:50
Abstract parent class of the stream classes hierarchy.
Definition: SCStream.h:226