Samond Classes Library 1.2.6-STABLE build 219
List of all members
SCText Class Reference

Text class. More...

#import <SCText.h>

+ Inheritance diagram for SCText:

Creating Texts

(instancetype) + textWithCoder:
 
(instancetype) + textWithContentsOfSerializedFile:
 
(instancetype) + textWithDataDictionary:
 
(instancetype) + textWithDataDictionaryFromFile:
 
(instancetype) + textWithStream:
 
(instancetype) + textWithFileStream:
 
(instancetype) + textWithData:
 
(instancetype) + textWithContentsOfFile:
 
(instancetype) + textWithContentsOfURL:
 
(instancetype) + textWithContentsOfURLString:
 
(instancetype) + textWithName:
 
(instancetype) + textWithString:
 
(instancetype) + textWithStrings:
 
(instancetype) + textWithCollection:
 
(instancetype) + textWithArray:
 
(instancetype) + textWithText:
 
(instancetype) + text
 

Initializing Texts

(instancetype) - initWithText:
 

Copying Texts

(void) - setText:
 

Comparing Texts

(BOOL) - isEqualToText:
 

Deriving New Texts

(instancetype) - textByAddingString:
 
(instancetype) - textByAddingCollection:
 
(instancetype) - textByAddingStringsFromArray:
 
(instancetype) - textByAddingArray:
 
(instancetype) - textByAddingStrings:
 
(instancetype) - textByAddingText:
 

Converting Texts

SCStringsstrings
 
SCUniqueStringsuniqueStrings
 

Adding Text

(void) - addText:
 
(void) - insertText:atIndex:
 

Removing Text

(void) - removeAllText
 
(void) - removeTextInRange:
 
(void) - removeTextWithSubstring:
 
(void) - removeTextWithoutSubstring:
 
(void) - removeSubstring:
 
(SCText *) - cutTextInRange:
 
(void) - removeText:
 

Replacing Text

(void) - replaceTextInRange:withText:
 
(void) - replaceTextInRange:withCollection:
 
(void) - replaceText:withText:
 

Copying and Moving Text

(void) - exchangeTextInRange:withTextInRange:
 
(void) - duplicateTextInRange:
 
(void) - duplicateStringsInRange:
 
(void) - copyTextInRange:toIndex:
 
(void) - moveTextInRange:toIndex:
 
(void) - forwardMoveTextInRange:steps:
 
(void) - forwardMoveTextInRange:
 
(void) - backwardMoveTextInRange:steps:
 
(void) - backwardMoveTextInRange:
 
(void) - moveToFirstPositionTextInRange:
 
(void) - moveToLastPositionTextInRange:
 

Querying a Text

(SCText *) - textInRange:
 

Finding and Selecting Text

(BOOL) - containsText:
 
(NSRange) - rangeOfText:
 
(NSRange) - rangeOfCollection:
 
(SCIndex- indexOfText:
 
(SCIndex- indexOfCollection:
 
(SCUInteger- countOfText:
 
(SCUInteger- countOfCollection:
 
(SCArray *) - indexesOfText:
 
(SCArray *) - indexesOfCollection:
 
(SCText *) - textWithSubstring:
 
(SCText *) - textWithoutSubstring:
 
(SCTextIndex *) - textIndexOfSubstring:
 
(SCArray *) - textIndexesOfSubstring:
 

Additional Inherited Members

- Instance Methods inherited from SCStrings
(instancetype) - initWithName:
 
(instancetype) - initWithString:
 
(instancetype) - initWithCollection:
 
(instancetype) - initWithArray:
 
(instancetype) - initWithStrings:
 
(instancetype) - init
 
(void) - setStrings:
 
(void) - setCollection:
 
(void) - setString:
 
(BOOL) - isEqualToStrings:
 
(BOOL) - isEqualToCollection:
 
(BOOL) - isEqualTo:
 
(BOOL) - isEqual:
 
(instancetype) - stringsByAddingString:
 
(instancetype) - stringsByAddingCollection:
 
(instancetype) - stringsByAddingStrings:
 
(instancetype) - stringsByAddingStringsFromArray:
 
(instancetype) - stringsByAddingArray:
 
(void) - enumerateWithDelegate:
 
(void) - enumerate
 
(void) - reverseEnumerateWithDelegate:
 
(void) - reverseEnumerate
 
(NSUInteger) - countByEnumeratingWithState:objects:count:
 
(void) - sortAscendingWithSorter:
 
(void) - sortDescendingWithSorter:
 
(void) - sortWithSorter:
 
(void) - sortAscending
 
(void) - sortDescending
 
(void) - sort
 
(SCStrings *) - ascendingSortedStringsWithSorter:
 
(SCStrings *) - descendingSortedStringsWithSorter:
 
(SCStrings *) - sortedStringsWithSorter:
 
(void) - addString:
 
(void) - addCollection:
 
(void) - addStrings:
 
(void) - addLine
 
(void) - addStringsFromArray:
 
(void) - addArray:
 
(void) - insertString:atIndex:
 
(void) - insertStrings:atIndex:
 
(void) - insertCollection:atIndex:
 
(void) - insertStrings:atIndexes:
 
(void) - insertCollection:atIndexes:
 
(void) - insertLineAtIndex:
 
(void) - removeAllStrings
 
(void) - removeFirstString
 
(void) - removeLastString
 
(void) - removeStringAtIndex:
 
(void) - removeStringsAtIndexes:
 
(void) - removeString:
 
(void) - removeStrings:
 
(void) - removeCollection:
 
(void) - removeStringsWithSubstring:
 
(void) - removeStringsNotAtIndexes:
 
(void) - removeStringsNotEqualTo:
 
(void) - removeStringsNotInStrings:
 
(void) - removeStringsNotInCollection:
 
(void) - removeStringsWithoutSubstring:
 
(void) - removeDuplicatedStrings
 
(void) - replaceStringAtIndex:withString:
 
(void) - replaceStringsAtIndexes:withStrings:
 
(void) - replaceStringsAtIndexes:withCollection:
 
(void) - replaceString:withString:
 
(void) - setObject:atIndexedSubscript:
 
(void) - exchangeStringAtIndex:withStringAtIndex:
 
(void) - duplicateStringAtIndex:
 
(void) - duplicateAllStrings
 
(void) - duplicate
 
(void) - copyStringAtIndex:toIndex:
 
(void) - moveStringAtIndex:toIndex:
 
(void) - forwardMoveStringAtIndex:steps:
 
(void) - forwardMoveStringAtIndex:
 
(void) - backwardMoveStringAtIndex:steps:
 
(void) - backwardMoveStringAtIndex:
 
(void) - moveToFirstPositionStringAtIndex:
 
(void) - moveToLastPositionStringAtIndex:
 
(void) - reverse
 
(NSString *) - stringAtIndex:
 
(SCStrings *) - stringsAtIndexes:
 
(id) - objectAtIndexedSubscript:
 
(BOOL) - containsString:
 
(BOOL) - containsStrings:
 
(BOOL) - containsCollection:
 
(BOOL) - containsAnyString:
 
(BOOL) - containsAnyStringFromCollection:
 
(BOOL) - containsSubstring:
 
(BOOL) - containsSubstrings:
 
(BOOL) - containsSubstringsFromCollection:
 
(BOOL) - containsAnySubstring:
 
(BOOL) - containsAnySubstringFromCollection:
 
(BOOL) - containsDuplicatedStrings
 
(SCIndex- indexOfString:
 
(SCIndex- indexOfSubstring:
 
(SCStrings *) - stringsWithSubstring:
 
(SCStrings *) - stringsWithSubstrings:
 
(SCStrings *) - stringsWithSubstringsFromCollection:
 
(SCStrings *) - stringsWithAnySubstring:
 
(SCStrings *) - stringsWithAnySubstringFromCollection:
 
(SCStrings *) - stringsWithoutSubstring:
 
(SCStrings *) - stringsWithoutSubstrings:
 
(SCStrings *) - stringsWithoutSubstringsFromCollection:
 
(SCULong- countOfString:
 
(SCULong- countOfSubstring:
 
(SCULong- countOfStringsWithSubstring:
 
- Instance Methods inherited from SCObject
(instancetype) - initWithContentsOfSerializedFile:
 
(BOOL) - writeContentsToSerializedFile:
 
(instancetype) - initWithDataDictionaryFromFile:
 
(void) - writeToDataDictionaryFile:atomically:
 
(void) - writeToDataDictionaryFile:
 
(NSDictionary *) - dataDictionary
 
(instancetype) - initWithFileStream:
 
(void) - writeToFileStream:
 
(void) - appendToFileStream:
 
(instancetype) - initWithData:
 
(instancetype) - initWithContentsOfFile:
 
(instancetype) - initWithContentsOfURL:
 
(instancetype) - initWithContentsOfURLString:
 
(BOOL) - writeToFile:
 
(BOOL) - writeToURL:
 
(BOOL) - writeToURLString:
 
(NSData *) - data
 
- Class Methods inherited from SCStrings
(instancetype) + stringsWithCoder:
 
(instancetype) + stringsWithContentsOfSerializedFile:
 
(instancetype) + stringsWithDataDictionary:
 
(instancetype) + stringsWithDataDictionaryFromFile:
 
(instancetype) + stringsWithStream:
 
(instancetype) + stringsWithFileStream:
 
(instancetype) + stringsWithData:
 
(instancetype) + stringsWithContentsOfFile:
 
(instancetype) + stringsWithContentsOfURL:
 
(instancetype) + stringsWithContentsOfURLString:
 
(instancetype) + stringsWithName:
 
(instancetype) + stringsWithString:
 
(instancetype) + stringsWithCollection:
 
(instancetype) + stringsWithArray:
 
(instancetype) + stringsWithStrings:
 
(instancetype) + strings
 
- Properties inherited from SCStrings
NSString * name
 
SCIndex count
 
BOOL readOnly
 
BOOL empty
 
BOOL modified
 
BOOL caseInsensitive
 
id< SCTextDelegatedelegate
 
NSEnumerator * stringEnumerator
 
NSEnumerator * reverseStringEnumerator
 
SCArrayarray
 
NSArray * foundationArray
 
SCStringsascendingSortedStrings
 
SCStringsdescendingSortedStrings
 
SCStringssortedStrings
 
SCStringsreversedStrings
 
NSString * firstString
 
NSString * lastString
 
SCIndex indexOfLastString
 
- Properties inherited from SCObject
NSString * className
 

Detailed Description

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:

Method Documentation

- (void) addText: (SCStrings *)  text

Adds into the receiving text the strings from the specified existing text.

Parameters
text- the source text
Exceptions
SCTextException- text error detected
- (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
SCTextException- text error detected
- (void) backwardMoveTextInRange: (NSRange)  range
steps: (SCIndex steps 

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
SCTextException- text error detected
- (BOOL) containsText: (SCStrings *)  text

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
SCTextException- text error detected
- (SCUInteger) countOfCollection: (id<SCCollection>)  collection

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
- (SCUInteger) countOfText: (SCStrings *)  text

Returns the count of occurrences of the specified text into the receiving text.

Parameters
text- the desired text
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
range- the text range
Returns
A text with the required strings
Exceptions
SCTextException- text error detected
- (void) duplicateStringsInRange: (NSRange)  range

Duplicates the strings in the specified range.

Parameters
range- the range of the duplicating strings
Exceptions
SCTextException- text error detectec
- (void) duplicateTextInRange: (NSRange)  range

Duplicates the text with the specified text range.

Parameters
range- the range of the duplicating text
Exceptions
SCTextException- text error detected
- (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
SCTextException- text error detected
- (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
SCTextException- text error detected
- (void) forwardMoveTextInRange: (NSRange)  range
steps: (SCIndex steps 

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
SCTextException- text error detected
- (SCArray *) indexesOfCollection: (id<SCCollection>)  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- the collection with the desired strings
Returns
An array with the indexes
Exceptions
SCTextException- text error detected
- (SCArray *) indexesOfText: (SCStrings *)  text

Returns an array with the indexes of all occurrences of the specified text into the receiving text.

Parameters
text- the desired text
Returns
An array with the indexes
- (SCIndex) indexOfCollection: (id<SCCollection>)  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- the collection of desired strings
Returns
An index of the first occurrence the desired strings, otherwise SCNotFound
- (SCIndex) indexOfText: (SCStrings *)  text

Returns the index of the first occurrence of the specified text into the receiving text.

Parameters
text- the desired text
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
text- the source text
Returns
A newly initialized text
Exceptions
SCTextException- text error detected
- (void) insertText: (SCStrings *)  text
atIndex: (SCIndex index 

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
SCTextException- text error detected
- (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
SCTextException- text error detected
- (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
SCTextException- text error detected
- (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
SCTextException- text error detected
- (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)
- (NSRange) rangeOfText: (SCStrings *)  text

Returns the lowest range whose corresponding receiving text strings range is equal to a given text.

Parameters
text- the desired text
Returns
A range of strings that equals to the specified text, otherwise empty range (0, 0)
- (void) removeAllText

Removes all strings from the receiving text.

Exceptions
SCTextException- text error detected
- (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
SCTextException- text error detected
- (void) removeText: (SCStrings *)  text

Removes all occurrences in the reciving text of the specified text.

Parameters
text- the text to be removing from the receiving text
Exceptions
SCTextException- text error detected
- (void) removeTextInRange: (NSRange)  range

Removes strings in the specified range from the receiving text.

Parameters
range- the range of deleting strings
Exceptions
SCTextException- text error detected
- (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
SCTextException- text error detected
- (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
SCTextException- text error detected
- (void) replaceText: (SCStrings *)  oldText
withText: (SCStrings *)  newText 

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
SCTextException- text error detected
- (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
SCTextException- text error detected
- (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
SCTextException- text error detected
- (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- the source text
Exceptions
SCTextException- text error detected
+ (instancetype) text

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
SCTextException- text error detected
SCCollectionException- collection error detected
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
SCTextException- text error detected
SCCollectionException- collection error detected
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
SCTextException- text error detected
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
SCTextException- text error detected
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
SCTextException- text error detected
SCCollectionException- collection error detected
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
SCTextException- text error detected
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
SCTextException- text error detected
+ (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
SCTextException- text error detected
Since
version 1.2.3
+ (instancetype) textWithCoder: (NSCoder *)  coder

Returns a text created by using the specified coder.

Parameters
coder- the source coder
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
SCTextException- text error detected
SCCollectionException- collection error detected
+ (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
url- the source URL
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
SCStreamException- stream error detected
SCSystemException- system error detected
+ (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
SCStreamException- stream error detected
SCSystemException- system error detected
+ (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
SCTextException- text error detected
+ (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
SCTextException- text error detected
- (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
text- the source text
Returns
A created text
Exceptions
SCTextException- text error detected

Property Documentation

- (SCStrings *) strings
readnonatomicassign

Returns the strings list with the copy of all strings within the receiving text

- (SCUniqueStrings *) uniqueStrings
readnonatomicassign

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: