File stream class.
More...
#import <SCFileStream.h>
File stream class.
- SDK
- macOS 10.6+, iOS 7.0+, GNUstep
- Since
- version 1.1.3
Implements the file stream access based on the abstract class SCStream.
Class instances can thrown the following exceptions:
+ (instancetype) appendFileStreamWithPath: |
|
(NSString *) |
path |
|
Returns the opened in the append only mode file stream created by using the specified path.
- Parameters
-
path | - the path to the file stream |
- Returns
- A created and opened file stream
- Exceptions
-
Closes the receiving file stream.
+ (instancetype) fileStream |
|
|
|
Returns the file stream created by using the default settings.
- Returns
- A created file stream
- Exceptions
-
+ (instancetype) fileStreamWithPath: |
|
(NSString *) |
path |
|
Returns the opened in the read only mode file stream created by using the specified path.
- Parameters
-
path | - the path to the file stream |
- Returns
- A created and opened file stream
- Exceptions
-
Returns the opened file stream created by using the specified path and open mode.
- Parameters
-
path | - the path to the file stream |
mode | - the file stream opening mode:
- SCFileStreamOpenReadOnly - read only mode
- SCFileStreamOpenReadWrite - read and write mode
- SCFileStreamOpenWriteOnly - write only mode
- SCFileStreamOpenWriteRead - write and read mode with the file truncated
- SCFileStreamOpenAppendWriteOnly - append only mode
- SCFileStreamOpenAppendReadWrite - append and read mode
|
- Returns
- A created and opened file stream
- Exceptions
-
Returns the opened file stream created by using the specified path, open mode and delegate object.
- Parameters
-
path | - the path to the file stream |
mode | - the file stream opening mode:
- SCFileStreamOpenReadOnly - read only mode
- SCFileStreamOpenReadWrite - read and write mode
- SCFileStreamOpenWriteOnly - write only mode
- SCFileStreamOpenWriteRead - write and read mode with the file truncated
- SCFileStreamOpenAppendWriteOnly - append only mode
- SCFileStreamOpenAppendReadWrite - append and read mode
|
delegate | - the file stream delegate object |
- Returns
- A created and opened file stream
- Exceptions
-
Returns the opened file stream created by using the specified path, open mode, delegate object and error handling mode.
- Parameters
-
path | - the path to the file stream |
mode | - the file stream opening mode:
- SCFileStreamOpenReadOnly - read only mode
- SCFileStreamOpenReadWrite - read and write mode
- SCFileStreamOpenWriteOnly - write only mode
- SCFileStreamOpenWriteRead - write and read mode with the file truncated
- SCFileStreamOpenAppendWriteOnly - append only mode
- SCFileStreamOpenAppendReadWrite - append and read mode
|
delegate | - the file stream delegate object |
handling | - the error handling mode:
- SCStreamErrorHandlingSystem - generate the system exception
- SCStreamErrorHandlingStream - generate the stream exception
- SCStreamErrorHandlingStatus - change the file stream status
|
- Returns
- A created and opened file stream
- Exceptions
-
Initializes the file stream using the default settings.
- Returns
- A newly initialized file stream
Reimplemented from SCStream.
- (instancetype) initAppendWithPath: |
|
(NSString *) |
path |
|
Initializes and opens in the append only mode the file stream using the specified path.
- Parameters
-
path | - the path to the file stream |
- Returns
- A newly initialized and opened file stream
- Exceptions
-
- (instancetype) initReadOnlyWithPath: |
|
(NSString *) |
path |
|
Initializes and opens in the read only mode the file stream using the specified path.
- Parameters
-
path | - the path to the file stream |
- Returns
- A newly initialized and opened file stream
- Exceptions
-
- (instancetype) initWithPath: |
|
(NSString *) |
path |
|
Initializes and opens in the read only mode the file stream using the specified path.
- Parameters
-
path | - the path to the file stream |
- Returns
- A newly initialized and opened file stream
- Exceptions
-
Initializes and opens file stream by using the specified path and open mode.
- Parameters
-
path | - the path to the file stream |
mode | - the file stream opening mode:
- SCFileStreamOpenReadOnly - read only mode
- SCFileStreamOpenReadWrite - read and write mode
- SCFileStreamOpenWriteOnly - write only mode
- SCFileStreamOpenWriteRead - write and read mode with the file truncated
- SCFileStreamOpenAppendWriteOnly - append only mode
- SCFileStreamOpenAppendReadWrite - append and read mode
|
- Returns
- A newly initialized and opened file stream
- Exceptions
-
Initializes and opens file stream by using the specified path, open mode and delegate object.
- Parameters
-
path | - the path to the file stream |
mode | - the file stream opening mode:
- SCFileStreamOpenReadOnly - read only mode
- SCFileStreamOpenReadWrite - read and write mode
- SCFileStreamOpenWriteOnly - write only mode
- SCFileStreamOpenWriteRead - write and read mode with the file truncated
- SCFileStreamOpenAppendWriteOnly - append only mode
- SCFileStreamOpenAppendReadWrite - append and read mode
|
delegate | - the file stream delegate object |
- Returns
- A newly initialized and opened file stream
- Exceptions
-
Initializes and opens file stream by using the specified path, open mode, delegate object and error handling mode.
- Parameters
-
path | - the path to the file stream |
mode | - the file stream opening mode:
- SCFileStreamOpenReadOnly - read only mode
- SCFileStreamOpenReadWrite - read and write mode
- SCFileStreamOpenWriteOnly - write only mode
- SCFileStreamOpenWriteRead - write and read mode with the file truncated
- SCFileStreamOpenAppendWriteOnly - append only mode
- SCFileStreamOpenAppendReadWrite - append and read mode
|
delegate | - the file stream delegate object |
handling | - the error handling mode:
- SCStreamErrorHandlingSystem - generate the system exception
- SCStreamErrorHandlingStream - generate the stream exception
- SCStreamErrorHandlingStatus - change the file stream status
|
- Returns
- A newly initialized and opened file stream
- Exceptions
-
- (instancetype) initWriteOnlyWithPath: |
|
(NSString *) |
path |
|
Initializes and opens in the write only mode the file stream using the specified path.
- Parameters
-
path | - the path to the file stream |
- Returns
- A newly initialized and opened file stream
- Exceptions
-
Returns the receiving file stream position from the file stream start.
- Returns
- A number of characters from the file stream start
- Exceptions
-
- (void) openAppendWithPath: |
|
(NSString *) |
path |
|
Opens for appending the receiving file stream by using the specified path.
- Parameters
-
path | - the path to the file stream |
- Exceptions
-
- (void) openReadOnlyWithPath: |
|
(NSString *) |
path |
|
Opens for reading the receiving file stream by using the specified path.
- Parameters
-
path | - the path to the file stream |
- Exceptions
-
- (void) openWithPath: |
|
(NSString *) |
path |
|
Opens for reading and writing the receiving file stream by using the specified path.
- Parameters
-
path | - the path to the file stream |
- Exceptions
-
Opens the receiving file stream by using the specified path and open mode.
- Parameters
-
path | - the path to the file stream |
mode | - the file stream opening mode:
- SCFileStreamOpenReadOnly - read only mode
- SCFileStreamOpenReadWrite - read and write mode
- SCFileStreamOpenWriteOnly - write only mode
- SCFileStreamOpenWriteRead - write and read mode with the file truncated
- SCFileStreamOpenAppendWriteOnly - append only mode
- SCFileStreamOpenAppendReadWrite - append and read mode
|
- Exceptions
-
Opens the receiving file stream by using the specified path, open mode and error handling mode.
- Parameters
-
path | - the path to the file stream |
mode | - the file stream opening mode:
- SCFileStreamOpenReadOnly - read only mode
- SCFileStreamOpenReadWrite - read and write mode
- SCFileStreamOpenWriteOnly - write only mode
- SCFileStreamOpenWriteRead - write and read mode with the file truncated
- SCFileStreamOpenAppendWriteOnly - append only mode
- SCFileStreamOpenAppendReadWrite - append and read mode
|
handling | - the error handling mode:
- SCStreamErrorHandlingSystem - generate the system exception
- SCStreamErrorHandlingStream - generate the stream exception
- SCStreamErrorHandlingStatus - change the file stream status
|
- Exceptions
-
- (void) openWriteOnlyWithPath: |
|
(NSString *) |
path |
|
Opens for writing the receiving file stream by using the specified path.
- Parameters
-
path | - the path to the file stream |
- Exceptions
-
- (SCSize) readBytes: |
|
(SCSize) |
count |
toBuffer: |
|
(void *) |
buffer |
|
|
| |
Reads from the receiving file stream the specified number of characters into a given buffer.
- Parameters
-
count | - the number of the characters to read from the receiving file stream |
buffer | - the pointer to the buffer for reading data |
- Returns
- A number of the actually readed characters
- Exceptions
-
Reimplemented from SCStream.
+ (instancetype) readOnlyFileStreamWithPath: |
|
(NSString *) |
path |
|
Returns the opened in the read only mode file stream created by using the specified path.
- Parameters
-
path | - the path to the file stream |
- Returns
- A created and opened file stream
- Exceptions
-
Sets the receiving file stream position to the start of the file stream.
- Exceptions
-
- (void) setOffset: |
|
(NSInteger) |
offset |
|
Sets the receiving file stream position to the specified offset from the file stream start.
- Parameters
-
offset | - the stream offset |
- Exceptions
-
Sets the receiving file stream position to the specified offset and whence.
- Parameters
-
offset | - the stream offset |
whence | - the stream offset whence:
- SCFileStreamOffsetStart - offset is set from the file stream start
- SCFileStreamOffsetCurrent - offset is set from the current position
- SCFileStreamOffsetEnd - offset is set from the file stream end
|
- Exceptions
-
- (SCSize) writeBytes: |
|
(SCSize) |
count |
fromBuffer: |
|
(const void *) |
buffer |
|
|
| |
Writes to the receiving file stream the specified number of the characters from a given data buffer.
- Parameters
-
count | - the number of characters to write to the receiving file stream |
buffer | - the pointer to the buffer with the data to write to the receiving file stream |
- Returns
- A number of the actually writed characters
- Exceptions
-
Reimplemented from SCStream.
+ (instancetype) writeOnlyFileStreamWithPath: |
|
(NSString *) |
path |
|
Returns the opened in the write only mode file stream created by using the specified path.
- Parameters
-
path | - the path to the file stream |
- Returns
- A created and opened file stream
- Exceptions
-
A path of the file stream
The documentation for this class was generated from the following files: