Text class.
More...
#import <SCText.h>
Text class.
- 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
-
text | - existing source text |
- Exceptions
-
- (void) backwardMoveTextInRange: |
|
(NSRange) |
range |
|
Moves the text in the specified range to an one position to the bottom of the receiving text.
- Parameters
-
- Exceptions
-
Moves the text in the specified range to a given number of positions to the bottom of the receiving text.
- Parameters
-
range | - moved text range |
steps | - count of lines for text moving |
- Exceptions
-
Returns a boolean value that indicates whether a given text is present in the receiving text.
- Parameters
-
- 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 | - range of the copied text |
destination | - 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 | - collection with the desired strings |
- Returns
- Count of occurrences
Returns the count of occurrences of the specified text into the receiving text.
- Parameters
-
- Returns
- Count of occurrences
- (SCText *) cutTextInRange: |
|
(NSRange) |
range |
|
Returns the text in the specified range and removes this text from the receiving text.
- Parameters
-
- Returns
- Text with the required strings
- Exceptions
-
- (void) duplicateStringsInRange: |
|
(NSRange) |
range |
|
Duplicates the strings in the specified range.
- Parameters
-
range | - range of the duplicated strings |
- Exceptions
-
- (void) duplicateTextInRange: |
|
(NSRange) |
range |
|
Duplicates the text with the specified text range.
- Parameters
-
range | - duplicated text range |
- Exceptions
-
- (void) exchangeTextInRange: |
|
(NSRange) |
source |
withTextInRange: |
|
(NSRange) |
destination |
|
|
| |
Swaps the specified text ranges.
- Parameters
-
source | - range of the first swapped text |
destination | - 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
-
- Exceptions
-
Moves the text in the specified range to a given number of positions to the top of the receiving text.
- Parameters
-
range | - moved text range |
steps | - count of lines for text moving |
- Exceptions
-
- (SCArray *) indexesOfCollection: |
|
(id) |
collection |
|
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 | - collection with the desired strings |
- Returns
- Array with the indexes
- Exceptions
-
Returns an array with the indexes of all occurrences of the specified text into the receiving text.
- Parameters
-
- Returns
- Array with the indexes
- (SCIndex) indexOfCollection: |
|
(id) |
collection |
|
Returns the index of the first occurrecne of the strings from the specified collection of any supported type into the receiving text.
- Parameters
-
collection | - collection of desired strings |
- Returns
- 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
- Index of the first occurrence the desired text, otherwise SCNotFound
- (id) initWithText: |
|
(SCText *) |
text |
|
Initializes a text using the specified existing text.
- Parameters
-
text | - existing source text |
- Returns
- A newly initialized text
- Exceptions
-
Inserts the strings from a given text into the receiving text at the specified index.
- Parameters
-
text | - source text |
index | - 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 | - 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 | - range of the moved text |
destination | - destination index |
- Exceptions
-
- (void) moveToFirstPositionTextInRange: |
|
(NSRange) |
range |
|
Moves the text in the specified range to the first position within the receiving text.
- Parameters
-
- Exceptions
-
- (void) moveToLastPositionTextInRange: |
|
(NSRange) |
range |
|
Moves the text in the specified range to the last position within the receiving text.
- Parameters
-
- Exceptions
-
- (NSRange) rangeOfCollection: |
|
(id) |
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 | - collection with desired strings |
- Returns
- 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
- 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 | - removing substring |
- Exceptions
-
Removes all occurrences in the reciving text of the specified text.
- Parameters
-
- Exceptions
-
- (void) removeTextInRange: |
|
(NSRange) |
range |
|
Removes strings in the specified range from the receiving text.
- Parameters
-
range | - range of deleted 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 | - keeping substring |
- Exceptions
-
- (void) removeTextWithSubstring: |
|
(NSString *) |
substring |
|
Removes all occurrences in the receiving text of the strings that contain the specified substring.
- Parameters
-
substring | - removing substring |
- Exceptions
-
Replaces all occurrences of the specified text within the receiving text with a given text.
- Parameters
-
oldText | - replaced text |
newText | - replacement text |
- Exceptions
-
- (void) replaceTextInRange: |
|
(NSRange) |
range |
withCollection: |
|
(id) |
collection |
|
|
| |
Replaces the text in the specified range with the strings from a given existing collection of any supported type.
- Parameters
-
range | - range of replaced text |
collection | - 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 | - range of the replaced text |
text | - 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
-
text | - existing source text |
- Exceptions
-
Returns an empty unnamed text created by using the default settings.
- Returns
- A created text
- (SCArray *) textIndexesOfSubstring: |
|
(NSString *) |
substring |
|
Returns an array with text indexes of the all occurrences of the specified substring.
- Parameters
-
substring | - desired substring |
- Returns
- Text indexes array
- (SCTextIndex *) textIndexOfSubstring: |
|
(NSString *) |
substring |
|
Returns a text index of the first occurrence of the specified substring.
- Parameters
-
substring | - desired substring |
- Returns
- 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
-
- Returns
- Text with the requited strings
- Exceptions
-
+ (SCText *) textWithCoder: |
|
(NSCoder *) |
coder |
|
Returns a text created by using the specified coder.
- Parameters
-
- Returns
- A created text
+ (SCText *) textWithCollection: |
|
(id) |
collection |
|
Returns a text created by using the strings from the specified existing collection of any supported type.
- Parameters
-
collection | - existing source collection |
- Returns
- A created text
- Exceptions
-
+ (SCText *) textWithContentsOfSerializedFile: |
|
(NSString *) |
path |
|
Returns a text created by using the content of serialized file with the specified path.
- Parameters
-
path | - source serialized file path |
- Returns
- A created text
+ (SCText *) textWithDataDictionary: |
|
(NSDictionary *) |
dictionary |
|
Returns a text created by using the specified data dictionary.
- Parameters
-
dictionary | - source data dictionary |
- Returns
- A created text
+ (SCText *) textWithDataDictionaryFromFile: |
|
(NSString *) |
path |
|
Returns a text created by using the data dictionary from the specified file.
- Parameters
-
path | - source data dictionary file path |
- Returns
- A created text
+ (SCText *) textWithFileStream: |
|
(NSString *) |
path |
|
Returns a text created by using the data from the file stream with the specified path.
- Parameters
-
path | - source file stream path |
- Returns
- A created text
- Exceptions
-
+ (SCText *) textWithName: |
|
(NSString *) |
name |
|
Returns a text created by using the specified text name.
- Parameters
-
- 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 | - removed substring |
- Returns
- Text without the selected strings
Returns a text created by using the data from the specified stream.
- Parameters
-
- Returns
- A created text
- Exceptions
-
+ (SCText *) textWithString: |
|
(NSString *) |
string |
|
Returns a text created by using the specified existing source string.
- Parameters
-
string | - existing source string |
- Returns
- A created text
- Exceptions
-
Returns a text created by using the strings from the specified existing strings list.
- Parameters
-
strings | - existing 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 | - required substring |
- Returns
- Text with selected strings
Returns a text created by using the existing text.
- Parameters
-
text | - existing source text |
- 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: