Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

632 lines
20 KiB

  1. // string standard header
  2. #pragma once
  3. #ifndef _STRING_
  4. #define _STRING_
  5. #include <istream>
  6. #pragma pack(push,8)
  7. #pragma warning(push,3)
  8. #pragma warning(disable: 4189)
  9. _STD_BEGIN
  10. // basic_string TEMPLATE OPERATORS
  11. template<class _Elem,
  12. class _Traits,
  13. class _Alloc> inline
  14. basic_string<_Elem, _Traits, _Alloc> __cdecl operator+(
  15. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  16. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  17. { // return string + string
  18. return (basic_string<_Elem, _Traits, _Alloc>(_Left) += _Right);
  19. }
  20. template<class _Elem,
  21. class _Traits,
  22. class _Alloc> inline
  23. basic_string<_Elem, _Traits, _Alloc> __cdecl operator+(
  24. const _Elem *_Left,
  25. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  26. { // return NTCS + string
  27. return (basic_string<_Elem, _Traits, _Alloc>(_Left) += _Right);
  28. }
  29. template<class _Elem,
  30. class _Traits,
  31. class _Alloc> inline
  32. basic_string<_Elem, _Traits, _Alloc> __cdecl operator+(
  33. const _Elem _Left,
  34. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  35. { // return character + string
  36. return (basic_string<_Elem, _Traits, _Alloc>(1, _Left) += _Right);
  37. }
  38. template<class _Elem,
  39. class _Traits,
  40. class _Alloc> inline
  41. basic_string<_Elem, _Traits, _Alloc> __cdecl operator+(
  42. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  43. const _Elem *_Right)
  44. { // return string + NTCS
  45. return (basic_string<_Elem, _Traits, _Alloc>(_Left) += _Right);
  46. }
  47. template<class _Elem,
  48. class _Traits,
  49. class _Alloc> inline
  50. basic_string<_Elem, _Traits, _Alloc> __cdecl operator+(
  51. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  52. const _Elem _Right)
  53. { // return string + character
  54. return (basic_string<_Elem, _Traits, _Alloc>(_Left) += _Right);
  55. }
  56. template<class _Elem,
  57. class _Traits,
  58. class _Alloc> inline
  59. bool __cdecl operator==(
  60. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  61. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  62. { // test for string equality
  63. return (_Left.compare(_Right) == 0);
  64. }
  65. template<class _Elem,
  66. class _Traits,
  67. class _Alloc> inline
  68. bool __cdecl operator==(
  69. const _Elem * _Left,
  70. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  71. { // test for NTCS vs. string equality
  72. return (_Right.compare(_Left) == 0);
  73. }
  74. template<class _Elem,
  75. class _Traits,
  76. class _Alloc> inline
  77. bool __cdecl operator==(
  78. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  79. const _Elem *_Right)
  80. { // test for string vs. NTCS equality
  81. return (_Left.compare(_Right) == 0);
  82. }
  83. template<class _Elem,
  84. class _Traits,
  85. class _Alloc> inline
  86. bool __cdecl operator!=(
  87. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  88. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  89. { // test for string inequality
  90. return (!(_Left == _Right));
  91. }
  92. template<class _Elem,
  93. class _Traits,
  94. class _Alloc> inline
  95. bool __cdecl operator!=(
  96. const _Elem *_Left,
  97. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  98. { // test for NTCS vs. string inequality
  99. return (!(_Left == _Right));
  100. }
  101. template<class _Elem,
  102. class _Traits,
  103. class _Alloc> inline
  104. bool __cdecl operator!=(
  105. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  106. const _Elem *_Right)
  107. { // test for string vs. NTCS inequality
  108. return (!(_Left == _Right));
  109. }
  110. template<class _Elem,
  111. class _Traits,
  112. class _Alloc> inline
  113. bool __cdecl operator<(
  114. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  115. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  116. { // test if string < string
  117. return (_Left.compare(_Right) < 0);
  118. }
  119. template<class _Elem,
  120. class _Traits,
  121. class _Alloc> inline
  122. bool __cdecl operator<(
  123. const _Elem * _Left,
  124. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  125. { // test if NTCS < string
  126. return (_Right.compare(_Left) > 0);
  127. }
  128. template<class _Elem,
  129. class _Traits,
  130. class _Alloc> inline
  131. bool __cdecl operator<(
  132. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  133. const _Elem *_Right)
  134. { // test if string < NTCS
  135. return (_Left.compare(_Right) < 0);
  136. }
  137. template<class _Elem,
  138. class _Traits,
  139. class _Alloc> inline
  140. bool __cdecl operator>(
  141. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  142. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  143. { // test if string > string
  144. return (_Right < _Left);
  145. }
  146. template<class _Elem,
  147. class _Traits,
  148. class _Alloc> inline
  149. bool __cdecl operator>(
  150. const _Elem * _Left,
  151. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  152. { // test if NTCS > string
  153. return (_Right < _Left);
  154. }
  155. template<class _Elem,
  156. class _Traits,
  157. class _Alloc> inline
  158. bool __cdecl operator>(
  159. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  160. const _Elem *_Right)
  161. { // test if string > NTCS
  162. return (_Right < _Left);
  163. }
  164. template<class _Elem,
  165. class _Traits,
  166. class _Alloc> inline
  167. bool __cdecl operator<=(
  168. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  169. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  170. { // test if string <= string
  171. return (!(_Right < _Left));
  172. }
  173. template<class _Elem,
  174. class _Traits,
  175. class _Alloc> inline
  176. bool __cdecl operator<=(
  177. const _Elem * _Left,
  178. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  179. { // test if NTCS <= string
  180. return (!(_Right < _Left));
  181. }
  182. template<class _Elem,
  183. class _Traits,
  184. class _Alloc> inline
  185. bool __cdecl operator<=(
  186. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  187. const _Elem *_Right)
  188. { // test if string <= NTCS
  189. return (!(_Right < _Left));
  190. }
  191. template<class _Elem,
  192. class _Traits,
  193. class _Alloc> inline
  194. bool __cdecl operator>=(
  195. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  196. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  197. { // test if string >= string
  198. return (!(_Left < _Right));
  199. }
  200. template<class _Elem,
  201. class _Traits,
  202. class _Alloc> inline
  203. bool __cdecl operator>=(
  204. const _Elem * _Left,
  205. const basic_string<_Elem, _Traits, _Alloc>& _Right)
  206. { // test if NTCS >= string
  207. return (!(_Left < _Right));
  208. }
  209. template<class _Elem,
  210. class _Traits,
  211. class _Alloc> inline
  212. bool __cdecl operator>=(
  213. const basic_string<_Elem, _Traits, _Alloc>& _Left,
  214. const _Elem *_Right)
  215. { // test if string >= NTCS
  216. return (!(_Left < _Right));
  217. }
  218. #ifdef _DLL_CPPLIB
  219. template class _CRTIMP2 basic_string<char,
  220. char_traits<char>, allocator<char> > __cdecl operator+(
  221. const basic_string<char, char_traits<char>, allocator<char> >&,
  222. const basic_string<char, char_traits<char>, allocator<char> >&);
  223. template class _CRTIMP2 basic_string<char,
  224. char_traits<char>, allocator<char> > __cdecl operator+(
  225. const char *,
  226. const basic_string<char, char_traits<char>, allocator<char> >&);
  227. template class _CRTIMP2 basic_string<char,
  228. char_traits<char>, allocator<char> > __cdecl operator+(
  229. const char,
  230. const basic_string<char, char_traits<char>, allocator<char> >&);
  231. template class _CRTIMP2 basic_string<char,
  232. char_traits<char>, allocator<char> > __cdecl operator+(
  233. const basic_string<char, char_traits<char>, allocator<char> >&,
  234. const char *);
  235. template class _CRTIMP2 basic_string<char,
  236. char_traits<char>, allocator<char> > __cdecl operator+(
  237. const basic_string<char, char_traits<char>, allocator<char> >&,
  238. const char);
  239. template _CRTIMP2 bool __cdecl operator==(
  240. const basic_string<char, char_traits<char>, allocator<char> >&,
  241. const basic_string<char, char_traits<char>, allocator<char> >&);
  242. template _CRTIMP2 bool __cdecl operator==(
  243. const char *,
  244. const basic_string<char, char_traits<char>, allocator<char> >&);
  245. template _CRTIMP2 bool __cdecl operator==(
  246. const basic_string<char, char_traits<char>, allocator<char> >&,
  247. const char *);
  248. template _CRTIMP2 bool __cdecl operator!=(
  249. const basic_string<char, char_traits<char>, allocator<char> >&,
  250. const basic_string<char, char_traits<char>, allocator<char> >&);
  251. template _CRTIMP2 bool __cdecl operator!=(
  252. const char *,
  253. const basic_string<char, char_traits<char>, allocator<char> >&);
  254. template _CRTIMP2 bool __cdecl operator!=(
  255. const basic_string<char, char_traits<char>, allocator<char> >&,
  256. const char *);
  257. template _CRTIMP2 bool __cdecl operator<(
  258. const basic_string<char, char_traits<char>, allocator<char> >&,
  259. const basic_string<char, char_traits<char>, allocator<char> >&);
  260. template _CRTIMP2 bool __cdecl operator<(
  261. const char *,
  262. const basic_string<char, char_traits<char>, allocator<char> >&);
  263. template _CRTIMP2 bool __cdecl operator<(
  264. const basic_string<char, char_traits<char>, allocator<char> >&,
  265. const char *);
  266. template _CRTIMP2 bool __cdecl operator>(
  267. const basic_string<char, char_traits<char>, allocator<char> >&,
  268. const basic_string<char, char_traits<char>, allocator<char> >&);
  269. template _CRTIMP2 bool __cdecl operator>(
  270. const char *,
  271. const basic_string<char, char_traits<char>, allocator<char> >&);
  272. template _CRTIMP2 bool __cdecl operator>(
  273. const basic_string<char, char_traits<char>, allocator<char> >&,
  274. const char *);
  275. template _CRTIMP2 bool __cdecl operator<=(
  276. const basic_string<char, char_traits<char>, allocator<char> >&,
  277. const basic_string<char, char_traits<char>, allocator<char> >&);
  278. template _CRTIMP2 bool __cdecl operator<=(
  279. const char *,
  280. const basic_string<char, char_traits<char>, allocator<char> >&);
  281. template _CRTIMP2 bool __cdecl operator<=(
  282. const basic_string<char, char_traits<char>, allocator<char> >&,
  283. const char *);
  284. template _CRTIMP2 bool __cdecl operator>=(
  285. const basic_string<char, char_traits<char>, allocator<char> >&,
  286. const basic_string<char, char_traits<char>, allocator<char> >&);
  287. template _CRTIMP2 bool __cdecl operator>=(
  288. const char *,
  289. const basic_string<char, char_traits<char>, allocator<char> >&);
  290. template _CRTIMP2 bool __cdecl operator>=(
  291. const basic_string<char, char_traits<char>, allocator<char> >&,
  292. const char *);
  293. template class _CRTIMP2 basic_string<wchar_t,
  294. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  295. const basic_string<wchar_t, char_traits<wchar_t>,
  296. allocator<wchar_t> >&,
  297. const basic_string<wchar_t, char_traits<wchar_t>,
  298. allocator<wchar_t> >&);
  299. template class _CRTIMP2 basic_string<wchar_t,
  300. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  301. const wchar_t *,
  302. const basic_string<wchar_t, char_traits<wchar_t>,
  303. allocator<wchar_t> >&);
  304. template class _CRTIMP2 basic_string<wchar_t,
  305. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  306. const wchar_t,
  307. const basic_string<wchar_t, char_traits<wchar_t>,
  308. allocator<wchar_t> >&);
  309. template class _CRTIMP2 basic_string<wchar_t,
  310. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  311. const basic_string<wchar_t, char_traits<wchar_t>,
  312. allocator<wchar_t> >&,
  313. const wchar_t *);
  314. template class _CRTIMP2 basic_string<wchar_t,
  315. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  316. const basic_string<wchar_t, char_traits<wchar_t>,
  317. allocator<wchar_t> >&,
  318. const wchar_t);
  319. template _CRTIMP2 bool __cdecl operator==(
  320. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  321. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  322. template _CRTIMP2 bool __cdecl operator==(
  323. const wchar_t *,
  324. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  325. template _CRTIMP2 bool __cdecl operator==(
  326. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  327. const wchar_t *);
  328. template _CRTIMP2 bool __cdecl operator!=(
  329. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  330. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  331. template _CRTIMP2 bool __cdecl operator!=(
  332. const wchar_t *,
  333. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  334. template _CRTIMP2 bool __cdecl operator!=(
  335. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  336. const wchar_t *);
  337. template _CRTIMP2 bool __cdecl operator<(
  338. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  339. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  340. template _CRTIMP2 bool __cdecl operator<(
  341. const wchar_t *,
  342. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  343. template _CRTIMP2 bool __cdecl operator<(
  344. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  345. const wchar_t *);
  346. template _CRTIMP2 bool __cdecl operator>(
  347. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  348. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  349. template _CRTIMP2 bool __cdecl operator>(
  350. const wchar_t *,
  351. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  352. template _CRTIMP2 bool __cdecl operator>(
  353. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  354. const wchar_t *);
  355. template _CRTIMP2 bool __cdecl operator<=(
  356. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  357. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  358. template _CRTIMP2 bool __cdecl operator<=(
  359. const wchar_t *,
  360. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  361. template _CRTIMP2 bool __cdecl operator<=(
  362. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  363. const wchar_t *);
  364. template _CRTIMP2 bool __cdecl operator>=(
  365. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  366. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  367. template _CRTIMP2 bool __cdecl operator>=(
  368. const wchar_t *,
  369. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  370. template _CRTIMP2 bool __cdecl operator>=(
  371. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  372. const wchar_t *);
  373. #endif // _DLL_CPPLIB
  374. // basic_string INSERTERS AND EXTRACTORS
  375. template<class _Elem,
  376. class _Traits,
  377. class _Alloc> inline
  378. basic_istream<_Elem, _Traits>& __cdecl operator>>(
  379. basic_istream<_Elem, _Traits>& _Istr,
  380. basic_string<_Elem, _Traits, _Alloc>& _Str)
  381. { // extract a string
  382. typedef ctype<_Elem> _Ctype;
  383. typedef basic_istream<_Elem, _Traits> _Myis;
  384. typedef basic_string<_Elem, _Traits, _Alloc> _Mystr;
  385. typedef typename _Mystr::size_type _Mysizt;
  386. ios_base::iostate _State = ios_base::goodbit;
  387. bool _Changed = false;
  388. const typename _Myis::sentry _Ok(_Istr);
  389. if (_Ok)
  390. { // state okay, extract characters
  391. const _Ctype& _Fac = _USE(_Istr.getloc(), _Ctype);
  392. _Str.erase();
  393. _TRY_IO_BEGIN
  394. _Mysizt _Size = 0 < _Istr.width()
  395. && (_Mysizt)_Istr.width() < _Str.max_size()
  396. ? (_Mysizt)_Istr.width() : _Str.max_size();
  397. typename _Traits::int_type _Meta = _Istr.rdbuf()->sgetc();
  398. for (; 0 < _Size; --_Size, _Meta = _Istr.rdbuf()->snextc())
  399. if(_Traits::eq_int_type(_Traits::eof(), _Meta))
  400. { // end of file, quit
  401. _State |= ios_base::eofbit;
  402. break;
  403. }
  404. else if (_Fac.is(_Ctype::space, _Traits::to_char_type(_Meta)))
  405. break; // whitespace, quit
  406. else
  407. { // add character to string
  408. _Str.append(1, _Traits::to_char_type(_Meta));
  409. _Changed = true;
  410. }
  411. _CATCH_IO_(_Istr)
  412. }
  413. _Istr.width(0);
  414. if (!_Changed)
  415. _State |= ios_base::failbit;
  416. _Istr.setstate(_State);
  417. return (_Istr);
  418. }
  419. template<class _Elem,
  420. class _Traits,
  421. class _Alloc> inline
  422. basic_istream<_Elem, _Traits>& __cdecl getline(
  423. basic_istream<_Elem, _Traits>& _Istr,
  424. basic_string<_Elem, _Traits, _Alloc>& _Str)
  425. { // get characters into string, discard newline
  426. return (getline(_Istr, _Str, _Istr.widen('\n')));
  427. }
  428. template<class _Elem,
  429. class _Traits,
  430. class _Alloc> inline
  431. basic_istream<_Elem, _Traits>& __cdecl getline(
  432. basic_istream<_Elem, _Traits>& _Istr,
  433. basic_string<_Elem, _Traits, _Alloc>& _Str, const _Elem _Delim)
  434. { // get characters into string, discard delimiter
  435. typedef basic_istream<_Elem, _Traits> _Myis;
  436. ios_base::iostate _State = ios_base::goodbit;
  437. bool _Changed = false;
  438. const typename _Myis::sentry _Ok(_Istr, true);
  439. if (_Ok)
  440. { // state okay, extract characters
  441. _TRY_IO_BEGIN
  442. _Str.erase();
  443. const typename _Traits::int_type _Metadelim =
  444. _Traits::to_int_type(_Delim);
  445. typename _Traits::int_type _Meta = _Istr.rdbuf()->sgetc();
  446. for (; ; _Meta = _Istr.rdbuf()->snextc())
  447. if (_Traits::eq_int_type(_Traits::eof(), _Meta))
  448. { // end of file, quit
  449. _State |= ios_base::eofbit;
  450. break;
  451. }
  452. else if (_Traits::eq_int_type(_Meta, _Metadelim))
  453. { // got a delimiter, discard it and quit
  454. _Changed = true;
  455. _Istr.rdbuf()->sbumpc();
  456. break;
  457. }
  458. else if (_Str.max_size() <= _Str.size())
  459. { // string too large, quit
  460. _State |= ios_base::failbit;
  461. break;
  462. }
  463. else
  464. { // got a character, add it to string
  465. _Str += _Traits::to_char_type(_Meta);
  466. _Changed = true;
  467. }
  468. _CATCH_IO_(_Istr)
  469. }
  470. if (!_Changed)
  471. _State |= ios_base::failbit;
  472. _Istr.setstate(_State);
  473. return (_Istr);
  474. }
  475. template<class _Elem,
  476. class _Traits,
  477. class _Alloc> inline
  478. basic_ostream<_Elem, _Traits>& __cdecl operator<<(
  479. basic_ostream<_Elem, _Traits>& _Ostr,
  480. const basic_string<_Elem, _Traits, _Alloc>& _Str)
  481. { // insert a string
  482. typedef basic_ostream<_Elem, _Traits> _Myos;
  483. typedef basic_string<_Elem, _Traits, _Alloc> _Mystr;
  484. typedef typename _Mystr::size_type _Mysizt;
  485. ios_base::iostate _State = ios_base::goodbit;
  486. _Mysizt _Size = _Str.size();
  487. _Mysizt _Pad = _Ostr.width() <= 0 || (_Mysizt)_Ostr.width() <= _Size
  488. ? 0 : (_Mysizt)_Ostr.width() - _Size;
  489. const typename _Myos::sentry _Ok(_Ostr);
  490. if (!_Ok)
  491. _State |= ios_base::badbit;
  492. else
  493. { // state okay, insert characters
  494. _TRY_IO_BEGIN
  495. if ((_Ostr.flags() & ios_base::adjustfield) != ios_base::left)
  496. for (; 0 < _Pad; --_Pad) // pad on left
  497. if (_Traits::eq_int_type(_Traits::eof(),
  498. _Ostr.rdbuf()->sputc(_Ostr.fill())))
  499. { // insertion failed, quit
  500. _State |= ios_base::badbit;
  501. break;
  502. }
  503. if (_State == ios_base::goodbit)
  504. for (_Mysizt _Count = 0; _Count < _Size; ++_Count)
  505. if (_Traits::eq_int_type(_Traits::eof(),
  506. _Ostr.rdbuf()->sputc(_Str[_Count])))
  507. { // insertion failed, quit
  508. _State |= ios_base::badbit;
  509. break;
  510. }
  511. if (_State == ios_base::goodbit)
  512. for (; 0 < _Pad; --_Pad) // pad on right
  513. if (_Traits::eq_int_type(_Traits::eof(),
  514. _Ostr.rdbuf()->sputc(_Ostr.fill())))
  515. { // insertion failed, quit
  516. _State |= ios_base::badbit;
  517. break;
  518. }
  519. _Ostr.width(0);
  520. _CATCH_IO_(_Ostr)
  521. }
  522. _Ostr.setstate(_State);
  523. return (_Ostr);
  524. }
  525. #ifdef _DLL_CPPLIB
  526. template class _CRTIMP2 basic_istream<char,
  527. char_traits<char> >& __cdecl operator>>(
  528. basic_istream<char, char_traits<char> >&,
  529. basic_string<char, char_traits<char>, allocator<char> >&);
  530. template class _CRTIMP2 basic_istream<char,
  531. char_traits<char> >& __cdecl getline(
  532. basic_istream<char, char_traits<char> >&,
  533. basic_string<char, char_traits<char>, allocator<char> >&);
  534. template class _CRTIMP2 basic_istream<char,
  535. char_traits<char> >& __cdecl getline(
  536. basic_istream<char, char_traits<char> >&,
  537. basic_string<char, char_traits<char>, allocator<char> >&,
  538. const char);
  539. template class _CRTIMP2 basic_ostream<char,
  540. char_traits<char> >& __cdecl operator<<(
  541. basic_ostream<char, char_traits<char> >&,
  542. const basic_string<char, char_traits<char>, allocator<char> >&);
  543. template class _CRTIMP2 basic_istream<wchar_t,
  544. char_traits<wchar_t> >& __cdecl operator>>(
  545. basic_istream<wchar_t, char_traits<wchar_t> >&,
  546. basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  547. template class _CRTIMP2 basic_istream<wchar_t,
  548. char_traits<wchar_t> >& __cdecl getline(
  549. basic_istream<wchar_t, char_traits<wchar_t> >&,
  550. basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  551. template class _CRTIMP2 basic_istream<wchar_t,
  552. char_traits<wchar_t> >& __cdecl getline(
  553. basic_istream<wchar_t, char_traits<wchar_t> >&,
  554. basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  555. const wchar_t);
  556. template class _CRTIMP2 basic_ostream<wchar_t,
  557. char_traits<wchar_t> >& __cdecl operator<<(
  558. basic_ostream<wchar_t, char_traits<wchar_t> >&,
  559. const basic_string<wchar_t, char_traits<wchar_t>,
  560. allocator<wchar_t> >&);
  561. #endif // _DLL_CPPLIB
  562. _STD_END
  563. #pragma warning(default: 4189)
  564. #pragma warning(pop)
  565. #pragma pack(pop)
  566. #endif /* _STRING */
  567. /*
  568. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  569. * Consult your license regarding permissions and restrictions.
  570. V3.10:0009 */