File: vcl_sstream.h

package info (click to toggle)
insighttoolkit 3.6.0-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 94,956 kB
  • ctags: 74,981
  • sloc: cpp: 355,621; ansic: 195,070; fortran: 28,713; python: 3,802; tcl: 1,996; sh: 1,175; java: 583; makefile: 415; csh: 184; perl: 175
file content (48 lines) | stat: -rw-r--r-- 1,331 bytes parent folder | download | duplicates (8)
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
42
43
44
45
46
47
48
#ifndef vcl_sstream_h_
#define vcl_sstream_h_
// fsm
#include "vcl_compiler.h"

#if VCL_CXX_HAS_HEADER_SSTREAM
# include "iso/vcl_sstream.h"
#else // assuming <strstream.h> exists
# include "vcl_iostream.h" // this is to get the vcl_ios_* macros.
# include <strstream.h>
# include <vcl_string.h>

# undef  vcl_stringstream
# define vcl_stringstream vcl_stringstream
struct vcl_stringstream : public strstream
{
  vcl_stringstream(int /*which*/ = vcl_ios_in | vcl_ios_out) { }
  vcl_stringstream(vcl_string const &s, int which = vcl_ios_in | vcl_ios_out)
    : strstream((char*)s.c_str(), (int)strlen(s.c_str()), which) { }

  // [27.7.4]
  vcl_string str() { return strstream::str(); }
  //FIXME void str(vcl_string const &s);
};

# undef  vcl_istringstream
# define vcl_istringstream vcl_istringstream
struct vcl_istringstream : public istrstream
{
  vcl_istringstream(vcl_string const &s) : istrstream(s.c_str()) { }

  // [27.7.2.2]
  vcl_string str() { return istrstream::rdbuf()->str(); }
  //FIXME void str(vcl_string const &s);
};

# undef  vcl_ostringstream
# define vcl_ostringstream vcl_ostringstream
struct vcl_ostringstream : public ostrstream
{
  // [27.7.3.2]
  vcl_string str() { return ostrstream::str(); }
  //FIXME void str(vcl_string const &s);
};

#endif // VCL_CXX_HAS_HEADER_SSTREAM

#endif // vcl_sstream_h_