1
/*************************************************************************
4
** This file is part of dvisvgm -- the DVI to SVG converter **
5
** Copyright (C) 2005-2014 Martin Gieseking <martin.gieseking@uos.de> **
7
** This program is free software; you can redistribute it and/or **
8
** modify it under the terms of the GNU General Public License as **
9
** published by the Free Software Foundation; either version 3 of **
10
** the License, or (at your option) any later version. **
12
** This program is distributed in the hope that it will be useful, but **
13
** WITHOUT ANY WARRANTY; without even the implied warranty of **
14
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
15
** GNU General Public License for more details. **
17
** You should have received a copy of the GNU General Public License **
18
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
19
*************************************************************************/
21
#ifndef DVISVGM_VECTORSTREAM_H
22
#define DVISVGM_VECTORSTREAM_H
29
struct VectorStreamBuffer : public std::streambuf
31
VectorStreamBuffer (std::vector<T> &source) {
32
setg((char*)&source[0], (char*)&source[0], (char*)&source[0]+source.size());
38
class VectorInputStream : public std::istream
41
VectorInputStream (std::vector<T> &source) : std::istream(&_buf), _buf(source) {}
43
VectorStreamBuffer<T> _buf;