LibreOffice Module sd (master) 1
BufferedStreamSocket.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#pragma once
10
11#include "IBluetoothSocket.hxx"
12#include <osl/socket_decl.hxx>
13#include <vector>
14
15#define MAX_LINE_LENGTH 20000
16
17namespace sd
18{
19
29 public IBluetoothSocket,
30 private ::osl::StreamSocket
31 {
32 public:
37 explicit BufferedStreamSocket( const osl::StreamSocket &aSocket );
41 explicit BufferedStreamSocket( int aSocket );
43
45
51 virtual sal_Int32 readLine( OString& aLine ) override;
52
53 virtual sal_Int32 write( const void* pBuffer, sal_uInt32 n ) override;
54
55 virtual void close() override;
56
57 void getPeerAddr(osl::SocketAddr&);
58 private:
59 sal_Int32 aRet, aRead;
60 std::vector<char> aBuffer;
63 };
64}
65
66/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[A wrapper for an osl StreamSocket to allow reading lines.
virtual void close() override
virtual sal_Int32 write(const void *pBuffer, sal_uInt32 n) override
Write a number of bytes.
void getPeerAddr(osl::SocketAddr &)
BufferedStreamSocket(const BufferedStreamSocket &aSocket)
BufferedStreamSocket(const osl::StreamSocket &aSocket)
Create a BufferedStreamSocket on top of an osl::StreamSocket.
virtual sal_Int32 readLine(OString &aLine) override
Blocks until a line is read.
Interface for bluetooth data io.