Samond Classes Library 1.2.0-RELEASE build 166
List of all members
SCText Class Reference

Text class. More...

#import <SCText.h>

Inheritance diagram for SCText:
SCStrings SCObject <SCCoding> <SCDictionaring> <SCStreaming> <SCCollectioning> SCTextFile

Creating Texts

(SCText *) + textWithCoder:
 
(SCText *) + textWithContentsOfSerializedFile:
 
(SCText *) + textWithDataDictionary:
 
(SCText *) + textWithDataDictionaryFromFile:
 
(SCText *) + textWithStream:
 
(SCText *) + textWithFileStream:
 
(SCText *) + textWithName:
 
(SCText *) + textWithString:
 
(SCText *) + textWithStrings:
 
(SCText *) + textWithCollection:
 
(SCText *) + textWithText:
 
(SCText *) + text
 

Initializing Texts

(id) - initWithText:
 

Copying Texts

(void) - setText:
 

Comparing Texts

(BOOL) - isEqualToText:
 

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
(id) - initWithName:
 
(id) - initWithString:
 
(id) - initWithCollection:
 
(id) - initWithStrings:
 
(id) - init
 
(void) - setStrings:
 
(void) - setCollection:
 
(void) - setString:
 
(BOOL) - isEqualToStrings:
 
(BOOL) - isEqualToCollection:
 
(BOOL) - isEqualTo:
 
(BOOL) - isEqual:
 
(void) - enumerateWithDelegate:
 
(void) - enumerate
 
(void) - reverseEnumerateWithDelegate:
 
(void) - reverseEnumerate
 
(void) - sortAscendingWithSorter:
 
(void) - sortDescendingWithSorter:
 
(void) - sortWithSorter:
 
(void) - sortAscending
 
(void) - sortDescending
 
(void) - sort
 
(SCStrings *) - ascendingSortedStringsWithSorter:
 
(SCStrings *) - descendingSortedStringsWithSorter:
 
(SCStrings *) - sortedStringsWithSorter:
 
(SCStrings *) - ascendingSortedStrings
 
(SCStrings *) - descendingSortedStrings
 
(void) - addString:
 
(void) - addCollection:
 
(void) - addStrings:
 
(void) - addLine
 
(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) - 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:
 
(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
(id) - initWithContentsOfSerializedFile:
 
(BOOL) - writeContentsToSerializedFile:
 
(id) - initWithDataDictionaryFromFile:
 
(void) - writeToDataDictionaryFile:atomically:
 
(void) - writeToDataDictionaryFile:
 
(NSDictionary *) - dataDictionary
 
(id) - initWithFileStream:
 
(void) - writeToFileStream:
 
(void) - appendToFileStream:
 
- Instance Methods inherited from <SCCoding>
- Instance Methods inherited from <SCDictionaring>
- Instance Methods inherited from <SCCollectioning>
- Class Methods inherited from SCStrings
(SCStrings *) + stringsWithCoder:
 
(SCStrings *) + stringsWithContentsOfSerializedFile:
 
(SCStrings *) + stringsWithDataDictionary:
 
(SCStrings *) + stringsWithDataDictionaryFromFile:
 
(SCStrings *) + stringsWithStream:
 
(SCStrings *) + stringsWithFileStream:
 
(SCStrings *) + stringsWithName:
 
(SCStrings *) + stringsWithString:
 
(SCStrings *) + stringsWithCollection:
 
(SCStrings *) + stringsWithStrings:
 
- Properties inherited from SCStrings
NSString * name
 
BOOL readOnly
 
BOOL caseInsensitive
 
id< SCTextDelegatedelegate
 
SCULong count
 
BOOL empty
 
NSString * description
 
BOOL modified
 
NSEnumerator * stringEnumerator
 
NSEnumerator * reverseStringEnumerator
 
SCArrayarray
 
NSArray * foundationArray
 
SCStringssortedStrings
 
SCStringsreversedStrings
 
NSString * firstString
 
NSString * lastString
 
SCIndex indexOfLastString
 

Detailed Description

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:

Method Documentation

- (void) addText: (SCStrings *)  text

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

Parameters
text- existing 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- moved text range
Exceptions
SCTextException- text error detected
- (void) backwardMoveTextInRange: (NSRange)  range
steps: (SCULong steps 

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
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- range of the copied text
destination- destination index
Exceptions
SCTextException- text error detected
- (SCUInteger) countOfCollection: (id)  collection

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

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

Parameters
text- desired text
Returns
Count of occurrences
- (SCText *) cutTextInRange: (NSRange)  range

Returns the text in the specified range and removes this text from the receiving text.

Parameters
range- text range
Returns
Text with the required strings
Exceptions
SCTextException- text error detected
- (void) duplicateStringsInRange: (NSRange)  range

Duplicates the strings in the specified range.

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

Duplicates the text with the specified text range.

Parameters
range- duplicated text range
Exceptions
SCTextException- text error detected
- (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
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- moved text range
Exceptions
SCTextException- text error detected
- (void) forwardMoveTextInRange: (NSRange)  range
steps: (SCULong steps 

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
SCTextException- text error detected
- (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
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- desired text
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
- (SCIndex) indexOfText: (SCStrings *)  text

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

Parameters
text- desired text
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
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- source text
index- 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- 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
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- moved text range
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- moved text range
Exceptions
SCTextException- text error detected
- (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)
- (NSRange) rangeOfText: (SCStrings *)  text

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

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

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

Parameters
text- removing text
Exceptions
SCTextException- text error detected
- (void) removeTextInRange: (NSRange)  range

Removes strings in the specified range from the receiving text.

Parameters
range- range of deleted 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- keeping substring
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- removing substring
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- replaced text
newText- replacement text
Exceptions
SCTextException- text error detected
- (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
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- range of the replaced text
text- 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- existing source text
Exceptions
SCTextException- text error detected
+ (SCText *) text

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
range- text range
Returns
Text with the requited strings
Exceptions
SCTextException- text error detected
+ (SCText *) textWithCoder: (NSCoder *)  coder

Returns a text created by using the specified coder.

Parameters
coder- source coder
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
SCTextException- text error detected
SCCollectionException- collection error detected
+ (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
SCStreamException- stream error detected
SCSystemException- system error detected
+ (SCText *) textWithName: (NSString *)  name

Returns a text created by using the specified text name.

Parameters
name- text name
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
+ (SCText *) textWithStream: (SCStream *)  stream

Returns a text created by using the data from the specified stream.

Parameters
stream- source stream
Returns
A created text
Exceptions
SCStreamException- stream error detected
SCSystemException- system error detected
+ (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
SCTextException- text error detected
+ (SCText *) textWithStrings: (SCStrings *)  strings

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
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- required substring
Returns
Text with selected strings
+ (SCText *) textWithText: (SCText *)  text

Returns a text created by using the existing text.

Parameters
text- existing source text
Returns
A created text
Exceptions
SCTextException- text error detected

Property Documentation

- (SCStrings *) strings
readnonatomicretain

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

- (SCUniqueStrings *) uniqueStrings
readnonatomicretain

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: