Samond Classes Library 1.1.6-RELEASE build 132

SCTextFile Class Reference

Text file class. More...

#import <SCTextFile.h>

Inheritance diagram for SCTextFile:
SCText SCStrings SCObject <SCDictionaryObjectProtocol> <SCCodingProtocol> <SCStreamProtocol> <SCCollectionProtocol>

List of all members.

Public Member Functions

Initializing Text File
(id) - initWithName:stream:delegate:
(id) - initWithName:stream:
(id) - initFromStream:delegate:
(id) - initFromStream:
(id) - initWithName:path:delegate:
(id) - initWithName:path:
(id) - initWithPath:delegate:
(id) - initWithPath:
(id) - initWithTextFile:
Setting and Copying Text Files
(void) - copyFromTextFile:
Getting Text File Properties
(NSString *) - path
Converting Text File
(SCText *) - text
Reading and Writing Text File
(BOOL) - load
(BOOL) - loadFromStream:
(BOOL) - loadWithPath:
(BOOL) - save
(BOOL) - saveToStream:
(BOOL) - saveWithPath:
(BOOL) - reset
(BOOL) - appendToFileWithPath:
(BOOL) - addTextFromStream:
(BOOL) - addTextWithPath:
Reading and Writing Text Blocks
(BOOL) - insertTextFromStream:atIndex:
(BOOL) - insertTextWithPath:atIndex:
(BOOL) - replaceTextInRange:withTextFromStream:
(BOOL) - replaceTextInRange:withTextWithPath:
(BOOL) - saveTextInRange:toStream:
(BOOL) - saveTextInRange:withPath:
(BOOL) - appendTextInRange:withPath:
(BOOL) - cutTextInRange:toStream:
(BOOL) - cutTextInRange:withPath:
(BOOL) - cutAndAppendTextInRange:withPath:
(BOOL) - saveTextWithSubstring:toStream:caseInsensitive:
(BOOL) - saveTextWithSubstring:toStream:
(BOOL) - saveTextWithSubstring:withPath:caseInsensitive:
(BOOL) - saveTextWithSubstring:withPath:
(BOOL) - saveTextWithoutSubstring:toStream:caseInsensitive:
(BOOL) - saveTextWithoutSubstring:toStream:
(BOOL) - saveTextWithoutSubstring:withPath:caseInsensitive:
(BOOL) - saveTextWithoutSubstring:withPath:

Static Public Member Functions

Creating Text File
(SCTextFile *) + textFileWithDataDictionary:
(SCTextFile *) + textFileWithDataDictionaryFromFile:
(SCTextFile *) + textFileWithCoder:
(SCTextFile *) + textFileWithContentsOfSerializedFile:
(SCTextFile *) + textFileWithStream:
(SCTextFile *) + textFileWithFileStream:
(SCTextFile *) + textFileWithName:capacity:delegate:
(SCTextFile *) + textFileWithName:capacity:
(SCTextFile *) + textFileWithName:delegate:
(SCTextFile *) + textFileWithName:
(SCTextFile *) + textFileWithDelegate:
(SCTextFile *) + textFileWithCapacity:
(SCTextFile *) + textFileWithName:stream:delegate:
(SCTextFile *) + textFileWithName:stream:
(SCTextFile *) + textFileFromStream:delegate:
(SCTextFile *) + textFileFromStream:
(SCTextFile *) + textFileWithName:path:delegate:
(SCTextFile *) + textFileWithName:path:
(SCTextFile *) + textFileWithPath:delegate:
(SCTextFile *) + textFileWithPath:
(SCTextFile *) + textFileWithString:
(SCTextFile *) + textFileWithStrings:
(SCTextFile *) + textFileWithCollection:
(SCTextFile *) + textFileWithText:
(SCTextFile *) + textFileWithTextFile:
(SCTextFile *) + textFile

Detailed Description

Text file class.

Class implements the text file.
Class was introduced in version 1.1.4.

Class declares the following properties:


Member Function Documentation

- (BOOL) addTextFromStream: (SCStream *)  stream

Adds into the receiving text file strings from the specified stream.

Parameters:
stream- input stream
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) addTextWithPath: (NSString *)  path

Adds into the receiving text file strings from the file with the specified path.

Parameters:
path- input file path
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) appendTextInRange: (NSRange)  range
withPath: (NSString *)  path 

Appends the text in the specified range to the end of file with the specified path.

Parameters:
range- saved text range
path- output file path
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) appendToFileWithPath: (NSString *)  path

Writes the receiving text file content to the end of the file with the specified path.

Parameters:
path- destination file path
Returns:
YES if append operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) copyFromTextFile: (SCTextFile *)  text

Replaces the content and settings of the receiving text by using the specified existing text.

Parameters:
text- existing text
Exceptions:
SCTextException- text error detected
- (BOOL) cutAndAppendTextInRange: (NSRange)  range
withPath: (NSString *)  path 

Cuts the text in the specified range and append it to the end of the file with the specified path.

Parameters:
range- cutted text range
path- output file path
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) cutTextInRange: (NSRange)  range
toStream: (SCStream *)  stream 

Cuts the text in the specified range and save it to the specified stream.

Parameters:
range- cutted text range
stream- output stream
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) cutTextInRange: (NSRange)  range
withPath: (NSString *)  path 

Cuts the text in the specified range and save it to the file with the specified path.

Parameters:
range- cutted text range
path- output file path
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initFromStream: (SCStream *)  stream

Initializes a text file using the specified input stream.

Parameters:
stream- input stream
Returns:
A newly initialized text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initFromStream: (SCStream *)  stream
delegate: (id<SCTextDelegate>)  delegate 

Initializes a text file using the specified input stream and delegate object.

Parameters:
stream- input stream
delegate- delegate object
Returns:
A newly initialized text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initWithName: (NSString *)  name
path: (NSString *)  path 

Initializes a text file using the specified text file name and file path.

Parameters:
name- text file name
path- text file path
Returns:
A newly initialized text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initWithName: (NSString *)  name
path: (NSString *)  path
delegate: (id<SCTextDelegate>)  delegate 

Initializes a text file using the specified text file name, file path and delegate object.

Parameters:
name- text file name
path- text file path
delegate- delegate object
Returns:
A newly initialized text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initWithName: (NSString *)  name
stream: (SCStream *)  stream 

Initializes a text file using the specified text file name and input stream.

Parameters:
name- text file name
stream- input stream
Returns:
A newly initialized text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initWithName: (NSString *)  name
stream: (SCStream *)  stream
delegate: (id<SCTextDelegate>)  delegate 

Initializes a text file using the specified text file name, input stream and delegate object.

Parameters:
name- text file name
stream- input stream
delegate- delegate object
Returns:
A newly initialized text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initWithPath: (NSString *)  path

Initializes a text file using the specified file path.

Parameters:
path- text file path
Returns:
A newly initialized text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initWithPath: (NSString *)  path
delegate: (id<SCTextDelegate>)  delegate 

Initializes a text file using the specified file path and delegate object.

Parameters:
path- text file path
delegate- delegate object
Returns:
A newly initialized text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initWithTextFile: (SCTextFile *)  file

Initializes a text file using the speified existing text file.

Parameters:
file- existing text file
Returns:
A newly initialized text file
Exceptions:
SCTextException- text file error detected
- (BOOL) insertTextFromStream: (SCStream *)  stream
atIndex: (SCIndex index 

Loads the text from the specified stream and inserts it into the receiving text file at the specified index.

Parameters:
stream- input stream
index- destination index
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) insertTextWithPath: (NSString *)  path
atIndex: (SCIndex index 

Loads the text from file with the specified path and inserts it into the receiving text file at the specified index.

Parameters:
path- input file path
index- destination index
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) load

Loads the content of the text file.

Returns:
YES if reading operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) loadFromStream: (SCStream *)  stream

Loads the content of the specified stream into the receiving text file.

Parameters:
stream- input stream
Returns:
YES if reading operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) loadWithPath: (NSString *)  path

Loads the content of the file with the specified path into the receiving text file.

Parameters:
path- loaded file path
Returns:
YES if reading operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (NSString *) path

Returns path of the receiving text file.

Returns:
Text file path
- (BOOL) replaceTextInRange: (NSRange)  range
withTextFromStream: (SCStream *)  stream 

Replaces the text in the specified range with text loaded from the specified stream.

Parameters:
range- replaced text range
stream- input stream
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) replaceTextInRange: (NSRange)  range
withTextWithPath: (NSString *)  path 

Replaces the text in the specified range with text loaded from the file with the specified path.

Parameters:
range- replaced text range
path- input file path
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) reset

Discards all receiving text changes and reload content of the file.

Returns:
YES if reset operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) save

Loads the content of the receiving text file.

Returns:
YES if writing operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) saveTextInRange: (NSRange)  range
toStream: (SCStream *)  stream 

Saves the text in the specified range to the specified stream.

Parameters:
range- saved text range
stream- output stream
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) saveTextInRange: (NSRange)  range
withPath: (NSString *)  path 

Saves the text in the specified range to the file with the specified path.

Parameters:
range- saved text range
path- output file path
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) saveTextWithoutSubstring: (NSString *)  substring
toStream: (SCStream *)  stream 

Saves into the specified stream strings from the receiving text file which not contains the specified substring.

Parameters:
substring- required substring
stream- output stream
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
See also:
- saveTextWithoutSubstring:toStream:caseInsensitive:
- (BOOL) saveTextWithoutSubstring: (NSString *)  substring
toStream: (SCStream *)  stream
caseInsensitive: (BOOL)  value 

Saves into the specified stream strings from the receiving text file which not contains the specified substring. Case insensitively depends on the value of the specified flag.

Parameters:
substring- required substring
stream- output stream
value- YES for case insensitive comparison operations, otherwise NO
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
See also:
- saveTextWithoutSubstring:toStream:
- (BOOL) saveTextWithoutSubstring: (NSString *)  substring
withPath: (NSString *)  path 

Saves into the file with the specified path strings from the receiving text file which not contains the specified substring.

Parameters:
substring- required substring
path- output file path
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
See also:
- saveTextWithoutSubstring:withPath:caseInsensitive:
- (BOOL) saveTextWithoutSubstring: (NSString *)  substring
withPath: (NSString *)  path
caseInsensitive: (BOOL)  value 

Saves into the file with the specified path strings from the receiving text file which not contains the specified substring. Case insensitively depends on the value of the specified flag.

Parameters:
substring- required substring
path- output file path
value- YES for case insensitive comparison operations, otherwise NO
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
See also:
- saveTextWithoutSubstring:withPath:
- (BOOL) saveTextWithSubstring: (NSString *)  substring
toStream: (SCStream *)  stream 

Saves into the specified stream strings from the receiving text file which contains the specified substring.

Parameters:
substring- required substring
stream- output stream
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
See also:
- saveTextWithSubstring:toStream:caseInsensitive:
- (BOOL) saveTextWithSubstring: (NSString *)  substring
toStream: (SCStream *)  stream
caseInsensitive: (BOOL)  value 

Saves into the specified stream strings from the receiving text file which contains the specified substring. Case insensitively depends on the value of the specified flag.

Parameters:
substring- required substring
stream- output stream
value- YES for case insensitive comparison operations, otherwise NO
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
See also:
- saveTextWithSubstring:toStream:
- (BOOL) saveTextWithSubstring: (NSString *)  substring
withPath: (NSString *)  path 

Saves into the file with the specified path strings from the receiving text file which contains the specified substring.

Parameters:
substring- required substring
path- output file path
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
See also:
- saveTextWithSubstring:withPath:caseInsensitive:
- (BOOL) saveTextWithSubstring: (NSString *)  substring
withPath: (NSString *)  path
caseInsensitive: (BOOL)  value 

Saves into the file with the specified path strings from the receiving text file which contains the specified substring. Case insensitively depends on the value of the specified flag.

Parameters:
substring- required substring
path- output file path
value- YES for case insensitive comparison operations, otherwise NO
Returns:
YES if operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
See also:
- saveTextWithSubstring:withPath:
- (BOOL) saveToStream: (SCStream *)  stream

Saves the content of the receiving instance to the specified output stream.

Parameters:
stream- output stream
Returns:
YES if writing operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) saveWithPath: (NSString *)  path

Saves the teceiving text file content into the file with specified path.

Parameters:
path- destination file path
Returns:
YES if writing operation is successfully, otherwise NO
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCText *) text

Returns the text with the copy of all receiving text file strings.

Returns:
Text with required strings

Reimplemented from SCText.

+ (SCTextFile *) textFile

Returns a text file created by using the default settings.

Returns:
A created text file
+ (SCTextFile *) textFileFromStream: (SCStream *)  stream

Returns a text file created by using the specified input stream.

Parameters:
stream- input stream
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileFromStream: (SCStream *)  stream
delegate: (id<SCTextDelegate>)  delegate 

Returns a text file created by using the specified input stream and delegate object.

Parameters:
stream- input stream
delegate- delegate object
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileWithCapacity: (SCULong capacity

Returns a text file created by using the specified text file capacity.

Parameters:
capacity- text file capacity
Returns:
A created text
+ (SCTextFile *) textFileWithCoder: (NSCoder *)  coder

Returns a text file created by using the specified coder.

Parameters:
coder- source coder
Returns:
A created text file
+ (SCTextFile *) textFileWithCollection: (id)  collection

Returns a text file created by using the specified existing collection.

Parameters:
collection- existing collection
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
+ (SCTextFile *) textFileWithContentsOfSerializedFile: (NSString *)  path

Returns a text file created by using the contents of serialized file with the specified path.

Parameters:
path- source serialized file path
Returns:
A created text file
+ (SCTextFile *) textFileWithDataDictionary: (NSDictionary *)  dictionary

Returns a text file created by using the specified dictionary.

Parameters:
dictionary- source dictionary
Returns:
A created text file
+ (SCTextFile *) textFileWithDataDictionaryFromFile: (NSString *)  path

Returns a text file created by using the dictionary from the specified file.

Parameters:
path- source dictionary file path
Returns:
A created text file
+ (SCTextFile *) textFileWithDelegate: (id<SCTextDelegate>)  delegate

Returns a text file created by using the specified delegate object.

Parameters:
delegate- delegate object
Returns:
A created text
+ (SCTextFile *) textFileWithFileStream: (NSString *)  path

Returns a text file created from the stream file with the specified path.

Parameters:
path- stream file path
Returns:
A created text file
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileWithName: (NSString *)  name

Returns a text file created by using the specified text file name.

Parameters:
name- text file name
Returns:
A created text
+ (SCTextFile *) textFileWithName: (NSString *)  name
capacity: (SCULong capacity 

Returns a text file created by using the specified text file name and capacity.

Parameters:
name- text file name
capacity- text file capacity
Returns:
A created text
+ (SCTextFile *) textFileWithName: (NSString *)  name
capacity: (SCULong capacity
delegate: (id<SCTextDelegate>)  delegate 

Returns a text file created by using the specified text file name, capacity and delegate object.

Parameters:
name- text file name
capacity- text file capacity
delegate- delegate object
Returns:
A created text
+ (SCTextFile *) textFileWithName: (NSString *)  name
delegate: (id<SCTextDelegate>)  delegate 

Returns a text file created by using the specified text file name and delegate object.

Parameters:
name- text file name
delegate- delegate object
Returns:
A created text
+ (SCTextFile *) textFileWithName: (NSString *)  name
path: (NSString *)  path 

Returns a text file created by using the specified text file name and file path.

Parameters:
name- text file name
path- text file path
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileWithName: (NSString *)  name
path: (NSString *)  path
delegate: (id<SCTextDelegate>)  delegate 

Returns a text file created by using the specified text file name, file path and delegate object.

Parameters:
name- text file name
path- text file path
delegate- delegate object
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileWithName: (NSString *)  name
stream: (SCStream *)  stream 

Returns a text file created by using the specified text file name and input stream.

Parameters:
name- text file name
stream- input stream
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileWithName: (NSString *)  name
stream: (SCStream *)  stream
delegate: (id<SCTextDelegate>)  delegate 

Returns a text file created by using the specified text file name, input stream and delegate object.

Parameters:
name- text file name
stream- input stream
delegate- delegate object
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileWithPath: (NSString *)  path

Returns a text file created by using the specified file path.

Parameters:
path- text file path
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileWithPath: (NSString *)  path
delegate: (id<SCTextDelegate>)  delegate 

Returns a text file created by using the specified file path and delegate object.

Parameters:
path- text file path
delegate- delegate object
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileWithStream: (SCStream *)  stream

Returns a text file created from the specified stream.

Parameters:
stream- stream for reading text
Returns:
A created text file
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCTextFile *) textFileWithString: (NSString *)  string

Returns a text file created by using the specified existing string.

Parameters:
string- existing string
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
+ (SCTextFile *) textFileWithStrings: (NSString *)  string
,   ... 

Returns the text cfile reated by using the specified nil terminated list of existing strings.

Parameters:
string- first string
...- other strings
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
+ (SCTextFile *) textFileWithText: (SCText *)  text

Returns a text file created by using the specified existing text.

Parameters:
text- existing text
Returns:
A created text file
Exceptions:
SCTextException- text file error detected
+ (SCTextFile *) textFileWithTextFile: (SCTextFile *)  file

Returns a text file created by using the specified existing text file.

Parameters:
file- existing text file
Returns:
A created text file
Exceptions:
SCTextException- text file error detected

The documentation for this class was generated from the following files:
 All Classes Files Functions Typedefs Enumerations Enumerator Defines