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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
/*
For wchar support, you need to include the wchar.i file
before this file, ie:
%include <wchar.i>
%include <std_sstream.i>
or equivalently, just include
%include <std_wsstream.i>
*/
%include <std_alloc.i>
%include <std_basic_string.i>
%include <std_string.i>
%include <std_ios.i>
#if defined(SWIG_WCHAR)
%include <std_wstring.i>
#endif
%include <std_streambuf.i>
%include <std_iostream.i>
%{
#include <sstream>
%}
namespace std
{
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
// 251. basic_stringbuf missing allocator_type
typedef _Alloc allocator_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
public:
// Constructors:
explicit
basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out);
explicit
basic_stringbuf(const basic_string<_CharT, _Traits, _Alloc>& __str,
ios_base::openmode __mode = ios_base::in | ios_base::out);
// Get and set:
basic_string<_CharT, _Traits, _Alloc>
str() const;
void
str(const basic_string<_CharT, _Traits, _Alloc>& __s);
};
// 27.7.2 Template class basic_istringstream
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_istringstream : public basic_istream<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
// 251. basic_stringbuf missing allocator_type
typedef _Alloc allocator_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
public:
// Constructors:
explicit
basic_istringstream(ios_base::openmode __mode = ios_base::in);
explicit
basic_istringstream(const basic_string<_CharT, _Traits, _Alloc>& __str,
ios_base::openmode __mode = ios_base::in);
~basic_istringstream();
// Members:
basic_stringbuf<_CharT, _Traits, _Alloc>*
rdbuf() const;
basic_string<_CharT, _Traits, _Alloc>
str() const;
void
str(const basic_string<_CharT, _Traits, _Alloc>& __s);
};
// 27.7.3 Template class basic_ostringstream
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_ostringstream : public basic_ostream<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
// 251. basic_stringbuf missing allocator_type
typedef _Alloc allocator_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
public:
// Constructors/destructor:
explicit
basic_ostringstream(ios_base::openmode __mode = ios_base::out);
explicit
basic_ostringstream(const basic_string<_CharT, _Traits, _Alloc>& __str,
ios_base::openmode __mode = ios_base::out);
~basic_ostringstream();
// Members:
basic_stringbuf<_CharT, _Traits, _Alloc>*
rdbuf() const;
basic_string<_CharT, _Traits, _Alloc>
str() const;
#if 0
void
str(const basic_string<_CharT, _Traits, _Alloc>& __s);
#endif
};
// 27.7.4 Template class basic_stringstream
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_stringstream : public basic_iostream<_CharT, _Traits>
{
public:
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
// 251. basic_stringbuf missing allocator_type
typedef _Alloc allocator_type;
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
public:
// Constructors/destructors
explicit
basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in);
explicit
basic_stringstream(const basic_string<_CharT, _Traits, _Alloc>& __str,
ios_base::openmode __m = ios_base::out | ios_base::in);
~basic_stringstream();
// Members:
basic_stringbuf<_CharT, _Traits, _Alloc>*
rdbuf() const;
basic_string<_CharT, _Traits, _Alloc>
str() const;
void
str(const basic_string<_CharT, _Traits, _Alloc>& __s);
};
} // namespace std
namespace std {
%template(istringstream) basic_istringstream<char>;
%template(ostringstream) basic_ostringstream<char>;
%template(stringstream) basic_stringstream<char>;
#if defined(SWIG_WCHAR)
%template(wistringstream) basic_istringstream<wchar_t>;
%template(wostringstream) basic_ostringstream<wchar_t>;
%template(wstringstream) basic_stringstream<wchar_t>;
#endif
}
|