summaryrefslogtreecommitdiff
path: root/dviware/dvi2bitmap/stringstream.h
blob: b3c5e8e6454ab223651797fa34ffee762febbc2b (plain)
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
/* This file is part of dvi2bitmap; see README for copyrights and licence */

#ifndef STRINGSTREAM_H_LOADED
#define STRINGSTREAM_H_LOADED 1

#include <config.h>

#ifdef HAVE_SSTREAM

#include <sstream>
#define SSTREAM ostringstream
#define SS_C_STR(s) (s).str().c_str()
#define SS_STRING(s) (s).str()

using STD::ostringstream;

#elif HAVE_STRSTREAM

#include <strstream>
#define SSTREAM ostrstream
#define SS_C_STR(s) (s).str()
/* Add the end-of-string to the stringbuf and convert it to a string */
#define SS_STRING(s) ((s)<<ends,string((s).str()))

using STD::ostrstream;
using STD::ends;

#else
#error "Neither HAVE_SSTREAM nor HAVE_STRSTREAM is defined!"
#endif

#endif /* STRINGSTREAM_H_LOADED */