-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsstream
41 lines (34 loc) · 1.06 KB
/
sstream
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*****************************************************************************/
// Filename: sstream.h
/*****************************************************************************/
// Description: This class represents an input/output stream tie to
// a string
/*****************************************************************************/
#ifndef _STRING_STREAM_H
#define _STRING_STREAM_H
#include <iostream>
#include <istringstream>
#include <ostringstream>
#include <string>
using std::string;
namespace ppcStreams
{
class stringstream : public iostream
{
public:
stringstream(ios::openmode mode = ios::in | ios::out);
stringstream(string inout, ios::openmode mode = ios::in | ios::out);
virtual ~stringstream();
string str();
void str(string val);
protected:
virtual int OutFunction(const char* format, ...);
virtual int InFunction(const char* format, ...);
private:
int _currentPosition;
istringstream _input;
ostringstream _output;
string _commonString;
};
};
#endif