Samond Classes Library 1.1.6-RELEASE build 132

SCStream Class Reference

Abstract class of streams hierarchy. More...

#import <SCStream.h>

Inheritance diagram for SCStream:
SCObject <SCDictionaryObjectProtocol> <SCCodingProtocol> <SCStreamProtocol> <SCCollectionProtocol> SCFileStream SCStandardErrorStream SCStandardInputStream SCStandardOutputStream

List of all members.

Public Member Functions

Initializing Stream
(id) - init
Handling Errors
(SCStreamErrorHandling- errorHandling
(SCStreamStatus- status
(SCStreamException *) - streamException
(SCSystemException *) - systemException
(void) - setErrorHandling:
Querying and Setting Exception Properties
(NSString *) - streamName
(BOOL) - isOpen
(BOOL) - isReadable
(BOOL) - isWritable
(BOOL) - isReadOnly
(BOOL) - isWriteOnly
(BOOL) - isReadWrite
(id< SCStreamDelegate >) - delegate
(void) - setDelegate:
(id) - object
Reading from Stream
(SCUSize- readBytes:toBuffer:
(id< SCStreamProtocol >) - readObject
(SCByte- readByte
(SCUByte- readUByte
(SCShort- readShort
(SCUShort- readUShort
(SCInteger- readInteger
(SCUInteger- readUInteger
(SCLong- readLong
(SCULong- readULong
(char) - readChar
(unichar) - readUnichar
(const char *) - readCharString
(BOOL) - readBool
(SCFloat- readFloat
(SCDouble- readDouble
(SCUSize- readToByte:
(SCUSize- readToUByte:
(SCUSize- readToShort:
(SCUSize- readToUShort:
(SCUSize- readToInteger:
(SCUSize- readToUInteger:
(SCUSize- readToLong:
(SCUSize- readToULong:
(SCUSize- readToChar:
(SCUSize- readToUnichar:
(SCUSize- readToCharString:max:
(SCUSize- readToBool:
(SCUSize- readToFloat:
(SCUSize- readToDouble:
Writing into Stream
(SCUSize- writeBytes:fromBuffer:
(void) - writeObject:
(void) - writeByte:
(void) - writeUByte:
(void) - writeShort:
(void) - writeUShort:
(void) - writeInteger:
(void) - writeUInteger:
(void) - writeLong:
(void) - writeULong:
(void) - writeChar:
(void) - writeUnichar:
(void) - writeCharString:
(void) - writeBool:
(void) - writeFloat:
(void) - writeDouble:
Reading and Writing Text Files
(NSString *) - readStringWithEncoding:max:
(NSString *) - readStringWithEncoding:
(NSString *) - readStringWithMax:
(NSString *) - readString
(void) - writeString:encoding:
(void) - writeString:
Seeking Stream
(BOOL) - eof

Detailed Description

Abstract class of streams hierarchy.

Class declares methods for support stream operations.
Class was introduced in version 1.1.3.

Class declares the following properties:


Member Function Documentation

- (id< SCStreamDelegate >) delegate

Returns the stream events delegate object.

Returns:
Delegate object
- (BOOL) eof

Determines end of stream flag.

Returns:
YES if end of stream detected, otherwise NO

Reimplemented in SCStandardInputStream, and SCFileStream.

- (SCStreamErrorHandling) errorHandling

Returns the error handling mode.

Returns:
Error handling mode
- (id) init

Initializes the receiver's class instace using the default settings.

Returns:
A newly initialized stream

Reimplemented in SCFileStream, SCStandardErrorStream, SCStandardInputStream, and SCStandardOutputStream.

- (BOOL) isOpen

Returns the stream opening flag.

Returns:
YES if stream is open, otherwise NO
- (BOOL) isReadable

Determines the ability to read from the stream.
This abstract method must be redeclared in all child classes.

Returns:
YES if stream supports reading, otherwise NO
- (BOOL) isReadOnly

Determines the stream is operating in read only mode.

Returns:
YES if stream runs in read only mode, otherwise NO
- (BOOL) isReadWrite

Determines the stream is operating in both read and write mods.

Returns:
YES if stream runs in both modes, otherwise NO
- (BOOL) isWritable

Determines the ability to write into the stream.
This abstract method must be redeclared in all child classes.

Returns:
YES if stream supports writing, otherwise NO
- (BOOL) isWriteOnly

Determines the stream is operating in write only mode.

Returns:
YES if stream runs in write only mode, otherwise NO
- (id) object

Returns the currently loaded object.

Returns:
Pointer to the currently loaded object or nil if no object loading in progress
- (BOOL) readBool

Returns the boolean variable readed from the receiver's stream.

Returns:
Readed boolean variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCByte) readByte

Returns the 8-bit integer variable readed from the receiver's stream.

Returns:
Readed 8-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readBytes: (SCUSize count
toBuffer: (void *)  buffer 

Reads the specified bytes count into the specified buffer.
This abstract method must be redeclared in all child classes.

Parameters:
count- count of bytes for reading from stream to buffer
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (char) readChar

Returns the char variable readed from the receiver's stream.

Returns:
Readed char variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (const char *) readCharString

Returns the character string readed from the receiver's stream.

Returns:
Readed character string
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCDouble) readDouble

Returns the double variable readed from the receiver's stream.

Returns:
Readed double variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCFloat) readFloat

Returns the float variable readed from the receiver's stream.

Returns:
Readed float variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCInteger) readInteger

Returns the 32-bit integer variable readed from the receiver's stream.

Returns:
Readed 32-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCLong) readLong

Returns the 64-bit integer variable readed from the receiver's stream.

Returns:
Readed 64-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id< SCStreamProtocol >) readObject

Initializes the class instance from the receiver's stream.

Returns:
A newly initialized class instance or nil if error detected
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCShort) readShort

Returns the 16-bit integer variable readed from the receiver's stream.

Returns:
Readed 16-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (NSString *) readString

Returns the string readed by using the UTF-8 encoding.

Returns:
String or nul if error or end of stream detected
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

Reimplemented in SCStandardInputStream, and SCFileStream.

- (NSString *) readStringWithEncoding: (NSStringEncoding)  encoding

Returns the string readed by using the specified encoding.

Parameters:
encoding- string encoding
Returns:
String or nul if error or end of stream detected
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

Reimplemented in SCStandardInputStream, and SCFileStream.

- (NSString *) readStringWithEncoding: (NSStringEncoding)  encoding
max: (SCUInteger max 

Returns the string with the specified max length and readed by using the specified encoding.

Parameters:
encoding- string encoding
max- max length
Returns:
String or nul if error or end of stream detected
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

Reimplemented in SCStandardInputStream, and SCFileStream.

- (NSString *) readStringWithMax: (SCUInteger max

Returns the string with the specified max length and readed by using the UTF-8 encoding.

Parameters:
max- max length
Returns:
String or nul if error or end of stream detected
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

Reimplemented in SCStandardInputStream, and SCFileStream.

- (SCUSize) readToBool: (BOOL *)  buffer

Reads the boolean value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToByte: (SCByte *)  buffer

Reads the signed 8-bit integer value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToChar: (char *)  buffer

Reads the char value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToCharString: (char *)  buffer
max: (SCUSize max 

Reads the char string into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
max- max bytes of reading
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToDouble: (SCDouble *)  buffer

Reads the double precision float value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToFloat: (SCFloat *)  buffer

Reads the single precision float value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToInteger: (SCInteger *)  buffer

Reads the signed 32-bit integer value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToLong: (SCULong *)  buffer

Reads the signed 64-bit integer value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToShort: (SCShort *)  buffer

Reads the signed 16-bit integer value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToUByte: (SCUByte *)  buffer

Reads the unsigned 8-bit integer value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToUInteger: (SCUInteger *)  buffer

Reads the unsigned 32-bit integer value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToULong: (SCULong *)  buffer

Reads the unsigned 64-bit integer value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToUnichar: (unichar *)  buffer

Reads the unichar value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) readToUShort: (SCUShort *)  buffer

Reads the unsigned 16-bit integer value into the specified buffer.

Parameters:
buffer- pointer to receiving data buffer
Returns:
Actually readed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUByte) readUByte

Returns the 8-bit unsigned integer variable readed from the receiver's stream.

Returns:
Readed 8-bit unsigned integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUInteger) readUInteger

Returns the unsigned 32-bit integer variable readed from the receiver's stream.

Returns:
Readed unsigned 32-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCULong) readULong

Returns the 64-bit unsigned integer variable readed from the receiver's stream.

Returns:
Readed 64-bit unsigned integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (unichar) readUnichar

Returns the unichar variable readed from the receiver's stream.

Returns:
Readed unichar variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUShort) readUShort

Returns the 16-bit unsigned integer variable readed from the receiver's stream.

Returns:
Readed 16-bit unsigned integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) setDelegate: (id<SCStreamDelegate>)  delegate

Sets the stream events delegate object.

Parameters:
delegate- Delegate object
- (void) setErrorHandling: (SCStreamErrorHandling mode

Sets the error handling mode.

Parameters:
mode- error handling mode
- (SCStreamStatus) status

Returns the stream status.

Returns:
Stream status
- (SCStreamException *) streamException

Returns the last detected stream exception.

Returns:
Stream exception
- (NSString *) streamName

Returns the stream name.

Returns:
Stream name
- (SCSystemException *) systemException

Returns the last detected system exception.

Returns:
System exception
- (void) writeBool: (BOOL)  variable

Writes into the receiver's stream the specified boolean variable.

Parameters:
variable- stored boolean variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeByte: (SCByte variable

Writes into the receiver's stream the specified 8-bit integer variable.

Parameters:
variable- stored 8-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (SCUSize) writeBytes: (SCUSize count
fromBuffer: (const void *)  buffer 

Writes to the receiver's stream the specified bytes count from the specified buffer.
This abstract method must be reimplemented in all child classes.

Parameters:
count- count of bytes for writing from buffer to stream
buffer- pointer to sending data buffer
Returns:
Actually writed bytes count
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeChar: (char)  variable

Writes into the receiver's stream the specified char variable.

Parameters:
variable- stored char variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeCharString: (const char *)  variable

Writes into the receiver's stream the specified character string.

Parameters:
variable- stored character string
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeDouble: (SCDouble variable

Writes into the receiver's stream the specified double variable.

Parameters:
variable- stored double variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeFloat: (SCFloat variable

Writes into the receiver's stream the specified float variable.

Parameters:
variable- stored float variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeInteger: (SCInteger variable

Writes into the receiver's stream the specified 32-bit integer variable.

Parameters:
variable- stored 32-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeLong: (SCLong variable

Writes into the receiver's stream the specified 64-bit integer variable.

Parameters:
variable- stored 64-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeObject: (id<SCStreamProtocol>)  object

Writes the specified class instance to the receiver's stream.

Parameters:
object- class instance for writing to receiver's stream
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeShort: (SCShort variable

Writes into the receiver's stream the specified 16-bit integer variable.

Parameters:
variable- stored 16-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeString: (NSString *)  string

Writes into the stream the specified UTF-8 text string with end of line character.

Parameters:
string- writed string
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

Reimplemented in SCStandardErrorStream, SCStandardOutputStream, and SCFileStream.

- (void) writeString: (NSString *)  string
encoding: (NSStringEncoding)  encoding 

Writes into the stream the specified text string with the specified encoding end of line character.

Parameters:
string- writed string
encoding- string encoding
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

Reimplemented in SCStandardErrorStream, SCStandardOutputStream, and SCFileStream.

- (void) writeUByte: (SCUByte variable

Writes into the receiver's stream the specified unsigned 8-bit integer variable.

Parameters:
variable- stored 8-bit unsigned integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeUInteger: (SCUInteger variable

Writes into the receiver's stream the specified unsigned 32-bit integer variable.

Parameters:
variable- stored unsigned 32-bit integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeULong: (SCULong variable

Writes into the receiver's stream the specified unsigned 64-bit integer variable.

Parameters:
variable- stored 64-bit unsigned integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeUnichar: (unichar)  variable

Writes into the receiver's stream the specified unichar variable.

Parameters:
variable- stored unichar variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (void) writeUShort: (SCUShort variable

Writes into the receiver's stream the specified unsigned 16-bit integer variable.

Parameters:
variable- stored 16-bit unsigned integer variable
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

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