LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
osl::StreamPipe Class Reference

A pipe to send or receive a stream of data. More...

#include <pipe_decl.hxx>

Inheritance diagram for osl::StreamPipe:
osl::Pipe

Public Member Functions

 StreamPipe ()
 Creates an unattached pipe. More...
 
 StreamPipe (oslPipe Pipe)
 Creates pipe as wrapper around the underlying oslPipe. More...
 
 StreamPipe (const StreamPipe &Pipe)
 Copy constructor. More...
 
 StreamPipe (const ::rtl::OUString &strName, oslPipeOptions Options=osl_Pipe_OPEN)
 Creates a pipe. More...
 
 StreamPipe (const ::rtl::OUString &strName, oslPipeOptions Options, const Security &rSec)
 Creates a pipe. More...
 
 StreamPipe (oslPipe pipe, __sal_NoAcquire noacquire)
 Constructs a Pipe reference without acquiring the handle. More...
 
StreamPipeoperator= (oslPipe Pipe)
 Attaches the oslPipe to this object. More...
 
StreamPipeoperator= (const Pipe &pipe)
 Assignment operator. More...
 
sal_Int32 recv (void *pBuffer, sal_Int32 BytesToRead) const
 Tries to receives BytesToRead data from the connected pipe,. More...
 
sal_Int32 send (const void *pBuffer, sal_Int32 BytesToSend) const
 Tries to sends BytesToSend data from the connected pipe. More...
 
sal_Int32 read (void *pBuffer, sal_Int32 n) const
 Retrieves n bytes from the stream and copies them into pBuffer. More...
 
sal_Int32 write (const void *pBuffer, sal_Int32 n) const
 Writes n bytes from pBuffer to the stream. More...
 
- Public Member Functions inherited from osl::Pipe
 Pipe ()
 Does not create a pipe. More...
 
 Pipe (const ::rtl::OUString &strName, oslPipeOptions Options)
 Creates an insecure pipe that is accessible for all users. More...
 
 Pipe (const ::rtl::OUString &strName, oslPipeOptions Options, const Security &rSecurity)
 Creates a secure pipe that access depends on the umask settings. More...
 
 Pipe (const Pipe &pipe)
 Copy constructor. More...
 
 Pipe (oslPipe pipe, __sal_NoAcquire noacquire)
 Constructs a Pipe reference without acquiring the handle. More...
 
 Pipe (oslPipe Pipe)
 Creates pipe as wrapper around the underlying oslPipe. More...
 
 ~Pipe ()
 Destructor. More...
 
bool is () const
 
bool create (const ::rtl::OUString &strName, oslPipeOptions Options, const Security &rSec)
 Creates an insecure pipe that is accessible for all users with the given attributes. More...
 
bool create (const ::rtl::OUString &strName, oslPipeOptions Options=osl_Pipe_OPEN)
 Creates a secure that access rights depend on the umask settings with the given attributes. More...
 
void clear ()
 releases the underlying handle More...
 
Pipeoperator= (const Pipe &pipe)
 Assignment operator. More...
 
Pipeoperator= (const oslPipe pipe)
 Assignment operator. More...
 
bool isValid () const
 Checks if the pipe is valid. More...
 
bool operator== (const Pipe &rPipe) const
 
void close ()
 Closes the pipe. More...
 
oslPipeError accept (StreamPipe &Connection)
 Accept connection on an existing pipe. More...
 
oslPipeError getError () const
 Delivers a constant describing the last error for the pipe system. More...
 
oslPipe getHandle () const
 

Additional Inherited Members

- Protected Attributes inherited from osl::Pipe
oslPipe m_handle
 

Detailed Description

A pipe to send or receive a stream of data.

Constructor & Destructor Documentation

osl::StreamPipe::StreamPipe ( )
inline

Creates an unattached pipe.

You must attach the pipe to an oslPipe e.g. by using the operator=(oslPipe), before you can use the stream- functionality of the object.

osl::StreamPipe::StreamPipe ( oslPipe  Pipe)
inline

Creates pipe as wrapper around the underlying oslPipe.

Parameters
Pipe
osl::StreamPipe::StreamPipe ( const StreamPipe Pipe)
inline

Copy constructor.

Parameters
Pipe
osl::StreamPipe::StreamPipe ( const ::rtl::OUString strName,
oslPipeOptions  Options = osl_Pipe_OPEN 
)
inline

Creates a pipe.

Parameters
strName
Options
osl::StreamPipe::StreamPipe ( const ::rtl::OUString strName,
oslPipeOptions  Options,
const Security rSec 
)
inline

Creates a pipe.

Parameters
strName
Options
rSec
osl::StreamPipe::StreamPipe ( oslPipe  pipe,
__sal_NoAcquire  noacquire 
)
inline

Constructs a Pipe reference without acquiring the handle.

Member Function Documentation

StreamPipe& osl::StreamPipe::operator= ( oslPipe  Pipe)
inline

Attaches the oslPipe to this object.

If the object already was attached to an oslPipe, the old one will be closed and destroyed.

Parameters
Pipe
StreamPipe& osl::StreamPipe::operator= ( const Pipe pipe)
inline

Assignment operator.

sal_Int32 osl::StreamPipe::read ( void *  pBuffer,
sal_Int32  n 
) const
inline

Retrieves n bytes from the stream and copies them into pBuffer.

The method avoids incomplete reads due to packet boundaries.

Parameters
pBufferreceives the read data.
nthe number of bytes to read. pBuffer must be large enough to hold the n bytes!
Returns
the number of read bytes. The number will only be smaller than n if an exceptional condition (e.g. connection closed) occurs.
sal_Int32 osl::StreamPipe::recv ( void *  pBuffer,
sal_Int32  BytesToRead 
) const
inline

Tries to receives BytesToRead data from the connected pipe,.

Parameters
pBuffer[out] Points to a buffer that will be filled with the received data.
BytesToRead[in] The number of bytes to read. pBuffer must have at least this size.
Returns
the number of received bytes.
sal_Int32 osl::StreamPipe::send ( const void *  pBuffer,
sal_Int32  BytesToSend 
) const
inline

Tries to sends BytesToSend data from the connected pipe.

Parameters
pBuffer[in] Points to a buffer that contains the send-data.
BytesToSend[in] The number of bytes to send. pBuffer must have at least this size.
Returns
the number of transferred bytes.
sal_Int32 osl::StreamPipe::write ( const void *  pBuffer,
sal_Int32  n 
) const
inline

Writes n bytes from pBuffer to the stream.

The method avoids incomplete writes due to packet boundaries.

Parameters
pBuffercontains the data to be written.
nthe number of bytes to write.
Returns
the number of written bytes. The number will only be smaller than n if an exceptional condition (e.g. connection closed) occurs.

The documentation for this class was generated from the following files: