class PTerminalChannel: public PChannel

This class is a standard \ref{PChannel} which may output to a \ref{PTerminal} emulation interactor.

Inheritance:


Public

[more] Construction
[more] Overrides from class PChannel
[more] New functions for class


Inherited from PChannel:

Public Methods

ostatic BOOL ConvertOSError( int libcReturnValue, Errors & lastError, int & osError )

Public

Overrides from class PObject

Information functions

Reading functions

Writing functions

Miscellaneous functions

Error functions

Protected Fields

oint os_handle
oErrors lastErrorCode[NumErrorGroups+1]
oint lastErrorNumber[NumErrorGroups+1]
oPINDEX lastReadCount
oPINDEX lastWriteCount
oPTimeInterval readTimeout
oPTimeInterval writeTimeout

Protected Methods

ovirtual BOOL ConvertOSError( int libcReturnValue, ErrorGroup group = LastGeneralError )
oBOOL SetErrorValues( Errors errorCode, int osError, ErrorGroup group = LastGeneralError )
oint ReadCharWithTimeout( PTimeInterval & timeout )


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions


Documentation

This class is a standard \ref{PChannel} which may output to a \ref{PTerminal} emulation interactor. As PChannel is descended from iostream all the standard << and >> operators may be used to output to a window.
o Construction

o PTerminalChannel()
Create a terminal interactor channel with no interactor. This is provided so that instances of this class (eg as member fields) can be declared before the \ref{PTerminal} is created.

o PTerminalChannel( PTerminal & term )
Create a terminal interactor channel connected to a terminal emulator interactor.
Parameters:
term - The \ref{PTerminal} descendent that implements the terminal emulation interactor window.

o Overrides from class PChannel

ovirtual BOOL IsOpen() const
Determine if the channel is currently open and may be read from or written to.

Returns:
TRUE if the channel is open.

ovirtual PString GetName() const
Get the name given to the channel that is currently open. This returns the class name of the \ref{PTerminal} descendent that is attached to the channel.

Returns:
Name of the channel.

ovirtual BOOL Read( void * buf, PINDEX len )
Low level read from the channel. This reads whatever is available as entered via the keyboard when the \ref{PTerminal} had the focus.

Returns:
TRUE if the function successfully read at least one character of data from the channel.
Parameters:
buf - The buffer into which to put read characters.
len - The maximum number of characters to read.

ovirtual BOOL Write( const void * buf, PINDEX len )
Low level write to the channel. This passes data through directly to the Write() function of \ref{PTerminal}.

Returns:
TRUE if all the data specified was successfully written to the channel.
Parameters:
buf - The buffer from which to write characters.
len - The maximum number of characters to write.

ovirtual BOOL Close()
Close the channel. This simply disconnects the current \ref{PTerminal} from the channel and leaves it disconnected. Any reading or writing after this function has been executed and before a call to Open() has been made will assert.

Returns:
TRUE if the channel closed without error.

o New functions for class

oBOOL Open( PTerminal & term )
Open the \ref{PTerminalChannel} using a \ref{PTerminal} descendent. This "connects" the channel to an interactor. This will override any previous connection made.
Parameters:
term - The \ref{PTerminal} descendent that implements the terminal emulation interactor window.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.