LibreOffice: osl/pipe_decl.hxx Source File

LibreOffice LibreOffice 7.5 SDK C/C++ API Reference

Loading...
Searching...
No Matches
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
20/*
21 * This file is part of LibreOffice published API.
22 */
23#ifndef INCLUDED_OSL_PIPE_DECL_HXX
24#define INCLUDED_OSL_PIPE_DECL_HXX
25
26#include "osl/pipe.h"
27#include "osl/security.hxx"
28#include "rtl/ustring.hxx"
29
30namespace osl
31{
32class StreamPipe;
33
36 class Pipe
37{
38protected:
39 oslPipe m_handle;
40
41public:
45 inline Pipe();
46
51 inline Pipe(const ::rtl::OUString& strName, oslPipeOptions Options);
52
58 inline Pipe(const ::rtl::OUString& strName, oslPipeOptions Options, const Security& rSecurity);
59
62 inline Pipe(const Pipe& pipe);
63
64#if defined LIBO_INTERNAL_ONLY
65 inline Pipe(Pipe&& other) noexcept;
66#endif
67
70 inline Pipe(oslPipe pipe, __sal_NoAcquire noacquire);
71
75 inline Pipe(oslPipe Pipe);
76
79 inline ~Pipe();
80
81 inline bool SAL_CALL is() const;
82
91 inline bool create(const ::rtl::OUString& strName, oslPipeOptions Options,
92 const Security& rSec);
93
102 inline bool create(const ::rtl::OUString& strName, oslPipeOptions Options = osl_Pipe_OPEN);
103
106 inline void SAL_CALL clear();
107
111 inline Pipe& SAL_CALL operator=(const Pipe& pipe);
112
113#if defined LIBO_INTERNAL_ONLY
114 inline Pipe& operator=(Pipe&& other) noexcept;
115#endif
116
120 inline Pipe& SAL_CALL operator=(const oslPipe pipe);
121
125 inline bool SAL_CALL isValid() const;
126
127 inline bool SAL_CALL operator==(const Pipe& rPipe) const;
128
131 inline void SAL_CALL close();
132
135 inline oslPipeError SAL_CALL accept(StreamPipe& Connection);
136
142 inline oslPipeError SAL_CALL getError() const;
143
144 inline oslPipe SAL_CALL getHandle() const;
145};
146
149 class StreamPipe : public Pipe
150{
151public:
156 inline StreamPipe();
157
162 inline StreamPipe(oslPipe Pipe);
163
169 inline StreamPipe(const ::rtl::OUString& strName, oslPipeOptions Options = osl_Pipe_OPEN);
170
177 inline StreamPipe(const ::rtl::OUString& strName, oslPipeOptions Options, const Security& rSec);
178
181 inline StreamPipe(oslPipe pipe, __sal_NoAcquire noacquire);
182
189 inline StreamPipe& SAL_CALL operator=(oslPipe Pipe);
190
193 inline StreamPipe& SAL_CALL operator=(const Pipe& pipe);
194
204 inline sal_Int32 SAL_CALL recv(void* pBuffer, sal_Int32 BytesToRead) const;
205
214 inline sal_Int32 SAL_CALL send(const void* pBuffer, sal_Int32 BytesToSend) const;
215
226 inline sal_Int32 SAL_CALL read(void* pBuffer, sal_Int32 n) const;
227
237 sal_Int32 SAL_CALL write(const void* pBuffer, sal_Int32 n) const;
238};
239}
240#endif
241
242/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
__sal_NoAcquire
__sal_NoAcquire
Definition types.h:353
ustring.hxx
pipe.h
oslPipeError
oslPipeError
Definition pipe.h:37
oslPipeOptions
sal_uInt32 oslPipeOptions
Pipe creation options.
Definition pipe.h:56
osl_Pipe_OPEN
#define osl_Pipe_OPEN
Definition pipe.h:57
oslPipe
struct oslPipeImpl * oslPipe
Definition pipe.h:60
security.hxx
osl
Definition condition.hxx:31
osl::Pipe
Represents a pipe.
Definition pipe_decl.hxx:37
osl::Pipe::is
bool is() const
Definition pipe.hxx:125
osl::Pipe::isValid
bool isValid() const
Checks if the pipe is valid.
osl::Pipe::Pipe
Pipe()
Does not create a pipe.
Definition pipe.hxx:35
osl::Pipe::~Pipe
~Pipe()
Destructor.
Definition pipe.hxx:76
osl::Pipe::getError
oslPipeError getError() const
Delivers a constant describing the last error for the pipe system.
Definition pipe.hxx:163
osl::Pipe::operator=
Pipe & operator=(const Pipe &pipe)
Assignment operator.
Definition pipe.hxx:97
osl::Pipe::m_handle
oslPipe m_handle
Definition pipe_decl.hxx:39
osl::Pipe::getHandle
oslPipe getHandle() const
Definition pipe.hxx:169
osl::Pipe::close
void close()
Closes the pipe.
Definition pipe.hxx:137
osl::Pipe::accept
oslPipeError accept(StreamPipe &Connection)
Accept connection on an existing pipe.
Definition pipe.hxx:153
osl::Pipe::operator==
bool operator==(const Pipe &rPipe) const
Definition pipe.hxx:131
osl::Pipe::create
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:83
osl::Pipe::clear
void clear()
releases the underlying handle
Definition pipe.hxx:143
osl::StreamPipe
A pipe to send or receive a stream of data.
Definition pipe_decl.hxx:150
osl::StreamPipe::StreamPipe
StreamPipe()
Creates an unattached pipe.
Definition pipe.hxx:175
osl::StreamPipe::write
sal_Int32 write(const void *pBuffer, sal_Int32 n) const
Writes n bytes from pBuffer to the stream.
Definition pipe.hxx:204
osl::StreamPipe::recv
sal_Int32 recv(void *pBuffer, sal_Int32 BytesToRead) const
Tries to receives BytesToRead data from the connected pipe,.
Definition pipe.hxx:210
osl::StreamPipe::read
sal_Int32 read(void *pBuffer, sal_Int32 n) const
Retrieves n bytes from the stream and copies them into pBuffer.
Definition pipe.hxx:198
osl::StreamPipe::send
sal_Int32 send(const void *pBuffer, sal_Int32 BytesToSend) const
Tries to sends BytesToSend data from the connected pipe.
Definition pipe.hxx:216
osl::StreamPipe::operator=
StreamPipe & operator=(const Pipe &pipe)
Assignment operator.
osl::StreamPipe::operator=
StreamPipe & operator=(oslPipe Pipe)
Attaches the oslPipe to this object.
osl::Security
Encapsulate security information for one user.
Definition security_decl.hxx:39