RInside Version 0.2.16
MemBuf.h
Go to the documentation of this file.
1 // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 //
3 // MemBuf.h: R/C++ interface class library -- Easier R embedding into C++
4 //
5 // Copyright (C) 2009 Dirk Eddelbuettel
6 // Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
7 //
8 // This file is part of RInside.
9 //
10 // RInside is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 2 of the License, or
13 // (at your option) any later version.
14 //
15 // RInside is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with RInside. If not, see <http://www.gnu.org/licenses/>.
22 
23 class MemBuf { // simple C++-ification of littler's membuf
24 private:
25  std::string buffer ;
26 
27 public:
28  MemBuf(int sizebytes=1024);
29  ~MemBuf();
30  void resize();
31  void rewind();
32  void add(const std::string& );
33  inline const char* getBufPtr() { return buffer.c_str() ; };
34 };
~MemBuf()
Definition: MemBuf.cpp:32
void rewind()
Definition: MemBuf.cpp:42
Definition: MemBuf.h:23
std::string buffer
Definition: MemBuf.h:25
MemBuf(int sizebytes=1024)
Definition: MemBuf.cpp:34
void add(const std::string &)
Definition: MemBuf.cpp:46
const char * getBufPtr()
Definition: MemBuf.h:33
void resize()
Definition: MemBuf.cpp:38