Text class.
More...
#import <SCText.h>
Text class.
- SDK
- macOS 10.6+, iOS 7.0+, GNUstep
- Since
- version 1.1.4
Extends the parent class SCString by adding methods for text blocks operations and text processing methods.
Class instances can thrown the following exceptions:
Adds into the receiving text the strings from the specified existing text.
- Parameters
-
- Exceptions
-
- (void) backwardMoveTextInRange: |
|
(NSRange) |
range |
|
Moves the text in the specified range to an one position to the bottom of the receiving text.
- Parameters
-
range | - the range of the moving text |
- Exceptions
-
Moves the text in the specified range to a given number of positions to the bottom of the receiving text.
- Parameters
-
range | - the range of the moving text |
steps | - the numbr of lines for text moving |
- Exceptions
-
Returns a boolean value that indicates whether a given text is present in the receiving text.
- Parameters
-
text | - еру desired text |
- Returns
- YES if a given text is present in the receiving text, otherwise NO
- (void) copyTextInRange: |
|
(NSRange) |
range |
toIndex: |
|
(SCIndex) |
destination |
|
|
| |
Copies the text in the specified range to a given index.
- Parameters
-
range | - the range of the copying text |
destination | - the destination index |
- Exceptions
-
Returns the count of occurrences of the strings from the specified collection of any supported type into the receiving text.
- Parameters
-
collection | - the collection with the desired strings |
- Returns
- A number of occurrences
Returns the count of occurrences of the specified text into the receiving text.
- Parameters
-
- Returns
- A number of occurrences
- (SCText *) cutTextInRange: |
|
(NSRange) |
range |
|
Returns the text in the specified range and removes this text from the receiving text.
- Parameters
-
- Returns
- A text with the required strings
- Exceptions
-
- (void) duplicateStringsInRange: |
|
(NSRange) |
range |
|
Duplicates the strings in the specified range.
- Parameters
-
range | - the range of the duplicating strings |
- Exceptions
-
- (void) duplicateTextInRange: |
|
(NSRange) |
range |
|
Duplicates the text with the specified text range.
- Parameters
-
range | - the range of the duplicating text |
- Exceptions
-
- (void) exchangeTextInRange: |
|
(NSRange) |
source |
withTextInRange: |
|
(NSRange) |
destination |
|
|
| |
Swaps the specified text ranges.
- Parameters
-
source | - the range of the first swapped text |
destination | - the range of the seconf swapped text |
- Exceptions
-
- (void) forwardMoveTextInRange: |
|
(NSRange) |
range |
|
Moves the text in the specified range to an one position to the top of the receiving text.
- Parameters
-
range | - the range of the moving text |
- Exceptions
-
Moves the text in the specified range to a given number of positions to the top of the receiving text.
- Parameters
-
range | - the range of the moving text |
steps | - the number of lines for text moving |
- Exceptions
-
Returns an array with the indexes of all occurrences of the strings within the specified collection of any supported type into the receiving text.
- Parameters
-
collection | - the collection with the desired strings |
- Returns
- An array with the indexes
- Exceptions
-
Returns an array with the indexes of all occurrences of the specified text into the receiving text.
- Parameters
-
- Returns
- An array with the indexes
Returns the index of the first occurrecne of the strings from the specified collection of any supported type into the receiving text.
- Parameters
-
collection | - the collection of desired strings |
- Returns
- An index of the first occurrence the desired strings, otherwise SCNotFound
Returns the index of the first occurrence of the specified text into the receiving text.
- Parameters
-
- Returns
- An index of the first occurrence the desired text, otherwise SCNotFound
- (instancetype) initWithText: |
|
(SCText *) |
text |
|
Initializes a text using the specified existing text.
- Parameters
-
- Returns
- A newly initialized text
- Exceptions
-
Inserts the strings from a given text into the receiving text at the specified index.
- Parameters
-
text | - the source text |
index | - the index at which to insert strings |
- Exceptions
-
- (BOOL) isEqualToText: |
|
(SCText *) |
text |
|
Returns a boolean value that indicates whether the content of the receiving text is equal to the content of another given text.
- Parameters
-
text | - the text with which to compare the receiving text |
- Returns
- YES if the content of other text is equals to content of the receiving text, otherwise NO
- (void) moveTextInRange: |
|
(NSRange) |
range |
toIndex: |
|
(SCIndex) |
destination |
|
|
| |
Moves the text in the specified range to a given index.
- Parameters
-
range | - the range of the moving text |
destination | - the destination index |
- Exceptions
-
- (void) moveToFirstPositionTextInRange: |
|
(NSRange) |
range |
|
Moves the text in the specified range to the first position within the receiving text.
- Parameters
-
range | - the range of the moving text |
- Exceptions
-
- (void) moveToLastPositionTextInRange: |
|
(NSRange) |
range |
|
Moves the text in the specified range to the last position within the receiving text.
- Parameters
-
range | - the range of the moving text |
- Exceptions
-
- (NSRange) rangeOfCollection: |
|
(id<SCCollection>) |
collection |
|
Returns the lowest range whose corresponding receiving text strings range is equal to a strings from a given collection of any supported type.
- Parameters
-
collection | - the collection with desired strings |
- Returns
- A range of strings that equalt to the desired strings, otherwise empty range (0, 0)
Returns the lowest range whose corresponding receiving text strings range is equal to a given text.
- Parameters
-
- Returns
- A range of strings that equals to the specified text, otherwise empty range (0, 0)
Removes all strings from the receiving text.
- Exceptions
-
- (void) removeSubstring: |
|
(NSString *) |
substring |
|
Removes all occurrences in the receiving text of the specified substring.
- Parameters
-
substring | - the substring to be removed from the receiving text |
- Exceptions
-
Removes all occurrences in the reciving text of the specified text.
- Parameters
-
text | - the text to be removing from the receiving text |
- Exceptions
-
- (void) removeTextInRange: |
|
(NSRange) |
range |
|
Removes strings in the specified range from the receiving text.
- Parameters
-
range | - the range of deleting strings |
- Exceptions
-
- (void) removeTextWithoutSubstring: |
|
(NSString *) |
substring |
|
Removes all occurrences in the receiving text of the strings that does not contain the specified substring.
- Parameters
-
substring | - the substring to be keeping within the receiving text |
- Exceptions
-
- (void) removeTextWithSubstring: |
|
(NSString *) |
substring |
|
Removes all occurrences in the receiving text of the strings that contain the specified substring.
- Parameters
-
substring | - the substring to be removed from the receiving text |
- Exceptions
-
Replaces all occurrences of the specified text within the receiving text with a given text.
- Parameters
-
oldText | - the text to be replacing within the receiving text |
newText | - the replacement text |
- Exceptions
-
- (void) replaceTextInRange: |
|
(NSRange) |
range |
withCollection: |
|
(id<SCCollection>) |
collection |
|
|
| |
Replaces the text in the specified range with the strings from a given existing collection of any supported type.
- Parameters
-
range | - the range of replacing text |
collection | - the collection with the replacement strings |
- Exceptions
-
- (void) replaceTextInRange: |
|
(NSRange) |
range |
withText: |
|
(SCStrings *) |
text |
|
|
| |
Replaces the text in the specified range with the specified new text.
- Parameters
-
range | - the range of the replacing text |
text | - the replacement text |
- Exceptions
-
- (void) setText: |
|
(SCText *) |
text |
|
Replaces the content and settings of the receiving text by using the content and settings of the specified existing text.
- Parameters
-
- Exceptions
-
Returns an empty unnamed text created by using the default settings.
- Returns
- A created text
- (instancetype) textByAddingArray: |
|
(SCArray *) |
array |
|
Returns the new text that contains strings from the receiving text and a given array.
- Parameters
-
array | - the array of strings to add to the new text |
- Returns
- A new text with strings from the receiving text and a specified array
- Exceptions
-
- Since
- version 1.2.3
- See also
- - textByAddingStringsFromArray:
- (instancetype) textByAddingCollection: |
|
(id<SCCollection>) |
collection |
|
Returns the new text that contains strings from the receiving text and a given collection of any supported type.
- Parameters
-
collection | - the collection of strings to add to the new text |
- Returns
- A new text with strings from the receiving text and a specified collection
- Exceptions
-
- Since
- version 1.2.3
- (instancetype) textByAddingString: |
|
(NSString *) |
string |
|
Returns the new text that contains strings from the receiving text and a given string.
- Parameters
-
string | - the string to add to the new text |
- Returns
- A new text with strings from the receiving text and a specified string
- Exceptions
-
- Since
- version 1.2.3
- (instancetype) textByAddingStrings: |
|
(SCStrings *) |
strings |
|
Returns the new text that contains strings from the receiving text and a given strings list.
- Parameters
-
strings | - the list of strings to add to the new text |
- Returns
- A new text with strings from the receiving text and a specified list
- Exceptions
-
- Since
- version 1.2.3
- (instancetype) textByAddingStringsFromArray: |
|
(SCArray *) |
array |
|
Returns the new text that contains strings from the receiving text and a given array.
- Parameters
-
array | - the array of strings to add to the new text |
- Returns
- A new text with strings from the receiving text and a specified array
- Exceptions
-
- Since
- version 1.2.3
- See also
- - textByAddingArray:
- (instancetype) textByAddingText: |
|
(SCText *) |
text |
|
Returns the new text that contains strings from the receiving text and a given another text.
- Parameters
-
text | - the text to add to the new text |
- Returns
- A new text with strings from the receiving text and a given another text
- Exceptions
-
- Since
- version 1.2.3
- (SCArray *) textIndexesOfSubstring: |
|
(NSString *) |
substring |
|
Returns an array with text indexes of the all occurrences of the specified substring.
- Parameters
-
substring | - the desired substring |
- Returns
- An array with text indexes
- (SCTextIndex *) textIndexOfSubstring: |
|
(NSString *) |
substring |
|
Returns a text index of the first occurrence of the specified substring.
- Parameters
-
substring | - the desired substring |
- Returns
- A text index of the first occurrence or nil pointer if the specified substing does not exists
- (SCText *) textInRange: |
|
(NSRange) |
range |
|
Returns a text containing the strings from the receiving text in the specified range.
- Parameters
-
range | - the range of the text |
- Returns
- A text with the requited strings
- Exceptions
-
+ (instancetype) textWithArray: |
|
(SCArray *) |
array |
|
Returns a text created by using strings from a given array.
- Parameters
-
array | - an array with strings to add to the new text |
- Returns
- A created text
- Exceptions
-
- Since
- version 1.2.3
+ (instancetype) textWithCoder: |
|
(NSCoder *) |
coder |
|
Returns a text created by using the specified coder.
- Parameters
-
- Returns
- A created text
+ (instancetype) textWithCollection: |
|
(id<SCCollection>) |
collection |
|
Returns a text created by using the strings from the specified existing collection of any supported type.
- Parameters
-
collection | - the source collection |
- Returns
- A created text
- Exceptions
-
+ (instancetype) textWithContentsOfFile: |
|
(NSString *) |
path |
|
Returns a text created by using the file with the specified path.
- Parameters
-
path | - the path to the source file |
- Returns
- A created text
+ (instancetype) textWithContentsOfSerializedFile: |
|
(NSString *) |
path |
|
Returns a text created by using the content of serialized file with the specified path.
- Parameters
-
path | - the path to the source serialized file |
- Returns
- A created text
+ (instancetype) textWithContentsOfURL: |
|
(NSURL *) |
url |
|
Returns a text created by using the specified URL.
- Parameters
-
- Returns
- A created text
+ (instancetype) textWithContentsOfURLString: |
|
(NSString *) |
urlString |
|
Returns a text created by using the data from the URL with the specified string.
- Parameters
-
urlString | - the string of the source URL |
- Returns
- A created text
+ (instancetype) textWithData: |
|
(NSData *) |
data |
|
Returns a text created by using the specified data object.
- Parameters
-
data | - the source data object |
- Returns
- A created text
+ (instancetype) textWithDataDictionary: |
|
(NSDictionary *) |
dictionary |
|
Returns a text created by using the specified data dictionary.
- Parameters
-
dictionary | - the source data dictionary |
- Returns
- A created text
+ (instancetype) textWithDataDictionaryFromFile: |
|
(NSString *) |
path |
|
Returns a text created by using the data dictionary from the specified file.
- Parameters
-
path | - the path to the source data dictionary file |
- Returns
- A created text
+ (instancetype) textWithFileStream: |
|
(NSString *) |
path |
|
Returns a text created by using the data from the file stream with the specified path.
- Parameters
-
path | - the path to the source file stream |
- Returns
- A created text
- Exceptions
-
+ (instancetype) textWithName: |
|
(NSString *) |
name |
|
Returns a text created by using the specified text name.
- Parameters
-
name | - the name of the text |
- Returns
- A created text
- (SCText *) textWithoutSubstring: |
|
(NSString *) |
substring |
|
Returns a text with the strings from the receiving text that does not contain the specified substring.
- Parameters
-
substring | - the substring to be removing |
- Returns
- A text without the selected strings
+ (instancetype) textWithStream: |
|
(SCStream *) |
stream |
|
Returns a text created by using the data from the specified stream.
- Parameters
-
stream | - the source stream |
- Returns
- A created text
- Exceptions
-
+ (instancetype) textWithString: |
|
(NSString *) |
string |
|
Returns a text created by using the specified existing source string.
- Parameters
-
string | - the source string |
- Returns
- A created text
- Exceptions
-
+ (instancetype) textWithStrings: |
|
(SCStrings *) |
strings |
|
Returns a text created by using the strings from the specified existing strings list.
- Parameters
-
strings | - the source strings list |
- Returns
- A created text
- Exceptions
-
- (SCText *) textWithSubstring: |
|
(NSString *) |
substring |
|
Returns a text with the strings from the receiving text that contain the specified substring.
- Parameters
-
substring | - rthe equired substring |
- Returns
- A text with selected strings
+ (instancetype) textWithText: |
|
(SCText *) |
text |
|
Returns a text created by using the existing text.
- Parameters
-
- Returns
- A created text
- Exceptions
-
Returns the strings list with the copy of all strings within the receiving text
Returns the unique strings list with the copy of all strings within the receiving text
The documentation for this class was generated from the following files: