tudocomp
– The TU Dortmund Compression Framework
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Functions
_
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
v
w
z
Variables
+
Typedefs
b
c
d
f
i
l
m
n
o
p
q
s
u
v
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
+
Variables
_
a
b
c
d
e
g
h
i
l
m
n
o
p
r
s
t
u
w
x
y
+
Typedefs
a
c
d
e
h
i
k
l
n
p
r
s
t
v
Enumerations
+
Related Functions
a
b
d
g
i
l
o
s
u
+
Files
File List
+
File Members
+
All
_
a
d
f
g
i
l
m
o
p
s
t
u
w
+
Functions
_
f
o
u
Variables
Typedefs
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
VectorStreamBuffer.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <streambuf>
4
#include <vector>
5
6
namespace
tdc
{
7
namespace
io {
8
10
11
template
<
typename
T>
12
class
VectorStreamBuffer :
public
std::streambuf {
13
14
private
:
15
std::vector<T> *m_vec;
16
17
public
:
18
VectorStreamBuffer(std::vector<T>& vec) : m_vec(&vec) {
19
}
20
21
virtual
~VectorStreamBuffer() {
22
}
23
24
protected
:
25
virtual
int
overflow(
int
ch)
override
{
26
if
(ch == EOF) {
27
return
EOF;
28
}
else
{
29
m_vec->push_back((T)ch);
30
return
ch;
31
}
32
}
33
34
virtual
int
underflow()
override
{
35
return
EOF;
36
}
37
};
38
40
41
}}
42
tdc
Contains the text compression and encoding framework.
Definition:
namespaces.hpp:11
include
tudocomp
io
VectorStreamBuffer.hpp
Generated by
1.8.13