LibreOffice
LibreOffice 5.2 SDK C/C++ API Reference
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  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_OSL_PIPE_DECL_HXX
20 #define INCLUDED_OSL_PIPE_DECL_HXX
21 
22 #include <osl/pipe.h>
23 # include <osl/security.hxx>
24 #include <rtl/ustring.hxx>
25 
26 namespace osl {
27 
28 class StreamPipe;
29 
32 class Pipe
33 {
34 protected:
36 
37 public:
38 
42  inline Pipe();
43 
48  inline Pipe(const ::rtl::OUString& strName, oslPipeOptions Options);
49 
55  inline Pipe(const ::rtl::OUString& strName, oslPipeOptions Options,const Security & rSecurity);
56 
59  inline Pipe(const Pipe& pipe);
60 
63  inline Pipe( oslPipe pipe, __sal_NoAcquire noacquire );
64 
68  inline Pipe(oslPipe Pipe);
69 
72  inline ~Pipe();
73 
74  inline bool SAL_CALL is() const;
75 
84  inline bool create( const ::rtl::OUString & strName,
85  oslPipeOptions Options, const Security &rSec );
86 
95  inline bool create( const ::rtl::OUString & strName, oslPipeOptions Options = osl_Pipe_OPEN );
96 
99  inline void SAL_CALL clear();
100 
104  inline Pipe& SAL_CALL operator= (const Pipe& pipe);
105 
109  inline Pipe& SAL_CALL operator= (const oslPipe pipe );
110 
114  inline bool SAL_CALL isValid() const;
115 
116  inline bool SAL_CALL operator==( const Pipe& rPipe ) const;
117 
120  inline void SAL_CALL close();
121 
124  inline oslPipeError SAL_CALL accept(StreamPipe& Connection);
125 
126 
132  inline oslPipeError SAL_CALL getError() const;
133 
134  inline oslPipe SAL_CALL getHandle() const;
135 };
136 
139 class StreamPipe : public Pipe
140 {
141 public:
142 
147  inline StreamPipe();
148 
152  inline StreamPipe(oslPipe Pipe);
153 
157  inline StreamPipe(const StreamPipe& Pipe);
158 
163  inline StreamPipe(const ::rtl::OUString& strName, oslPipeOptions Options = osl_Pipe_OPEN);
164 
170  inline StreamPipe(const ::rtl::OUString& strName, oslPipeOptions Options, const Security &rSec );
171 
174  inline StreamPipe( oslPipe pipe, __sal_NoAcquire noacquire );
175 
181  inline StreamPipe & SAL_CALL operator=(oslPipe Pipe);
182 
185  inline StreamPipe& SAL_CALL operator=(const Pipe& pipe);
186 
195  inline sal_Int32 SAL_CALL recv(void* pBuffer, sal_Int32 BytesToRead) const;
196 
204  inline sal_Int32 SAL_CALL send(const void* pBuffer, sal_Int32 BytesToSend) const;
205 
214  inline sal_Int32 SAL_CALL read(void* pBuffer, sal_Int32 n) const;
215 
223  sal_Int32 SAL_CALL write(const void* pBuffer, sal_Int32 n) const;
224 };
225 
226 }
227 #endif
228 
229 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Pipe()
Does not create a pipe.
Definition: pipe.hxx:31
A pipe to send or receive a stream of data.
Definition: pipe_decl.hxx:139
oslPipeError
Definition: pipe.h:34
void clear()
releases the underlying handle
Definition: pipe.hxx:124
bool operator==(const Pipe &rPipe) const
Definition: pipe.hxx:112
sal_uInt32 oslPipeOptions
Definition: pipe.h:49
void close()
Closes the pipe.
Definition: pipe.hxx:118
#define osl_Pipe_OPEN
Definition: pipe.h:50
bool isValid() const
Checks if the pipe is valid.
__sal_NoAcquire
Definition: types.h:384
bool is() const
Definition: pipe.hxx:106
~Pipe()
Destructor.
Definition: pipe.hxx:67
oslPipe getHandle() const
Definition: pipe.hxx:150
oslPipeError accept(StreamPipe &Connection)
Accept connection on an existing pipe.
Definition: pipe.hxx:134
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:74
oslPipe m_handle
Definition: pipe_decl.hxx:35
oslPipeError getError() const
Delivers a constant describing the last error for the pipe system.
Definition: pipe.hxx:144
Represents a pipe.
Definition: pipe_decl.hxx:32
Pipe & operator=(const Pipe &pipe)
Assignment operator.
Definition: pipe.hxx:88
Definition: conditn.hxx:32
capsulate security information for one user.
Definition: security_decl.hxx:34
struct oslPipeImpl * oslPipe
Definition: pipe.h:53