-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathostringstream
39 lines (31 loc) · 963 Bytes
/
ostringstream
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
/*****************************************************************************/
// Filename: ostringstream.h
/*****************************************************************************/
// Description: This class represents an ouput stream tied to a C++ string
/*****************************************************************************/
#ifndef _O_STRING_STREAM_H
#define _O_STRING_STREAM_H
#include <ostream>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string>
using std::string;
namespace ppcStreams
{
class ostringstream : public ostream
{
friend class stringstream;
public:
ostringstream(ios::openmode mode = ios::out);
ostringstream(string output, ios::openmode mode = ios::out);
virtual ~ostringstream();
string str();
void str(string val);
protected:
virtual int OutFunction(const char* format, ...);
private:
string _output;
};
};
#endif