LibreOffice: osl::StreamPipe Class Reference

LibreOffice LibreOffice 24.2 SDK C/C++ API Reference |

Loading...
Searching...
No Matches
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:

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

## ◆ StreamPipe() [1/5]

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.

## ◆ StreamPipe() [2/5]

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

Creates pipe as wrapper around the underlying oslPipe.

Parameters

  Pipe |

## ◆ StreamPipe() [3/5]

osl::StreamPipe::StreamPipe | ( | const ::rtl::OUString & | strName,
|  | oslPipeOptions | Options = osl_Pipe_OPEN )
| inline

Creates a pipe.

Parameters

  [in] | strName | Pipe name
  [in] | Options | Pipe options

## ◆ StreamPipe() [4/5]

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

Creates a pipe.

Parameters

  [in] | strName | Pipe name
  [in] | Options | Pipe options
  [in] | rSec | Security for the pipe

## ◆ StreamPipe() [5/5]

osl::StreamPipe::StreamPipe | ( | oslPipe | pipe,
|  | __sal_NoAcquire | noacquire )
| inline

Constructs a Pipe reference without acquiring the handle.

## Member Function Documentation

## ◆ operator=() [1/2]

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

Assignment operator.

## ◆ operator=() [2/2]

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

  [in] | Pipe | Pipe to attach to this object

## ◆ read()

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

  [in] | pBuffer | receives the read data.
  [in] | n | the 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.

## ◆ recv()

sal_Int32 osl::StreamPipe::recv | ( | void * | pBuffer,
|  | sal_Int32 | BytesToRead ) const
| inline

Tries to receives BytesToRead data from the connected pipe,.

Parameters

  [out] | pBuffer | Points to a buffer that will be filled with the received data.
  [in] | BytesToRead | The number of bytes to read. pBuffer must have at least this size.

Returns
  the number of received bytes.

## ◆ send()

sal_Int32 osl::StreamPipe::send | ( | const void * | pBuffer,
|  | sal_Int32 | BytesToSend ) const
| inline

Tries to sends BytesToSend data from the connected pipe.

Parameters

  [in] | pBuffer | Points to a buffer that contains the send-data.
  [in] | BytesToSend | The number of bytes to send. pBuffer must have at least this size.

Returns
  the number of transferred bytes.

## ◆ write()

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

  [in] | pBuffer | contains the data to be written.
  [in] | n | the 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:

- osl/pipe_decl.hxx
- osl/pipe.hxx