]>
Commit | Line | Data |
---|---|---|
b2dad0e3 BK |
1 | // Components for manipulating sequences of characters -*- C++ -*- |
2 | ||
3 | // Copyright (C) 2000, 1999, 1998, 1997 Free Software Foundation, Inc. | |
4 | // | |
5 | // This file is part of the GNU ISO C++ Library. This library is free | |
6 | // software; you can redistribute it and/or modify it under the | |
7 | // terms of the GNU General Public License as published by the | |
8 | // Free Software Foundation; either version 2, or (at your option) | |
9 | // any later version. | |
10 | ||
11 | // This library is distributed in the hope that it will be useful, | |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | // GNU General Public License for more details. | |
15 | ||
16 | // You should have received a copy of the GNU General Public License along | |
17 | // with this library; see the file COPYING. If not, write to the Free | |
18 | // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
19 | // USA. | |
20 | ||
21 | // As a special exception, you may use this file as part of a free software | |
22 | // library without restriction. Specifically, if other files instantiate | |
23 | // templates or use macros or inline functions from this file, or you compile | |
24 | // this file and link it with other files to produce an executable, this | |
25 | // file does not by itself cause the resulting executable to be covered by | |
26 | // the GNU General Public License. This exception does not however | |
27 | // invalidate any other reasons why the executable file might be covered by | |
28 | // the GNU General Public License. | |
29 | ||
30 | // | |
31 | // ISO C++ 14882: 21 Strings library | |
32 | // | |
33 | ||
34 | // Written by Jason Merrill based upon the specification by Takanori Adachi | |
35 | // in ANSI X3J16/94-0013R2. Rewritten by Nathan Myers. | |
36 | ||
37 | #include <bits/std_string.h> | |
38 | #include <bits/std_algorithm.h> | |
b2dad0e3 BK |
39 | |
40 | // Instantiation configuration. | |
41 | #ifndef C | |
42 | # define C char | |
43 | # define _GLIBCPP_INSTANTIATING_CHAR 1 | |
44 | #endif | |
45 | ||
46 | namespace std | |
47 | { | |
48 | typedef basic_string<C> S; | |
49 | ||
b2dad0e3 | 50 | template C S::_Rep::_S_terminal; |
cea1f697 | 51 | template const S::size_type S::npos; |
cc4316b5 BK |
52 | template S::size_type S::_Rep::_S_max_size; |
53 | template S::size_type S::_S_empty_rep_storage[]; | |
b2dad0e3 | 54 | template S::_Rep* S::_Rep::_S_create(size_t, S::allocator_type const&); |
1efef503 | 55 | template void S::_Rep::_M_destroy(const S::allocator_type&) throw(); |
6dad70df | 56 | template void __destroy_aux(S*, S*, __false_type); |
b2dad0e3 | 57 | |
1efef503 BK |
58 | template S::basic_string(S const&); |
59 | ||
b2dad0e3 | 60 | template |
1efef503 | 61 | S::basic_string(S::size_type, C, const S::allocator_type&); |
b2dad0e3 | 62 | |
b2dad0e3 | 63 | template |
1efef503 | 64 | S::basic_string(const S::allocator_type&); |
b2dad0e3 | 65 | |
b2dad0e3 | 66 | template |
1efef503 | 67 | S::basic_string(const S&, S::size_type, S::size_type); |
b2dad0e3 | 68 | |
b2dad0e3 | 69 | template |
1efef503 BK |
70 | S::basic_string(const S&, S::size_type, S::size_type, |
71 | const S::allocator_type&); | |
b2dad0e3 | 72 | |
b2dad0e3 | 73 | template |
1efef503 | 74 | S::basic_string(C const*, S::size_type, const S::allocator_type&); |
b2dad0e3 | 75 | |
b2dad0e3 | 76 | template |
1efef503 | 77 | S::basic_string(C const*, S::allocator_type const&); |
b2dad0e3 | 78 | |
b2dad0e3 | 79 | template |
1efef503 | 80 | S::basic_string(C*, C*, const allocator<C>&); |
b2dad0e3 | 81 | |
b2dad0e3 | 82 | template |
1efef503 | 83 | S::basic_string(S::iterator, S::iterator, const allocator<C>&); |
b2dad0e3 | 84 | |
b2dad0e3 BK |
85 | template |
86 | void S::_M_leak_hard(); | |
1efef503 | 87 | |
b2dad0e3 BK |
88 | template |
89 | void S::_M_mutate(S::size_type, S::size_type, S::size_type); | |
1efef503 | 90 | |
b2dad0e3 BK |
91 | template |
92 | C* S::_Rep::_M_clone(S::allocator_type const&, S::size_type); | |
b2dad0e3 | 93 | |
b2dad0e3 BK |
94 | template |
95 | void S::reserve(S::size_type); | |
b2dad0e3 | 96 | |
b2dad0e3 BK |
97 | template |
98 | void S::swap(S&); | |
b2dad0e3 | 99 | |
b2dad0e3 BK |
100 | # ifdef _GLIBCPP_ALLOC_CONTROL |
101 | template | |
102 | bool (* S::_Rep::_S_excess_slop)(size_t, size_t); | |
1efef503 | 103 | |
b2dad0e3 BK |
104 | template |
105 | bool S::_Rep::_S_default_excess(size_t, size_t); | |
106 | # endif | |
b2dad0e3 | 107 | |
b2dad0e3 BK |
108 | template |
109 | void S::resize(S::size_type, C); | |
b2dad0e3 | 110 | |
b2dad0e3 BK |
111 | template |
112 | S& S::append(S const&); | |
b2dad0e3 | 113 | |
b2dad0e3 BK |
114 | template |
115 | S& S::append(S const&, S::size_type, S::size_type); | |
b2dad0e3 | 116 | |
b2dad0e3 BK |
117 | template |
118 | S& S::append(C const*, S::size_type); | |
b2dad0e3 | 119 | |
b2dad0e3 BK |
120 | template |
121 | S& S::append(S::size_type, C); | |
b2dad0e3 | 122 | |
b2dad0e3 BK |
123 | template |
124 | S& | |
1efef503 | 125 | S::append<S::iterator>(S::iterator, S::iterator); |
b2dad0e3 | 126 | |
b2dad0e3 BK |
127 | template |
128 | S& | |
129 | S::assign(S const&); | |
b2dad0e3 | 130 | |
b2dad0e3 BK |
131 | template |
132 | S& | |
1efef503 | 133 | S::assign<S::iterator>(S::iterator, S::iterator); |
b2dad0e3 | 134 | |
b2dad0e3 BK |
135 | template |
136 | void | |
137 | S::insert<S::iterator> //c* | |
138 | (S::iterator, S::iterator, S::iterator); //it, c+, c+ and temptype = char* | |
b2dad0e3 | 139 | |
b2dad0e3 | 140 | template |
1efef503 BK |
141 | S& S::replace(S::size_type, S::size_type, S const&, |
142 | S::size_type, S::size_type); | |
b2dad0e3 | 143 | |
b2dad0e3 BK |
144 | template |
145 | S& S::replace(S::iterator, S::iterator, S::size_type, C); | |
b2dad0e3 | 146 | |
b2dad0e3 BK |
147 | template |
148 | S& | |
149 | S::replace<S::iterator> // c* | |
150 | (S::iterator, S::iterator, S::iterator, S::iterator); //it, it, c+, c+ | |
b2dad0e3 | 151 | |
b2dad0e3 BK |
152 | template |
153 | S& | |
154 | S::_M_replace<S::iterator> | |
155 | (S::iterator, S::iterator, S::iterator, S::iterator, forward_iterator_tag); | |
b2dad0e3 | 156 | |
6ad50467 BK |
157 | // Only one template keyword allowed here. |
158 | // See core issue #46 (NAD) | |
159 | // http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#46 | |
b2dad0e3 BK |
160 | template |
161 | S& | |
162 | S::_M_replace<S::const_iterator> | |
163 | (S::iterator, S::iterator, | |
164 | S::const_iterator, S::const_iterator, forward_iterator_tag); | |
b2dad0e3 | 165 | |
b2dad0e3 BK |
166 | template |
167 | S& | |
168 | S::_M_replace<C*> | |
169 | (S::iterator, S::iterator, C*, C*, forward_iterator_tag); | |
c470c17d | 170 | |
b2dad0e3 BK |
171 | template |
172 | S& | |
173 | S::_M_replace<const C*> | |
174 | (S::iterator, S::iterator, const C*, const C*, forward_iterator_tag); | |
b2dad0e3 | 175 | |
b2dad0e3 | 176 | template |
a40ba78e | 177 | S::size_type S::copy(C*, S::size_type, S::size_type) const; |
b2dad0e3 | 178 | |
b2dad0e3 | 179 | template |
a40ba78e BK |
180 | C* S::_S_construct<S::iterator>(S::iterator, S::iterator, |
181 | const allocator<C>&); | |
c470c17d | 182 | |
b2dad0e3 | 183 | template |
a40ba78e BK |
184 | C* S::_S_construct<S::iterator>(S::iterator, S::iterator, |
185 | const allocator<C>&, forward_iterator_tag); | |
b2dad0e3 | 186 | |
b2dad0e3 | 187 | template |
a40ba78e | 188 | C* S::_S_construct<C*>(C*, C*, const allocator<C>&, forward_iterator_tag); |
b2dad0e3 | 189 | |
b2dad0e3 | 190 | template |
a40ba78e BK |
191 | C* S::_S_construct<const C*>(const C*, const C*, const allocator<C>&, |
192 | forward_iterator_tag); | |
b2dad0e3 | 193 | |
b2dad0e3 | 194 | template |
a40ba78e BK |
195 | C* S::_S_construct(S::size_type, C, S::allocator_type const&); |
196 | ||
197 | template | |
198 | const C* S::_S_find(const C* __beg, const C* __end, C __c); | |
b2dad0e3 | 199 | |
b2dad0e3 BK |
200 | template |
201 | S::size_type S::find(C, S::size_type) const; | |
b2dad0e3 | 202 | |
b2dad0e3 BK |
203 | template |
204 | S::size_type S::rfind(C const*, S::size_type, S::size_type) const; | |
b2dad0e3 | 205 | |
b2dad0e3 BK |
206 | template |
207 | S::size_type S::rfind(C, S::size_type) const; | |
b2dad0e3 | 208 | |
b2dad0e3 BK |
209 | template |
210 | S::size_type S::find_first_of(C const*, S::size_type, S::size_type) const; | |
b2dad0e3 | 211 | |
b2dad0e3 BK |
212 | template |
213 | S::size_type S::find_last_of(C const*, S::size_type, S::size_type) const; | |
b2dad0e3 | 214 | |
b2dad0e3 | 215 | template |
a40ba78e BK |
216 | S::size_type |
217 | S::find_first_not_of(C const*, S::size_type, S::size_type) const; | |
b2dad0e3 | 218 | |
b2dad0e3 | 219 | template |
a40ba78e BK |
220 | S::size_type |
221 | S::find_last_not_of(C const*, S::size_type, S::size_type) const; | |
b2dad0e3 | 222 | |
b2dad0e3 BK |
223 | template |
224 | S::size_type S::find_last_not_of(C, S::size_type) const; | |
b2dad0e3 | 225 | |
b2dad0e3 BK |
226 | template |
227 | int S::compare(S::size_type, S::size_type, S const&) const; | |
b2dad0e3 | 228 | |
b2dad0e3 BK |
229 | template |
230 | int S::compare(S::size_type, S::size_type, S const&, S::size_type, | |
231 | S::size_type) const; | |
b2dad0e3 | 232 | |
b2dad0e3 BK |
233 | template |
234 | int S::compare(C const*) const; | |
b2dad0e3 | 235 | |
b2dad0e3 | 236 | template |
a40ba78e | 237 | int S::compare(S::size_type, S::size_type, C const*, S::size_type) const; |
b2dad0e3 | 238 | |
b2dad0e3 | 239 | template S operator+(const C*, const S&); |
b2dad0e3 | 240 | |
b2dad0e3 | 241 | template S operator+(C, const S&); |
b2dad0e3 | 242 | |
b2dad0e3 BK |
243 | template bool operator==(const S::iterator&, const S::iterator&); |
244 | template bool operator==(const S::const_iterator&, const S::const_iterator&); | |
b2dad0e3 | 245 | |
b2dad0e3 | 246 | template void _S_string_copy(const S&, C*, allocator<C>::size_type); |
b2dad0e3 BK |
247 | |
248 | } // std | |
249 | ||
250 | ||
251 | ||
1efef503 | 252 |