gccxml_gem 0.9.3-x86-darwin-11
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +84 -0
- data/bin/gccxml +0 -0
- data/bin/gccxml_cc1plus +0 -0
- data/gccxml.rb +57 -0
- data/share/doc/gccxml-0.9/Copyright.txt +55 -0
- data/share/doc/gccxml-0.9/gccxml.html +168 -0
- data/share/doc/gccxml-0.9/gccxml.txt +293 -0
- data/share/gccxml-0.9/GCC/2.95/algorithm +76 -0
- data/share/gccxml-0.9/GCC/2.95/bitset +17 -0
- data/share/gccxml-0.9/GCC/2.95/cctype +24 -0
- data/share/gccxml-0.9/GCC/2.95/clocale +14 -0
- data/share/gccxml-0.9/GCC/2.95/cmath +33 -0
- data/share/gccxml-0.9/GCC/2.95/complex +38 -0
- data/share/gccxml-0.9/GCC/2.95/csetjmp +13 -0
- data/share/gccxml-0.9/GCC/2.95/csignal +14 -0
- data/share/gccxml-0.9/GCC/2.95/cstdarg +12 -0
- data/share/gccxml-0.9/GCC/2.95/cstddef +13 -0
- data/share/gccxml-0.9/GCC/2.95/cstdio +55 -0
- data/share/gccxml-0.9/GCC/2.95/cstdlib +66 -0
- data/share/gccxml-0.9/GCC/2.95/cstring +34 -0
- data/share/gccxml-0.9/GCC/2.95/ctime +24 -0
- data/share/gccxml-0.9/GCC/2.95/cwchar +65 -0
- data/share/gccxml-0.9/GCC/2.95/cwctype +31 -0
- data/share/gccxml-0.9/GCC/2.95/deque +19 -0
- data/share/gccxml-0.9/GCC/2.95/exception +20 -0
- data/share/gccxml-0.9/GCC/2.95/fstream +23 -0
- data/share/gccxml-0.9/GCC/2.95/functional +64 -0
- data/share/gccxml-0.9/GCC/2.95/gccxml_bitset +1066 -0
- data/share/gccxml-0.9/GCC/2.95/iomanip +20 -0
- data/share/gccxml-0.9/GCC/2.95/iosfwd +20 -0
- data/share/gccxml-0.9/GCC/2.95/iostream +27 -0
- data/share/gccxml-0.9/GCC/2.95/iterator +39 -0
- data/share/gccxml-0.9/GCC/2.95/list +19 -0
- data/share/gccxml-0.9/GCC/2.95/map +20 -0
- data/share/gccxml-0.9/GCC/2.95/memory +21 -0
- data/share/gccxml-0.9/GCC/2.95/new +13 -0
- data/share/gccxml-0.9/GCC/2.95/numeric +15 -0
- data/share/gccxml-0.9/GCC/2.95/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/2.95/queue +20 -0
- data/share/gccxml-0.9/GCC/2.95/set +20 -0
- data/share/gccxml-0.9/GCC/2.95/sstream +24 -0
- data/share/gccxml-0.9/GCC/2.95/stack +19 -0
- data/share/gccxml-0.9/GCC/2.95/std/bastring.cc +524 -0
- data/share/gccxml-0.9/GCC/2.95/std/complext.h +397 -0
- data/share/gccxml-0.9/GCC/2.95/std/dcomplex.h +92 -0
- data/share/gccxml-0.9/GCC/2.95/std/fcomplex.h +88 -0
- data/share/gccxml-0.9/GCC/2.95/std/gslice_array.h +170 -0
- data/share/gccxml-0.9/GCC/2.95/std/indirect_array.h +157 -0
- data/share/gccxml-0.9/GCC/2.95/std/ldcomplex.h +96 -0
- data/share/gccxml-0.9/GCC/2.95/std/mask_array.h +154 -0
- data/share/gccxml-0.9/GCC/2.95/std/slice_array.h +156 -0
- data/share/gccxml-0.9/GCC/2.95/std/std_valarray.h +728 -0
- data/share/gccxml-0.9/GCC/2.95/std/straits.h +162 -0
- data/share/gccxml-0.9/GCC/2.95/std/valarray_meta.h +1035 -0
- data/share/gccxml-0.9/GCC/2.95/stdexcept +17 -0
- data/share/gccxml-0.9/GCC/2.95/stl_alloc.h +1057 -0
- data/share/gccxml-0.9/GCC/2.95/stl_bvector.h +836 -0
- data/share/gccxml-0.9/GCC/2.95/stl_deque.h +1699 -0
- data/share/gccxml-0.9/GCC/2.95/stl_list.h +843 -0
- data/share/gccxml-0.9/GCC/2.95/stl_tree.h +1331 -0
- data/share/gccxml-0.9/GCC/2.95/stl_vector.h +828 -0
- data/share/gccxml-0.9/GCC/2.95/string +26 -0
- data/share/gccxml-0.9/GCC/2.95/strstream +23 -0
- data/share/gccxml-0.9/GCC/2.95/typeinfo +11 -0
- data/share/gccxml-0.9/GCC/2.95/utility +25 -0
- data/share/gccxml-0.9/GCC/2.95/valarray +52 -0
- data/share/gccxml-0.9/GCC/2.95/vector +19 -0
- data/share/gccxml-0.9/GCC/2.96/sstream +305 -0
- data/share/gccxml-0.9/GCC/3.0/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/3.1/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/3.2/bits/fstream.tcc +500 -0
- data/share/gccxml-0.9/GCC/3.2/bits/gthr-default.h +585 -0
- data/share/gccxml-0.9/GCC/3.2/bits/istream.tcc +1207 -0
- data/share/gccxml-0.9/GCC/3.2/bits/locale_facets.h +1810 -0
- data/share/gccxml-0.9/GCC/3.2/bits/locale_facets.tcc +2397 -0
- data/share/gccxml-0.9/GCC/3.2/bits/messages_members.h +108 -0
- data/share/gccxml-0.9/GCC/3.2/bits/ostream.tcc +713 -0
- data/share/gccxml-0.9/GCC/3.2/bits/sstream.tcc +241 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_deque.h +1682 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_list.h +989 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_tree.h +1462 -0
- data/share/gccxml-0.9/GCC/3.2/bits/stl_vector.h +1085 -0
- data/share/gccxml-0.9/GCC/3.2/bits/valarray_meta.h +1063 -0
- data/share/gccxml-0.9/GCC/3.2/fstream +579 -0
- data/share/gccxml-0.9/GCC/3.2/pthread.h +16 -0
- data/share/gccxml-0.9/GCC/3.2/sstream +384 -0
- data/share/gccxml-0.9/GCC/3.3/bits/fstream.tcc +530 -0
- data/share/gccxml-0.9/GCC/3.3/bits/list.tcc +378 -0
- data/share/gccxml-0.9/GCC/3.3/bits/locale_facets.h +2050 -0
- data/share/gccxml-0.9/GCC/3.3/bits/messages_members.h +108 -0
- data/share/gccxml-0.9/GCC/3.3/bits/sstream.tcc +243 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_deque.h +1603 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_list.h +1167 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_tree.h +1462 -0
- data/share/gccxml-0.9/GCC/3.3/bits/stl_vector.h +992 -0
- data/share/gccxml-0.9/GCC/3.3/bits/valarray_meta.h +1135 -0
- data/share/gccxml-0.9/GCC/3.3/fstream +842 -0
- data/share/gccxml-0.9/GCC/3.3/gccxml_builtins.h +22 -0
- data/share/gccxml-0.9/GCC/3.3/sstream +638 -0
- data/share/gccxml-0.9/GCC/3.4/bits/gthr-default.h +669 -0
- data/share/gccxml-0.9/GCC/3.4/gccxml_builtins.h +91 -0
- data/share/gccxml-0.9/GCC/4.0/emmintrin.h +5 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_apple_emmintrin.h +1037 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_apple_mmintrin.h +669 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_apple_xmmintrin.h +870 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_builtins.h +128 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_gnu_emmintrin.h +977 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_gnu_mmintrin.h +636 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_gnu_xmmintrin.h +833 -0
- data/share/gccxml-0.9/GCC/4.0/mmintrin.h +5 -0
- data/share/gccxml-0.9/GCC/4.0/xmmintrin.h +5 -0
- data/share/gccxml-0.9/GCC/4.1/bits/gthr-default.h +622 -0
- data/share/gccxml-0.9/GCC/4.1/emmintrin.h +5 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_apple_emmintrin.h +1509 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_apple_mmintrin.h +942 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_apple_xmmintrin.h +1192 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_builtins.h +131 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_gnu_emmintrin.h +1004 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_gnu_mmintrin.h +637 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_gnu_xmmintrin.h +834 -0
- data/share/gccxml-0.9/GCC/4.1/mmintrin.h +5 -0
- data/share/gccxml-0.9/GCC/4.1/xmmintrin.h +5 -0
- data/share/gccxml-0.9/GCC/4.2/emmintrin.h +5 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_apple_emmintrin.h +1509 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_apple_mmintrin.h +942 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_apple_xmmintrin.h +1192 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_builtins.h +131 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_gnu_emmintrin.h +1013 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_gnu_mmintrin.h +663 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_gnu_xmmintrin.h +860 -0
- data/share/gccxml-0.9/GCC/4.2/mmintrin.h +5 -0
- data/share/gccxml-0.9/GCC/4.2/xmmintrin.h +5 -0
- data/share/gccxml-0.9/GCC/4.3/emmintrin.h +1043 -0
- data/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h +183 -0
- data/share/gccxml-0.9/GCC/4.3/mmintrin.h +663 -0
- data/share/gccxml-0.9/GCC/4.3/xmmintrin.h +867 -0
- data/share/gccxml-0.9/GCC/4.4/bits/c++config.h +1431 -0
- data/share/gccxml-0.9/GCC/4.4/emmintrin.h +1041 -0
- data/share/gccxml-0.9/GCC/4.4/gccxml_builtins.h +153 -0
- data/share/gccxml-0.9/GCC/4.4/mmintrin.h +662 -0
- data/share/gccxml-0.9/GCC/4.4/xmmintrin.h +864 -0
- data/share/gccxml-0.9/GCC/4.5/gccxml_builtins.h +154 -0
- data/share/gccxml-0.9/GCC/4.5/iomanip +349 -0
- data/share/gccxml-0.9/GCC/COPYING.RUNTIME +73 -0
- data/share/gccxml-0.9/GCC/COPYING3 +674 -0
- data/share/gccxml-0.9/IBM/8.0/adapt_headers.sh +34 -0
- data/share/gccxml-0.9/IBM/8.0/stdlib.h.patch +27 -0
- data/share/gccxml-0.9/IBM/8.0/xstring.patch +19 -0
- data/share/gccxml-0.9/IBM/README +8 -0
- data/share/gccxml-0.9/IBM/find_flags +51 -0
- data/share/gccxml-0.9/IBM/find_flags_common +48 -0
- data/share/gccxml-0.9/Intel/find_flags +56 -0
- data/share/gccxml-0.9/Intel/pthread.h +16 -0
- data/share/gccxml-0.9/MIPSpro/7.3/exception +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/gccxml_mpro_internals.h +21 -0
- data/share/gccxml-0.9/MIPSpro/7.3/iomanip +161 -0
- data/share/gccxml-0.9/MIPSpro/7.3/ostream +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stddef.h +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_config.h +9 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_locale.h +17 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_monetary.h +14 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_numeric_facets.h +13 -0
- data/share/gccxml-0.9/MIPSpro/7.3/stl_threads.h +11 -0
- data/share/gccxml-0.9/MIPSpro/7.3/string +18 -0
- data/share/gccxml-0.9/MIPSpro/find_flags +70 -0
- data/share/gccxml-0.9/MIPSpro/mipspro_defs.cxx +63 -0
- data/share/gccxml-0.9/Sun/5.8/Cstd.patch +156 -0
- data/share/gccxml-0.9/Sun/5.8/adapt_headers.sh +32 -0
- data/share/gccxml-0.9/Sun/5.8/std-5.10.patch +22 -0
- data/share/gccxml-0.9/Sun/README +8 -0
- data/share/gccxml-0.9/Sun/find_flags +51 -0
- data/share/gccxml-0.9/Sun/find_flags_common +42 -0
- data/share/gccxml-0.9/gccxml_config +2 -0
- data/share/gccxml-0.9/gccxml_identify_compiler.cc +13 -0
- data/share/man/man1/gccxml.1 +246 -0
- metadata +243 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
#ifndef GCCXML_STRING
|
2
|
+
#define GCCXML_STRING
|
3
|
+
|
4
|
+
#include_next <string>
|
5
|
+
|
6
|
+
// 21.2/2
|
7
|
+
namespace std
|
8
|
+
{
|
9
|
+
//using ::char_traits;
|
10
|
+
using ::basic_string;
|
11
|
+
using ::operator+;
|
12
|
+
using ::operator==;
|
13
|
+
using ::operator!=;
|
14
|
+
using ::operator<;
|
15
|
+
using ::operator>;
|
16
|
+
using ::operator<=;
|
17
|
+
using ::operator>=;
|
18
|
+
//using ::swap;
|
19
|
+
using ::operator>>;
|
20
|
+
using ::operator<<;
|
21
|
+
using ::getline;
|
22
|
+
using ::string;
|
23
|
+
//using ::wstring;
|
24
|
+
}
|
25
|
+
|
26
|
+
#endif
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#ifndef GCCXML_STRSTREAM
|
2
|
+
#define GCCXML_STRSTREAM
|
3
|
+
|
4
|
+
#include_next <strstream>
|
5
|
+
|
6
|
+
// GCC 2.95 does not conform.
|
7
|
+
namespace std
|
8
|
+
{
|
9
|
+
using ::ios;
|
10
|
+
using ::streamoff;
|
11
|
+
using ::streampos;
|
12
|
+
using ::streamsize;
|
13
|
+
using ::streambuf;
|
14
|
+
using ::istream;
|
15
|
+
using ::ostream;
|
16
|
+
using ::iostream;
|
17
|
+
using ::istrstream;
|
18
|
+
using ::ostrstream;
|
19
|
+
using ::strstream;
|
20
|
+
using ::ends;
|
21
|
+
}
|
22
|
+
|
23
|
+
#endif
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#ifndef GCCXML_UTILITY
|
2
|
+
#define GCCXML_UTILITY
|
3
|
+
|
4
|
+
#include_next <utility>
|
5
|
+
|
6
|
+
// 20.2/1
|
7
|
+
namespace std
|
8
|
+
{
|
9
|
+
namespace rel_ops
|
10
|
+
{
|
11
|
+
using ::operator!=;
|
12
|
+
using ::operator>;
|
13
|
+
using ::operator<=;
|
14
|
+
using ::operator>=;
|
15
|
+
}
|
16
|
+
using ::pair;
|
17
|
+
using ::operator==;
|
18
|
+
using ::operator!=;
|
19
|
+
using ::operator<;
|
20
|
+
using ::operator>;
|
21
|
+
using ::operator<=;
|
22
|
+
using ::operator>=;
|
23
|
+
}
|
24
|
+
|
25
|
+
#endif
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#ifndef GCCXML_VALARRAY
|
2
|
+
#define GCCXML_VALARRAY
|
3
|
+
|
4
|
+
#include_next <valarray>
|
5
|
+
|
6
|
+
// 26.3.1
|
7
|
+
namespace std
|
8
|
+
{
|
9
|
+
using ::valarray;
|
10
|
+
using ::slice;
|
11
|
+
using ::slice_array;
|
12
|
+
using ::gslice;
|
13
|
+
using ::gslice_array;
|
14
|
+
using ::mask_array;
|
15
|
+
using ::indirect_array;
|
16
|
+
using ::operator*;
|
17
|
+
using ::operator/;
|
18
|
+
using ::operator%;
|
19
|
+
using ::operator+;
|
20
|
+
using ::operator-;
|
21
|
+
using ::operator^;
|
22
|
+
using ::operator&;
|
23
|
+
using ::operator|;
|
24
|
+
using ::operator<<;
|
25
|
+
using ::operator>>;
|
26
|
+
using ::operator&&;
|
27
|
+
using ::operator||;
|
28
|
+
using ::operator==;
|
29
|
+
using ::operator!=;
|
30
|
+
using ::operator<;
|
31
|
+
using ::operator>;
|
32
|
+
using ::operator<=;
|
33
|
+
using ::operator>=;
|
34
|
+
using ::abs;
|
35
|
+
using ::acos;
|
36
|
+
using ::asin;
|
37
|
+
using ::atan;
|
38
|
+
using ::atan2;
|
39
|
+
using ::cos;
|
40
|
+
using ::cosh;
|
41
|
+
using ::exp;
|
42
|
+
using ::log;
|
43
|
+
using ::log10;
|
44
|
+
using ::pow;
|
45
|
+
using ::sin;
|
46
|
+
using ::sinh;
|
47
|
+
using ::sqrt;
|
48
|
+
using ::tan;
|
49
|
+
using ::tanh;
|
50
|
+
}
|
51
|
+
|
52
|
+
#endif
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#ifndef GCCXML_VECTOR
|
2
|
+
#define GCCXML_VECTOR
|
3
|
+
|
4
|
+
#include_next <vector>
|
5
|
+
|
6
|
+
// 23.2
|
7
|
+
namespace std
|
8
|
+
{
|
9
|
+
using ::vector;
|
10
|
+
using ::operator==;
|
11
|
+
using ::operator!=;
|
12
|
+
using ::operator<;
|
13
|
+
using ::operator>;
|
14
|
+
using ::operator<=;
|
15
|
+
using ::operator>=;
|
16
|
+
using ::swap;
|
17
|
+
}
|
18
|
+
|
19
|
+
#endif
|
@@ -0,0 +1,305 @@
|
|
1
|
+
#ifndef GCCXML_SSTREAM
|
2
|
+
#define GCCXML_SSTREAM
|
3
|
+
|
4
|
+
/* This is part of libio/iostream, providing -*- C++ -*- input/output.
|
5
|
+
Copyright (C) 2000 Free Software Foundation
|
6
|
+
|
7
|
+
This file is part of the GNU IO Library. This library is free
|
8
|
+
software; you can redistribute it and/or modify it under the
|
9
|
+
terms of the GNU General Public License as published by the
|
10
|
+
Free Software Foundation; either version 2, or (at your option)
|
11
|
+
any later version.
|
12
|
+
|
13
|
+
This library is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this library; see the file COPYING. If not, write to the Free
|
20
|
+
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
21
|
+
|
22
|
+
As a special exception, if you link this library with files
|
23
|
+
compiled with a GNU compiler to produce an executable, this does not cause
|
24
|
+
the resulting executable to be covered by the GNU General Public License.
|
25
|
+
This exception does not however invalidate any other reasons why
|
26
|
+
the executable file might be covered by the GNU General Public License. */
|
27
|
+
|
28
|
+
/* Written by Magnus Fromreide (magfr@lysator.liu.se). */
|
29
|
+
|
30
|
+
#ifndef __SSTREAM__
|
31
|
+
#define __SSTREAM__
|
32
|
+
|
33
|
+
#include <string>
|
34
|
+
#include <iostream.h>
|
35
|
+
#include <streambuf.h>
|
36
|
+
|
37
|
+
namespace std
|
38
|
+
{
|
39
|
+
class stringbuf : public streambuf
|
40
|
+
{
|
41
|
+
public:
|
42
|
+
typedef char char_type;
|
43
|
+
typedef int int_type;
|
44
|
+
typedef streampos pos_type;
|
45
|
+
typedef streamoff off_type;
|
46
|
+
|
47
|
+
explicit stringbuf(int which=ios::in|ios::out) :
|
48
|
+
streambuf(which), buf(), mode(static_cast<ios::open_mode>(which)),
|
49
|
+
rpos(0), bufsize(1)
|
50
|
+
{ }
|
51
|
+
|
52
|
+
explicit stringbuf(const std::string &s, int which=ios::in|ios::out) :
|
53
|
+
streambuf(which), buf(s), mode(static_cast<ios::open_mode>(which)),
|
54
|
+
bufsize(1)
|
55
|
+
{
|
56
|
+
if(mode & ios::in)
|
57
|
+
{
|
58
|
+
setg(&defbuf, &defbuf + bufsize, &defbuf + bufsize);
|
59
|
+
}
|
60
|
+
if(mode & ios::out)
|
61
|
+
{
|
62
|
+
setp(&defbuf, &defbuf + bufsize);
|
63
|
+
}
|
64
|
+
rpos = (mode & ios::ate ? s.size() : 0);
|
65
|
+
}
|
66
|
+
|
67
|
+
std::string str() const
|
68
|
+
{
|
69
|
+
const_cast<stringbuf*>(this)->sync(); // Sigh, really ugly hack
|
70
|
+
return buf;
|
71
|
+
};
|
72
|
+
|
73
|
+
void str(const std::string& s)
|
74
|
+
{
|
75
|
+
buf = s;
|
76
|
+
if(mode & ios::in)
|
77
|
+
{
|
78
|
+
gbump(egptr() - gptr());
|
79
|
+
}
|
80
|
+
if(mode & ios::out)
|
81
|
+
{
|
82
|
+
pbump(pbase() - pptr());
|
83
|
+
}
|
84
|
+
rpos = (mode & ios::ate ? s.size() : 0);
|
85
|
+
}
|
86
|
+
inline streampos seekoff(streamoff o, _seek_dir d, int mode=ios::in|ios::out);
|
87
|
+
inline streampos seekpos(streampos pos, int mode = ios::in|ios::out);
|
88
|
+
|
89
|
+
protected:
|
90
|
+
inline virtual int sync();
|
91
|
+
inline virtual int overflow(int = EOF);
|
92
|
+
inline virtual int underflow();
|
93
|
+
private:
|
94
|
+
std::string buf;
|
95
|
+
ios::open_mode mode;
|
96
|
+
std::string::size_type rpos;
|
97
|
+
streamsize bufsize;
|
98
|
+
char defbuf;
|
99
|
+
};
|
100
|
+
|
101
|
+
class stringstreambase : virtual public ios {
|
102
|
+
protected:
|
103
|
+
stringbuf __my_sb;
|
104
|
+
public:
|
105
|
+
std::string str() const
|
106
|
+
{
|
107
|
+
return dynamic_cast<stringbuf*>(_strbuf)->str();
|
108
|
+
}
|
109
|
+
void str(const std::string& s)
|
110
|
+
{
|
111
|
+
clear();
|
112
|
+
dynamic_cast<stringbuf*>(_strbuf)->str(s);
|
113
|
+
}
|
114
|
+
|
115
|
+
stringbuf* rdbuf()
|
116
|
+
{
|
117
|
+
return &__my_sb;
|
118
|
+
}
|
119
|
+
protected:
|
120
|
+
stringstreambase(int which) :
|
121
|
+
__my_sb(which)
|
122
|
+
{
|
123
|
+
init (&__my_sb);
|
124
|
+
}
|
125
|
+
|
126
|
+
stringstreambase(const std::string& s, int which) :
|
127
|
+
__my_sb(s, which)
|
128
|
+
{
|
129
|
+
init (&__my_sb);
|
130
|
+
}
|
131
|
+
};
|
132
|
+
|
133
|
+
class istringstream : public stringstreambase, public istream {
|
134
|
+
public:
|
135
|
+
istringstream(int which=ios::in) :
|
136
|
+
stringstreambase(which)
|
137
|
+
{ }
|
138
|
+
|
139
|
+
istringstream(const std::string& s, int which=ios::in) :
|
140
|
+
stringstreambase(s, which)
|
141
|
+
{ }
|
142
|
+
|
143
|
+
istringstream& seekg(streampos pos)
|
144
|
+
{ pos = __my_sb.seekpos(pos, ios::in); if (pos == streampos(EOF)) set(ios::badbit); return *this; }
|
145
|
+
|
146
|
+
istringstream& seekg(streamoff off, _seek_dir dir)
|
147
|
+
{ off = __my_sb.seekoff(off, dir, ios::in); if (off == streamoff(EOF)) set(ios::badbit); return *this; }
|
148
|
+
|
149
|
+
streampos tellg()
|
150
|
+
{ streampos pos = __my_sb.seekoff(0, ios::cur, ios::in); if (pos == streampos(EOF)) set(ios::badbit); return pos; }
|
151
|
+
};
|
152
|
+
|
153
|
+
class ostringstream : public stringstreambase, public ostream {
|
154
|
+
public:
|
155
|
+
ostringstream(int which=ios::out) :
|
156
|
+
stringstreambase(which)
|
157
|
+
{ }
|
158
|
+
|
159
|
+
ostringstream(const std::string& s, int which=ios::out) :
|
160
|
+
stringstreambase(s, which)
|
161
|
+
{ }
|
162
|
+
|
163
|
+
ostringstream& seekp(streampos pos)
|
164
|
+
{ pos = __my_sb.seekpos(pos, ios::out); if (pos == streampos(EOF)) set(ios::badbit); return *this; }
|
165
|
+
|
166
|
+
ostringstream& seekp(streamoff off, _seek_dir dir)
|
167
|
+
{ off = __my_sb.seekoff(off, dir, ios::out); if (off == streamoff(EOF)) set(ios::badbit); return *this; }
|
168
|
+
|
169
|
+
streampos tellp()
|
170
|
+
{ streampos pos = __my_sb.seekoff(0, ios::cur, ios::out); if (pos == streampos(EOF)) set(ios::badbit); return pos; }
|
171
|
+
};
|
172
|
+
|
173
|
+
class stringstream : public stringstreambase, public iostream {
|
174
|
+
public:
|
175
|
+
stringstream(int which=ios::in|ios::out) :
|
176
|
+
stringstreambase(which)
|
177
|
+
{ }
|
178
|
+
|
179
|
+
stringstream(const std::string &s, int which=ios::in|ios::out) :
|
180
|
+
stringstreambase(s, which)
|
181
|
+
{ }
|
182
|
+
|
183
|
+
stringstream& seekg(streampos pos)
|
184
|
+
{ pos = __my_sb.seekpos(pos, ios::in); if (pos == streampos(EOF)) set(ios::badbit); return *this; }
|
185
|
+
|
186
|
+
stringstream& seekg(streamoff off, _seek_dir dir)
|
187
|
+
{ off = __my_sb.seekoff(off, dir, ios::in); if (off == streamoff(EOF)) set(ios::badbit); return *this; }
|
188
|
+
|
189
|
+
streampos tellg()
|
190
|
+
{ streampos pos = __my_sb.seekoff(0, ios::cur, ios::in); if (pos == streampos(EOF)) set(ios::badbit); return pos; }
|
191
|
+
|
192
|
+
stringstream& seekp(streampos pos)
|
193
|
+
{ pos = __my_sb.seekpos(pos, ios::out); if (pos == streampos(EOF)) set(ios::badbit); return *this; }
|
194
|
+
|
195
|
+
stringstream& seekp(streamoff off, _seek_dir dir)
|
196
|
+
{ off = __my_sb.seekoff(off, dir, ios::out); if (off == streamoff(EOF)) set(ios::badbit); return *this; }
|
197
|
+
|
198
|
+
streampos tellp()
|
199
|
+
{ streampos pos = __my_sb.seekoff(0, ios::cur, ios::out); if (pos == streampos(EOF)) set(ios::badbit); return pos; }
|
200
|
+
};
|
201
|
+
}
|
202
|
+
|
203
|
+
inline int std::stringbuf::sync()
|
204
|
+
{
|
205
|
+
if((mode & ios::out) == 0)
|
206
|
+
return EOF;
|
207
|
+
|
208
|
+
streamsize n = pptr() - pbase();
|
209
|
+
if(n)
|
210
|
+
{
|
211
|
+
buf.replace(rpos, std::string::npos, pbase(), n);
|
212
|
+
if(buf.size() - rpos != (std::string::size_type) n)
|
213
|
+
return EOF;
|
214
|
+
rpos += n;
|
215
|
+
pbump(-n);
|
216
|
+
gbump(egptr() - gptr());
|
217
|
+
}
|
218
|
+
return 0;
|
219
|
+
}
|
220
|
+
|
221
|
+
inline int std::stringbuf::overflow(int ch)
|
222
|
+
{
|
223
|
+
if((mode & ios::out) == 0)
|
224
|
+
return EOF;
|
225
|
+
|
226
|
+
streamsize n = pptr() - pbase();
|
227
|
+
|
228
|
+
if(n && sync())
|
229
|
+
return EOF;
|
230
|
+
|
231
|
+
if(ch != EOF)
|
232
|
+
{
|
233
|
+
buf.replace(rpos, std::string::npos, ch);
|
234
|
+
++rpos;
|
235
|
+
}
|
236
|
+
return 0;
|
237
|
+
}
|
238
|
+
|
239
|
+
inline int std::stringbuf::underflow()
|
240
|
+
{
|
241
|
+
sync();
|
242
|
+
if((mode & ios::in) == 0)
|
243
|
+
{
|
244
|
+
return EOF;
|
245
|
+
}
|
246
|
+
if(rpos >= buf.size())
|
247
|
+
{
|
248
|
+
return EOF;
|
249
|
+
}
|
250
|
+
|
251
|
+
std::string::size_type n = egptr() - eback();
|
252
|
+
std::string::size_type s;
|
253
|
+
|
254
|
+
s = buf.copy(eback(), n, rpos);
|
255
|
+
pbump(pbase() - pptr());
|
256
|
+
gbump(eback() - gptr());
|
257
|
+
int res = (0377 & buf[rpos]);
|
258
|
+
rpos += s;
|
259
|
+
return res;
|
260
|
+
}
|
261
|
+
|
262
|
+
inline streampos std::stringbuf::seekoff(streamoff o, _seek_dir d, int mode)
|
263
|
+
{
|
264
|
+
sync();
|
265
|
+
streamoff newpos = rpos;
|
266
|
+
switch (d)
|
267
|
+
{
|
268
|
+
case ios::beg: newpos = o; break;
|
269
|
+
case ios::cur: if ((mode & (ios::in|ios::out)) == (ios::in|ios::out))
|
270
|
+
return streampos(EOF);
|
271
|
+
newpos += o; break;
|
272
|
+
case ios::end: newpos = buf.size() + o; break;
|
273
|
+
}
|
274
|
+
if (newpos < 0 || newpos > buf.size())
|
275
|
+
return streampos(EOF);
|
276
|
+
rpos = newpos;
|
277
|
+
return newpos;
|
278
|
+
}
|
279
|
+
|
280
|
+
inline streampos std::stringbuf::seekpos(streampos pos, int mode)
|
281
|
+
{
|
282
|
+
return seekoff(pos, ios::beg, mode);
|
283
|
+
}
|
284
|
+
|
285
|
+
#endif /* not __STRSTREAM__ */
|
286
|
+
|
287
|
+
// GCC 2.95 does not conform.
|
288
|
+
namespace std
|
289
|
+
{
|
290
|
+
using ::ios;
|
291
|
+
using ::streamoff;
|
292
|
+
using ::streampos;
|
293
|
+
using ::streamsize;
|
294
|
+
using ::streambuf;
|
295
|
+
using ::istream;
|
296
|
+
using ::ostream;
|
297
|
+
using ::iostream;
|
298
|
+
}
|
299
|
+
|
300
|
+
using std::stringbuf;
|
301
|
+
using std::istringstream;
|
302
|
+
using std::ostringstream;
|
303
|
+
using std::stringstream;
|
304
|
+
|
305
|
+
#endif
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#ifndef GCCXML_PTHREAD_H
|
2
|
+
#define GCCXML_PTHREAD_H
|
3
|
+
|
4
|
+
/* Some pthread.h files use __thread, which is a keyword for GCC 3.3.
|
5
|
+
Change the name for the duration of including pthread.h. */
|
6
|
+
#ifndef __thread
|
7
|
+
# define __thread gccxml__thread
|
8
|
+
# define gccxml__thread gccxml__thread
|
9
|
+
#endif
|
10
|
+
#include_next <pthread.h>
|
11
|
+
#ifdef gccxml__thread
|
12
|
+
# undef gccxml__thread
|
13
|
+
# undef __thread
|
14
|
+
#endif
|
15
|
+
|
16
|
+
#endif
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#ifndef GCCXML_PTHREAD_H
|
2
|
+
#define GCCXML_PTHREAD_H
|
3
|
+
|
4
|
+
/* Some pthread.h files use __thread, which is a keyword for GCC 3.3.
|
5
|
+
Change the name for the duration of including pthread.h. */
|
6
|
+
#ifndef __thread
|
7
|
+
# define __thread gccxml__thread
|
8
|
+
# define gccxml__thread gccxml__thread
|
9
|
+
#endif
|
10
|
+
#include_next <pthread.h>
|
11
|
+
#ifdef gccxml__thread
|
12
|
+
# undef gccxml__thread
|
13
|
+
# undef __thread
|
14
|
+
#endif
|
15
|
+
|
16
|
+
#endif
|