gccxml_gem 0.9-x86-cygwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +75 -0
- data/bin/gccxml.exe +0 -0
- data/bin/gccxml_cc1plus.exe +0 -0
- data/gccxml.rb +50 -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/Borland/5.5/Wrappers/algorithm +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/algorithm.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/bitset +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/bitset.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cctype +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cfloat +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/climits +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cmath +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/complex +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/complex.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstddef +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstdio +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstdlib +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstring +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cstring.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ctime +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cwchar +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/cwctype +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/deque +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/deque.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/exception +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/exception.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/fstream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/fstream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/function +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/function.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/functional +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/gccxml_typeinfo.h +146 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iomanip +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iomanip.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ios +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ios.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iosfwd +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iosfwd.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iostream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iostream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/istream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/istream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iterator +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/iterator.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/limits +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/limits.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/list +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/list.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/locale +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/locale.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/map +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/map.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/memory +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/memory.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/new +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/new.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/numeric +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/numeric.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ostream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/ostream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/queue +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/queue.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/codecvt +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/collate +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/ctype +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/iosbase +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/iotraits +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/iterator +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/lochelp +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/locimpl +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/locvector +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/messages +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/money +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/numbrw +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/numeral +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/rwdispatch.h +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/rwlocale +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/rwstderr_macros.h +64 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/string_ref +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/time +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/traits +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/tree +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/usefacet +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/valimp +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/rw/vendor +1 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/set +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/set.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/sstream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/sstream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/stack +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/stack.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/stdexcept +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/stdexcept.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/streambuf +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/streambuf.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/string +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/string.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/strstream +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/strstream.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/typeinfo +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/typeinfo.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/utility +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/utility.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/valarray +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/valarray.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/vector +7 -0
- data/share/gccxml-0.9/Borland/5.5/Wrappers/vector.h +7 -0
- data/share/gccxml-0.9/Borland/5.5/except.h +154 -0
- data/share/gccxml-0.9/Borland/5.5/gccxml_fstream.h +431 -0
- data/share/gccxml-0.9/Borland/5.5/gccxml_new.h +166 -0
- data/share/gccxml-0.9/Borland/5.5/gccxml_valarray.h +786 -0
- data/share/gccxml-0.9/Borland/5.5/gccxml_vector.h +1457 -0
- data/share/gccxml-0.9/Borland/5.5/io.h +352 -0
- data/share/gccxml-0.9/Borland/5.5/oaidl.h +7006 -0
- data/share/gccxml-0.9/Borland/5.5/propidl.h +1477 -0
- data/share/gccxml-0.9/Borland/5.5/rw/locimpl.h +477 -0
- data/share/gccxml-0.9/Borland/5.5/rw/rwlocale.h +619 -0
- data/share/gccxml-0.9/Borland/5.5/stdarg.h +55 -0
- data/share/gccxml-0.9/Borland/5.5/valarray.cc +2883 -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/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/gccxml_builtins.h +91 -0
- data/share/gccxml-0.9/GCC/4.0/gccxml_builtins.h +128 -0
- data/share/gccxml-0.9/GCC/4.1/bits/gthr-default.h +618 -0
- data/share/gccxml-0.9/GCC/4.1/gccxml_builtins.h +131 -0
- data/share/gccxml-0.9/GCC/4.2/gccxml_builtins.h +131 -0
- data/share/gccxml-0.9/GCC/find_flags +105 -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 +137 -0
- data/share/gccxml-0.9/Sun/5.8/adaptation.patch +168 -0
- data/share/gccxml-0.9/Sun/README +8 -0
- data/share/gccxml-0.9/Sun/adapt_headers.sh +24 -0
- data/share/gccxml-0.9/Sun/find_flags +69 -0
- data/share/gccxml-0.9/gccxml_config +2 -0
- data/share/gccxml-0.9/gccxml_find_flags +93 -0
- data/share/man/man1/gccxml.1 +246 -0
- metadata +324 -0
@@ -0,0 +1,241 @@
|
|
1
|
+
// String based streams -*- C++ -*-
|
2
|
+
|
3
|
+
// Copyright (C) 1997, 1998, 1999, 2001, 2002
|
4
|
+
// Free Software Foundation, Inc.
|
5
|
+
//
|
6
|
+
// This file is part of the GNU ISO C++ Library. This library is free
|
7
|
+
// software; you can redistribute it and/or modify it under the
|
8
|
+
// terms of the GNU General Public License as published by the
|
9
|
+
// Free Software Foundation; either version 2, or (at your option)
|
10
|
+
// any later version.
|
11
|
+
|
12
|
+
// This library is distributed in the hope that it will be useful,
|
13
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
// GNU General Public License for more details.
|
16
|
+
|
17
|
+
// You should have received a copy of the GNU General Public License along
|
18
|
+
// with this library; see the file COPYING. If not, write to the Free
|
19
|
+
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
20
|
+
// USA.
|
21
|
+
|
22
|
+
// As a special exception, you may use this file as part of a free software
|
23
|
+
// library without restriction. Specifically, if other files instantiate
|
24
|
+
// templates or use macros or inline functions from this file, or you compile
|
25
|
+
// this file and link it with other files to produce an executable, this
|
26
|
+
// file does not by itself cause the resulting executable to be covered by
|
27
|
+
// the GNU General Public License. This exception does not however
|
28
|
+
// invalidate any other reasons why the executable file might be covered by
|
29
|
+
// the GNU General Public License.
|
30
|
+
|
31
|
+
//
|
32
|
+
// ISO C++ 14882: 27.7 String-based streams
|
33
|
+
//
|
34
|
+
|
35
|
+
#ifndef _CPP_BITS_SSTREAM_TCC
|
36
|
+
#define _CPP_BITS_SSTREAM_TCC 1
|
37
|
+
|
38
|
+
#pragma GCC system_header
|
39
|
+
|
40
|
+
#include <sstream>
|
41
|
+
|
42
|
+
namespace std
|
43
|
+
{
|
44
|
+
template <class _CharT, class _Traits, class _Alloc>
|
45
|
+
typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
|
46
|
+
basic_stringbuf<_CharT, _Traits, _Alloc>::
|
47
|
+
pbackfail(int_type __c)
|
48
|
+
{
|
49
|
+
int_type __ret = traits_type::eof();
|
50
|
+
bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
|
51
|
+
bool __testpos = _M_in_cur && _M_in_beg < _M_in_cur;
|
52
|
+
|
53
|
+
// Try to put back __c into input sequence in one of three ways.
|
54
|
+
// Order these tests done in is unspecified by the standard.
|
55
|
+
if (__testpos)
|
56
|
+
{
|
57
|
+
if (traits_type::eq(traits_type::to_char_type(__c), this->gptr()[-1])
|
58
|
+
&& !__testeof)
|
59
|
+
{
|
60
|
+
--_M_in_cur;
|
61
|
+
__ret = __c;
|
62
|
+
}
|
63
|
+
else if (!__testeof)
|
64
|
+
{
|
65
|
+
--_M_in_cur;
|
66
|
+
*_M_in_cur = traits_type::to_char_type(__c);
|
67
|
+
__ret = __c;
|
68
|
+
}
|
69
|
+
else if (__testeof)
|
70
|
+
{
|
71
|
+
--_M_in_cur;
|
72
|
+
__ret = traits_type::not_eof(__c);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
return __ret;
|
76
|
+
}
|
77
|
+
|
78
|
+
template <class _CharT, class _Traits, class _Alloc>
|
79
|
+
typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
|
80
|
+
basic_stringbuf<_CharT, _Traits, _Alloc>::
|
81
|
+
overflow(int_type __c)
|
82
|
+
{
|
83
|
+
int_type __ret = traits_type::eof();
|
84
|
+
bool __testeof = traits_type::eq_int_type(__c, __ret);
|
85
|
+
bool __testwrite = _M_out_cur < _M_buf + _M_buf_size;
|
86
|
+
bool __testout = _M_mode & ios_base::out;
|
87
|
+
|
88
|
+
// Try to append __c into output sequence in one of two ways.
|
89
|
+
// Order these tests done in is unspecified by the standard.
|
90
|
+
if (__testout)
|
91
|
+
{
|
92
|
+
if (!__testeof)
|
93
|
+
{
|
94
|
+
__size_type __len = max(_M_buf_size, _M_buf_size_opt);
|
95
|
+
__len *= 2;
|
96
|
+
|
97
|
+
if (__testwrite)
|
98
|
+
__ret = this->sputc(traits_type::to_char_type(__c));
|
99
|
+
else if (__len <= _M_string.max_size())
|
100
|
+
{
|
101
|
+
// Force-allocate, re-sync.
|
102
|
+
_M_string = this->str();
|
103
|
+
_M_string.reserve(__len);
|
104
|
+
_M_buf_size = __len;
|
105
|
+
_M_really_sync(_M_in_cur - _M_in_beg,
|
106
|
+
_M_out_cur - _M_out_beg);
|
107
|
+
*_M_out_cur = traits_type::to_char_type(__c);
|
108
|
+
_M_out_cur_move(1);
|
109
|
+
__ret = __c;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
else
|
113
|
+
__ret = traits_type::not_eof(__c);
|
114
|
+
}
|
115
|
+
return __ret;
|
116
|
+
}
|
117
|
+
|
118
|
+
template <class _CharT, class _Traits, class _Alloc>
|
119
|
+
typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
|
120
|
+
basic_stringbuf<_CharT, _Traits, _Alloc>::
|
121
|
+
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
|
122
|
+
{
|
123
|
+
pos_type __ret = pos_type(off_type(-1));
|
124
|
+
bool __testin = (ios_base::in & _M_mode & __mode) != 0;
|
125
|
+
bool __testout = (ios_base::out & _M_mode & __mode) != 0;
|
126
|
+
bool __testboth = __testin && __testout && __way != ios_base::cur;
|
127
|
+
__testin &= !(__mode & ios_base::out);
|
128
|
+
__testout &= !(__mode & ios_base::in);
|
129
|
+
|
130
|
+
if (_M_buf_size && (__testin || __testout || __testboth))
|
131
|
+
{
|
132
|
+
char_type* __beg = _M_buf;
|
133
|
+
char_type* __curi = NULL;
|
134
|
+
char_type* __curo = NULL;
|
135
|
+
char_type* __endi = NULL;
|
136
|
+
char_type* __endo = NULL;
|
137
|
+
|
138
|
+
if (__testin || __testboth)
|
139
|
+
{
|
140
|
+
__curi = this->gptr();
|
141
|
+
__endi = this->egptr();
|
142
|
+
}
|
143
|
+
if (__testout || __testboth)
|
144
|
+
{
|
145
|
+
__curo = this->pptr();
|
146
|
+
__endo = this->epptr();
|
147
|
+
}
|
148
|
+
|
149
|
+
off_type __newoffi = 0;
|
150
|
+
off_type __newoffo = 0;
|
151
|
+
if (__way == ios_base::cur)
|
152
|
+
{
|
153
|
+
__newoffi = __curi - __beg;
|
154
|
+
__newoffo = __curo - __beg;
|
155
|
+
}
|
156
|
+
else if (__way == ios_base::end)
|
157
|
+
{
|
158
|
+
__newoffi = __endi - __beg;
|
159
|
+
__newoffo = __endo - __beg;
|
160
|
+
}
|
161
|
+
|
162
|
+
if ((__testin || __testboth)
|
163
|
+
&& __newoffi + __off >= 0 && __endi - __beg >= __newoffi + __off)
|
164
|
+
{
|
165
|
+
_M_in_cur = __beg + __newoffi + __off;
|
166
|
+
__ret = pos_type(__newoffi);
|
167
|
+
}
|
168
|
+
if ((__testout || __testboth)
|
169
|
+
&& __newoffo + __off >= 0 && __endo - __beg >= __newoffo + __off)
|
170
|
+
{
|
171
|
+
_M_out_cur_move(__newoffo + __off - (_M_out_cur - __beg));
|
172
|
+
__ret = pos_type(__newoffo);
|
173
|
+
}
|
174
|
+
}
|
175
|
+
return __ret;
|
176
|
+
}
|
177
|
+
|
178
|
+
template <class _CharT, class _Traits, class _Alloc>
|
179
|
+
typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
|
180
|
+
basic_stringbuf<_CharT, _Traits, _Alloc>::
|
181
|
+
seekpos(pos_type __sp, ios_base::openmode __mode)
|
182
|
+
{
|
183
|
+
pos_type __ret = pos_type(off_type(-1));
|
184
|
+
|
185
|
+
if (_M_buf_size)
|
186
|
+
{
|
187
|
+
off_type __pos = __sp; // Use streamoff operator to do conversion.
|
188
|
+
char_type* __beg = NULL;
|
189
|
+
char_type* __end = NULL;
|
190
|
+
bool __testin = (ios_base::in & _M_mode & __mode) != 0;
|
191
|
+
bool __testout = (ios_base::out & _M_mode & __mode) != 0;
|
192
|
+
bool __testboth = __testin && __testout;
|
193
|
+
__testin &= !(__mode & ios_base::out);
|
194
|
+
__testout &= !(__mode & ios_base::in);
|
195
|
+
|
196
|
+
// NB: Ordered.
|
197
|
+
bool __testposi = false;
|
198
|
+
bool __testposo = false;
|
199
|
+
if (__testin || __testboth)
|
200
|
+
{
|
201
|
+
__beg = this->eback();
|
202
|
+
__end = this->egptr();
|
203
|
+
if (0 <= __pos && __pos <= __end - __beg)
|
204
|
+
__testposi = true;
|
205
|
+
}
|
206
|
+
if (__testout || __testboth)
|
207
|
+
{
|
208
|
+
__beg = this->pbase();
|
209
|
+
__end = _M_buf + _M_buf_size;
|
210
|
+
if (0 <= __pos && __pos <= __end - __beg)
|
211
|
+
__testposo = true;
|
212
|
+
}
|
213
|
+
if (__testposi || __testposo)
|
214
|
+
{
|
215
|
+
if (__testposi)
|
216
|
+
_M_in_cur = _M_in_beg + __pos;
|
217
|
+
if (__testposo)
|
218
|
+
_M_out_cur_move((__pos) - (_M_out_cur - __beg));
|
219
|
+
__ret = pos_type(off_type(__pos));
|
220
|
+
}
|
221
|
+
}
|
222
|
+
return __ret;
|
223
|
+
}
|
224
|
+
|
225
|
+
// Inhibit implicit instantiations for required instantiations,
|
226
|
+
// which are defined via explicit instantiations elsewhere.
|
227
|
+
// NB: This syntax is a GNU extension.
|
228
|
+
extern template class basic_stringbuf<char>;
|
229
|
+
extern template class basic_istringstream<char>;
|
230
|
+
extern template class basic_ostringstream<char>;
|
231
|
+
extern template class basic_stringstream<char>;
|
232
|
+
|
233
|
+
#ifdef _GLIBCPP_USE_WCHAR_T
|
234
|
+
extern template class basic_stringbuf<wchar_t>;
|
235
|
+
extern template class basic_istringstream<wchar_t>;
|
236
|
+
extern template class basic_ostringstream<wchar_t>;
|
237
|
+
extern template class basic_stringstream<wchar_t>;
|
238
|
+
#endif
|
239
|
+
} // namespace std
|
240
|
+
|
241
|
+
#endif
|