Deskflow
1.26.0.418
Keyboard and mouse sharing utility
Toggle main menu visibility
Loading...
Searching...
No Matches
StreamBuffer.h
Go to the documentation of this file.
1
/*
2
* Deskflow -- mouse and keyboard sharing utility
3
* SPDX-FileCopyrightText: (C) 2012 - 2016 Synergy App Ltd
4
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
5
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6
*/
7
8
#pragma once
9
10
#include <cstdint>
11
#include <list>
12
#include <vector>
13
15
18
class
StreamBuffer
19
{
20
public
:
21
StreamBuffer
() =
default
;
22
~StreamBuffer
() =
default
;
23
25
26
28
33
const
void
*
peek
(uint32_t n);
34
36
40
void
pop
(uint32_t n);
41
43
46
void
write
(
const
void
*
data
, uint32_t n);
47
49
51
53
56
uint32_t
getSize
()
const
;
57
59
60
private
:
61
static
const
uint32_t kChunkSize;
62
63
using
Chunk = std::vector<uint8_t>;
64
using
ChunkList = std::list<Chunk>;
65
66
ChunkList m_chunks;
67
uint32_t m_size = 0;
68
uint32_t m_headUsed = 0;
69
};
data
static int void FAR * data
Definition
ArchNetworkWinsock.cpp:36
StreamBuffer::pop
void pop(uint32_t n)
Discard data.
Definition
StreamBuffer.cpp:43
StreamBuffer::write
void write(const void *data, uint32_t n)
Write data to buffer.
Definition
StreamBuffer.cpp:72
StreamBuffer::~StreamBuffer
~StreamBuffer()=default
StreamBuffer::getSize
uint32_t getSize() const
Get size of buffer.
Definition
StreamBuffer.cpp:118
StreamBuffer::StreamBuffer
StreamBuffer()=default
StreamBuffer::peek
const void * peek(uint32_t n)
Read data without removing from buffer.
Definition
StreamBuffer.cpp:18
src
lib
io
StreamBuffer.h
Generated by
1.18.0