Leaked source code of windows server 2003
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.

642 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 FUNCTIONS
  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. template<class _Elem,
  219. class _Traits,
  220. class _Alloc> inline
  221. void swap(
  222. basic_string<_Elem, _Traits, _Alloc>& _Left,
  223. basic_string<_Elem, _Traits, _Alloc>& _Right)
  224. { // swap _Left and _Right strings
  225. _Left.swap(_Right);
  226. }
  227. #ifdef _DLL_CPPLIB
  228. template class _CRTIMP2 basic_string<char,
  229. char_traits<char>, allocator<char> > __cdecl operator+(
  230. const basic_string<char, char_traits<char>, allocator<char> >&,
  231. const basic_string<char, char_traits<char>, allocator<char> >&);
  232. template class _CRTIMP2 basic_string<char,
  233. char_traits<char>, allocator<char> > __cdecl operator+(
  234. const char *,
  235. const basic_string<char, char_traits<char>, allocator<char> >&);
  236. template class _CRTIMP2 basic_string<char,
  237. char_traits<char>, allocator<char> > __cdecl operator+(
  238. const char,
  239. const basic_string<char, char_traits<char>, allocator<char> >&);
  240. template class _CRTIMP2 basic_string<char,
  241. char_traits<char>, allocator<char> > __cdecl operator+(
  242. const basic_string<char, char_traits<char>, allocator<char> >&,
  243. const char *);
  244. template class _CRTIMP2 basic_string<char,
  245. char_traits<char>, allocator<char> > __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 _CRTIMP2 bool __cdecl operator>=(
  294. const basic_string<char, char_traits<char>, allocator<char> >&,
  295. const basic_string<char, char_traits<char>, allocator<char> >&);
  296. template _CRTIMP2 bool __cdecl operator>=(
  297. const char *,
  298. const basic_string<char, char_traits<char>, allocator<char> >&);
  299. template _CRTIMP2 bool __cdecl operator>=(
  300. const basic_string<char, char_traits<char>, allocator<char> >&,
  301. const char *);
  302. template class _CRTIMP2 basic_string<wchar_t,
  303. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  304. const basic_string<wchar_t, char_traits<wchar_t>,
  305. allocator<wchar_t> >&,
  306. const basic_string<wchar_t, char_traits<wchar_t>,
  307. allocator<wchar_t> >&);
  308. template class _CRTIMP2 basic_string<wchar_t,
  309. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  310. const wchar_t *,
  311. const basic_string<wchar_t, char_traits<wchar_t>,
  312. allocator<wchar_t> >&);
  313. template class _CRTIMP2 basic_string<wchar_t,
  314. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  315. const wchar_t,
  316. const basic_string<wchar_t, char_traits<wchar_t>,
  317. allocator<wchar_t> >&);
  318. template class _CRTIMP2 basic_string<wchar_t,
  319. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  320. const basic_string<wchar_t, char_traits<wchar_t>,
  321. allocator<wchar_t> >&,
  322. const wchar_t *);
  323. template class _CRTIMP2 basic_string<wchar_t,
  324. char_traits<wchar_t>, allocator<wchar_t> > __cdecl operator+(
  325. const basic_string<wchar_t, char_traits<wchar_t>,
  326. 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. template _CRTIMP2 bool __cdecl operator>=(
  374. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  375. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  376. template _CRTIMP2 bool __cdecl operator>=(
  377. const wchar_t *,
  378. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  379. template _CRTIMP2 bool __cdecl operator>=(
  380. const basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  381. const wchar_t *);
  382. #endif // _DLL_CPPLIB
  383. // basic_string INSERTERS AND EXTRACTORS
  384. template<class _Elem,
  385. class _Traits,
  386. class _Alloc> inline
  387. basic_istream<_Elem, _Traits>& __cdecl operator>>(
  388. basic_istream<_Elem, _Traits>& _Istr,
  389. basic_string<_Elem, _Traits, _Alloc>& _Str)
  390. { // extract a string
  391. typedef ctype<_Elem> _Ctype;
  392. typedef basic_istream<_Elem, _Traits> _Myis;
  393. typedef basic_string<_Elem, _Traits, _Alloc> _Mystr;
  394. typedef typename _Mystr::size_type _Mysizt;
  395. ios_base::iostate _State = ios_base::goodbit;
  396. bool _Changed = false;
  397. const typename _Myis::sentry _Ok(_Istr);
  398. if (_Ok)
  399. { // state okay, extract characters
  400. const _Ctype& _Fac = _USE(_Istr.getloc(), _Ctype);
  401. _Str.erase();
  402. _TRY_IO_BEGIN
  403. _Mysizt _Size = 0 < _Istr.width()
  404. && (_Mysizt)_Istr.width() < _Str.max_size()
  405. ? (_Mysizt)_Istr.width() : _Str.max_size();
  406. typename _Traits::int_type _Meta = _Istr.rdbuf()->sgetc();
  407. for (; 0 < _Size; --_Size, _Meta = _Istr.rdbuf()->snextc())
  408. if(_Traits::eq_int_type(_Traits::eof(), _Meta))
  409. { // end of file, quit
  410. _State |= ios_base::eofbit;
  411. break;
  412. }
  413. else if (_Fac.is(_Ctype::space, _Traits::to_char_type(_Meta)))
  414. break; // whitespace, quit
  415. else
  416. { // add character to string
  417. _Str.append(1, _Traits::to_char_type(_Meta));
  418. _Changed = true;
  419. }
  420. _CATCH_IO_(_Istr)
  421. }
  422. _Istr.width(0);
  423. if (!_Changed)
  424. _State |= ios_base::failbit;
  425. _Istr.setstate(_State);
  426. return (_Istr);
  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)
  434. { // get characters into string, discard newline
  435. return (getline(_Istr, _Str, _Istr.widen('\n')));
  436. }
  437. template<class _Elem,
  438. class _Traits,
  439. class _Alloc> inline
  440. basic_istream<_Elem, _Traits>& __cdecl getline(
  441. basic_istream<_Elem, _Traits>& _Istr,
  442. basic_string<_Elem, _Traits, _Alloc>& _Str, const _Elem _Delim)
  443. { // get characters into string, discard delimiter
  444. typedef basic_istream<_Elem, _Traits> _Myis;
  445. ios_base::iostate _State = ios_base::goodbit;
  446. bool _Changed = false;
  447. const typename _Myis::sentry _Ok(_Istr, true);
  448. if (_Ok)
  449. { // state okay, extract characters
  450. _TRY_IO_BEGIN
  451. _Str.erase();
  452. const typename _Traits::int_type _Metadelim =
  453. _Traits::to_int_type(_Delim);
  454. typename _Traits::int_type _Meta = _Istr.rdbuf()->sgetc();
  455. for (; ; _Meta = _Istr.rdbuf()->snextc())
  456. if (_Traits::eq_int_type(_Traits::eof(), _Meta))
  457. { // end of file, quit
  458. _State |= ios_base::eofbit;
  459. break;
  460. }
  461. else if (_Traits::eq_int_type(_Meta, _Metadelim))
  462. { // got a delimiter, discard it and quit
  463. _Changed = true;
  464. _Istr.rdbuf()->sbumpc();
  465. break;
  466. }
  467. else if (_Str.max_size() <= _Str.size())
  468. { // string too large, quit
  469. _State |= ios_base::failbit;
  470. break;
  471. }
  472. else
  473. { // got a character, add it to string
  474. _Str += _Traits::to_char_type(_Meta);
  475. _Changed = true;
  476. }
  477. _CATCH_IO_(_Istr)
  478. }
  479. if (!_Changed)
  480. _State |= ios_base::failbit;
  481. _Istr.setstate(_State);
  482. return (_Istr);
  483. }
  484. template<class _Elem,
  485. class _Traits,
  486. class _Alloc> inline
  487. basic_ostream<_Elem, _Traits>& __cdecl operator<<(
  488. basic_ostream<_Elem, _Traits>& _Ostr,
  489. const basic_string<_Elem, _Traits, _Alloc>& _Str)
  490. { // insert a string
  491. typedef basic_ostream<_Elem, _Traits> _Myos;
  492. typedef basic_string<_Elem, _Traits, _Alloc> _Mystr;
  493. typedef typename _Mystr::size_type _Mysizt;
  494. ios_base::iostate _State = ios_base::goodbit;
  495. _Mysizt _Size = _Str.size();
  496. _Mysizt _Pad = _Ostr.width() <= 0 || (_Mysizt)_Ostr.width() <= _Size
  497. ? 0 : (_Mysizt)_Ostr.width() - _Size;
  498. const typename _Myos::sentry _Ok(_Ostr);
  499. if (!_Ok)
  500. _State |= ios_base::badbit;
  501. else
  502. { // state okay, insert characters
  503. _TRY_IO_BEGIN
  504. if ((_Ostr.flags() & ios_base::adjustfield) != ios_base::left)
  505. for (; 0 < _Pad; --_Pad) // pad on left
  506. if (_Traits::eq_int_type(_Traits::eof(),
  507. _Ostr.rdbuf()->sputc(_Ostr.fill())))
  508. { // insertion failed, quit
  509. _State |= ios_base::badbit;
  510. break;
  511. }
  512. if (_State == ios_base::goodbit)
  513. for (_Mysizt _Count = 0; _Count < _Size; ++_Count)
  514. if (_Traits::eq_int_type(_Traits::eof(),
  515. _Ostr.rdbuf()->sputc(_Str[_Count])))
  516. { // insertion failed, quit
  517. _State |= ios_base::badbit;
  518. break;
  519. }
  520. if (_State == ios_base::goodbit)
  521. for (; 0 < _Pad; --_Pad) // pad on right
  522. if (_Traits::eq_int_type(_Traits::eof(),
  523. _Ostr.rdbuf()->sputc(_Ostr.fill())))
  524. { // insertion failed, quit
  525. _State |= ios_base::badbit;
  526. break;
  527. }
  528. _Ostr.width(0);
  529. _CATCH_IO_(_Ostr)
  530. }
  531. _Ostr.setstate(_State);
  532. return (_Ostr);
  533. }
  534. #ifdef _DLL_CPPLIB
  535. template class _CRTIMP2 basic_istream<char,
  536. char_traits<char> >& __cdecl operator>>(
  537. basic_istream<char, char_traits<char> >&,
  538. basic_string<char, char_traits<char>, allocator<char> >&);
  539. template class _CRTIMP2 basic_istream<char,
  540. char_traits<char> >& __cdecl getline(
  541. basic_istream<char, char_traits<char> >&,
  542. basic_string<char, char_traits<char>, allocator<char> >&);
  543. template class _CRTIMP2 basic_istream<char,
  544. char_traits<char> >& __cdecl getline(
  545. basic_istream<char, char_traits<char> >&,
  546. basic_string<char, char_traits<char>, allocator<char> >&,
  547. const char);
  548. template class _CRTIMP2 basic_ostream<char,
  549. char_traits<char> >& __cdecl operator<<(
  550. basic_ostream<char, char_traits<char> >&,
  551. const basic_string<char, char_traits<char>, allocator<char> >&);
  552. template class _CRTIMP2 basic_istream<wchar_t,
  553. char_traits<wchar_t> >& __cdecl operator>>(
  554. basic_istream<wchar_t, char_traits<wchar_t> >&,
  555. basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  556. template class _CRTIMP2 basic_istream<wchar_t,
  557. char_traits<wchar_t> >& __cdecl getline(
  558. basic_istream<wchar_t, char_traits<wchar_t> >&,
  559. basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&);
  560. template class _CRTIMP2 basic_istream<wchar_t,
  561. char_traits<wchar_t> >& __cdecl getline(
  562. basic_istream<wchar_t, char_traits<wchar_t> >&,
  563. basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >&,
  564. const wchar_t);
  565. template class _CRTIMP2 basic_ostream<wchar_t,
  566. char_traits<wchar_t> >& __cdecl operator<<(
  567. basic_ostream<wchar_t, char_traits<wchar_t> >&,
  568. const basic_string<wchar_t, char_traits<wchar_t>,
  569. allocator<wchar_t> >&);
  570. #endif // _DLL_CPPLIB
  571. _STD_END
  572. #pragma warning(default: 4189)
  573. #pragma warning(pop)
  574. #pragma pack(pop)
  575. #endif /* _STRING */
  576. /*
  577. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  578. * Consult your license regarding permissions and restrictions.
  579. V3.10:0009 */