AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pipe_decl.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 #ifndef INCLUDED_OSL_PIPE_DECL_HXX
4 #define INCLUDED_OSL_PIPE_DECL_HXX
5 
6 #include "osl/pipe.h"
7 #include "osl/security.hxx"
8 #include "rtl/ustring.hxx"
9 
10 namespace osl
11 {
12 class StreamPipe;
13 
16 class Pipe
17 {
18 protected:
20 
21 public:
25  inline Pipe();
26 
31  inline Pipe(const ::rtl::OUString& strName, oslPipeOptions Options);
32 
38  inline Pipe(const ::rtl::OUString& strName, oslPipeOptions Options, const Security& rSecurity);
39 
42  inline Pipe(const Pipe& pipe);
43 
44 #if defined LIBO_INTERNAL_ONLY
45  inline Pipe(Pipe&& other) noexcept;
46 #endif
47 
50  inline Pipe(oslPipe pipe, __sal_NoAcquire noacquire);
51 
55  inline Pipe(oslPipe Pipe);
56 
59  inline ~Pipe();
60 
61  inline bool SAL_CALL is() const;
62 
71  inline bool create(const ::rtl::OUString& strName, oslPipeOptions Options,
72  const Security& rSec);
73 
82  inline bool create(const ::rtl::OUString& strName, oslPipeOptions Options = osl_Pipe_OPEN);
83 
86  inline void SAL_CALL clear();
87 
91  inline Pipe& SAL_CALL operator=(const Pipe& pipe);
92 
93 #if defined LIBO_INTERNAL_ONLY
94  inline Pipe& operator=(Pipe&& other) noexcept;
95 #endif
96 
100  inline Pipe& SAL_CALL operator=(const oslPipe pipe);
101 
105  inline bool SAL_CALL isValid() const;
106 
107  inline bool SAL_CALL operator==(const Pipe& rPipe) const;
108 
111  inline void SAL_CALL close();
112 
115  inline oslPipeError SAL_CALL accept(StreamPipe& Connection);
116 
122  inline oslPipeError SAL_CALL getError() const;
123 
124  inline oslPipe SAL_CALL getHandle() const;
125 };
126 
129 class StreamPipe : public Pipe
130 {
131 public:
136  inline StreamPipe();
137 
142  inline StreamPipe(oslPipe Pipe);
143 
149  inline StreamPipe(const ::rtl::OUString& strName, oslPipeOptions Options = osl_Pipe_OPEN);
150 
157  inline StreamPipe(const ::rtl::OUString& strName, oslPipeOptions Options, const Security& rSec);
158 
161  inline StreamPipe(oslPipe pipe, __sal_NoAcquire noacquire);
162 
169  inline StreamPipe& SAL_CALL operator=(oslPipe Pipe);
170 
173  inline StreamPipe& SAL_CALL operator=(const Pipe& pipe);
174 
184  inline sal_Int32 SAL_CALL recv(void* pBuffer, sal_Int32 BytesToRead) const;
185 
194  inline sal_Int32 SAL_CALL send(const void* pBuffer, sal_Int32 BytesToSend) const;
195 
206  inline sal_Int32 SAL_CALL read(void* pBuffer, sal_Int32 n) const;
207 
217  sal_Int32 SAL_CALL write(const void* pBuffer, sal_Int32 n) const;
218 };
219 }
220 #endif
221 
222 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
oslPipeError accept(StreamPipe &Connection)
Accept connection on an existing pipe.
Definition: pipe.hxx:133
void clear()
releases the underlying handle
Definition: pipe.hxx:123
bool operator==(const Pipe &rPipe) const
Definition: pipe.hxx:111
oslPipe m_handle
Definition: pipe_decl.hxx:19
#define osl_Pipe_OPEN
Definition: pipe.h:37
oslPipeError getError() const
Delivers a constant describing the last error for the pipe system.
Definition: pipe.hxx:143
Represents a pipe.
Definition: pipe_decl.hxx:16
sal_Int32 read(void *pBuffer, sal_Int32 n) const
Retrieves n bytes from the stream and copies them into pBuffer.
Definition: pipe.hxx:178
__sal_NoAcquire
Definition: types.h:332
sal_Int32 write(const void *pBuffer, sal_Int32 n) const
Writes n bytes from pBuffer to the stream.
Definition: pipe.hxx:184
sal_uInt32 oslPipeOptions
Pipe creation options.
Definition: pipe.h:36
void close()
Closes the pipe.
Definition: pipe.hxx:117
StreamPipe()
Creates an unattached pipe.
Definition: pipe.hxx:155
Encapsulate security information for one user.
Definition: security_decl.hxx:18
Pipe()
Does not create a pipe.
Definition: pipe.hxx:15
bool is() const
Definition: pipe.hxx:105
~Pipe()
Destructor.
Definition: pipe.hxx:56
sal_Int32 send(const void *pBuffer, sal_Int32 BytesToSend) const
Tries to sends BytesToSend data from the connected pipe.
Definition: pipe.hxx:196
oslPipe getHandle() const
Definition: pipe.hxx:149
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.
Definition: pipe.hxx:63
A pipe to send or receive a stream of data.
Definition: pipe_decl.hxx:129
sal_Int32 recv(void *pBuffer, sal_Int32 BytesToRead) const
Tries to receives BytesToRead data from the connected pipe,.
Definition: pipe.hxx:190
StreamPipe & operator=(oslPipe Pipe)
Attaches the oslPipe to this object.
Pipe & operator=(const Pipe &pipe)
Assignment operator.
Definition: pipe.hxx:77
struct oslPipeImpl * oslPipe
Definition: pipe.h:40
oslPipeError
Definition: pipe.h:17
bool isValid() const
Checks if the pipe is valid.