Interface
Constructor
os_pipe()
Constructs a disconnected
pipe.
Throws: os_pipe_toolkit_error
Constructor
os_pipe(
const char* path , enum Encoding enc = Ascii )
Constructs a pipe
connected to the named pipe at path . Default enc is Ascii. Valid value for enc can be Ascii or Utf8.
Throws: os_pipe_toolkit_error
Constructor
os_pipe(
const string& path , enum Encoding enc = Ascii )
Constructs a pipe
connected to the named pipe at path . Default enc is Ascii. Valid value for enc can be Ascii or Utf8.
Throws: os_pipe_toolkit_error
Constructor
os_pipe(
os_desc_t descriptor )
Constructs a pipe
connected to the pipe descriptor .
Destructor
~os_pipe()
Destroys
the pipe, closing the underlying descriptor if necessary.
<
bool
operator<( const os_pipe& pipe )
const
Returns
true if this pipe's descriptor value is less
than pipe 's.
==
bool
operator==( const os_pipe& pipe )
const
Returns
true if this pipe's descriptor value is the
same as pipe 's.
(os_adapter)
operator
os_adapter() const
Returns an os_adapter
to the pipe.
(os_desc_t)
operator
os_desc_t() const
Returns
the native pipe descriptor.
auto_close
void
auto_close( bool flag )
If
flag is true , closes
the descriptor on destruction.
auto_close
bool
auto_close() const
Returns
true if the pipe will close its descriptor on
destruction.
clear
void
clear()
Resets
the state to good.
close
void
close()
Closes
the pipe.
Throws: os_pipe_toolkit_error
connect_to
void
connect_to( const string& path , enum Encoding enc = Ascii )
Connects to the pipe
specified by path . Default enc is Ascii. Valid value for enc can be Ascii or Utf8.
Throws: os_pipe_toolkit_error
descriptor
void
descriptor( os_desc_t descriptor )
Sets
the native pipe descriptor to descriptor .
descriptor
os_desc_t
descriptor() const
Returns
the value of the native pipe descriptor.
eof
bool
eof() const
Returns
true if the pipe is at end of input.
event_on_eof
void
event_on_eof( bool flag )
If
flag is true , the
pipe generates an event on EOF.
event_on_eof
bool
event_on_eof() const
Returns
true if the pipe will generate an event on EOF.
good
bool
good() const
Returns
true if the pipe is in a good state and not at
EOF.
ok
bool
ok() const
Returns
true if the pipe is in a good state.
is_open
bool
is_open() const
Returns
true if the pipe is open.
path
string
path() const
Returns
the path to this pipe.
read
ssize_t
read( void* buffer ,
size_t bytes )
Reads up to the specified number of bytes
of data into buffer
from the pipe. Returns the number of bytes actually read or returns -1
on error.
Throws: os_pipe_toolkit_error
reset
void
reset()
Destroys the existing
underlying pipe and replaces it with a newly-constructed pipe.
Throws: os_pipe_toolkit_error
write
ssize_t
write( const void* buffer ,
size_t bytes )
Writes up to
the specified number of bytes of data from buffer
to the pipe. Returns the number of bytes written or returns -1
on error.
Throws: os_pipe_toolkit_error