_string_io.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright (c) 1997-1999
  3. * Silicon Graphics Computer Systems, Inc.
  4. *
  5. * Copyright (c) 1999
  6. * Boris Fomitchev
  7. *
  8. * This material is provided "as is", with absolutely no warranty expressed
  9. * or implied. Any use is at your own risk.
  10. *
  11. * Permission to use or copy this software for any purpose is hereby granted
  12. * without fee, provided the above notices are retained on all copies.
  13. * Permission to modify the code and to distribute modified code is granted,
  14. * provided the above notices are retained, and a notice that the code was
  15. * modified is included with the above copyright notice.
  16. *
  17. */
  18. #ifndef _STLP_STRING_IO_H
  19. #define _STLP_STRING_IO_H
  20. #ifndef _STLP_INTERNAL_OSTREAM_H
  21. # include <stl/_ostream.h>
  22. #endif
  23. #ifndef _STLP_INTERNAL_ISTREAM
  24. # include <stl/_istream.h>
  25. #endif
  26. // I/O.
  27. _STLP_BEGIN_NAMESPACE
  28. template <class _CharT, class _Traits, class _Alloc>
  29. basic_ostream<_CharT, _Traits>& _STLP_CALL
  30. operator<<(basic_ostream<_CharT, _Traits>& __os,
  31. const basic_string<_CharT,_Traits,_Alloc>& __s);
  32. #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
  33. template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
  34. basic_ostream<_CharT, _Traits>& _STLP_CALL
  35. operator<<(basic_ostream<_CharT, _Traits>& __os,
  36. const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __sum) {
  37. basic_string<_CharT, _Traits, _Alloc> __tmp(__sum);
  38. return __os << __tmp;
  39. }
  40. #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
  41. template <class _CharT, class _Traits, class _Alloc>
  42. basic_istream<_CharT, _Traits>& _STLP_CALL
  43. operator>>(basic_istream<_CharT, _Traits>& __is,
  44. basic_string<_CharT,_Traits,_Alloc>& __s);
  45. template <class _CharT, class _Traits, class _Alloc>
  46. basic_istream<_CharT, _Traits>& _STLP_CALL
  47. getline(basic_istream<_CharT, _Traits>& __is,
  48. basic_string<_CharT,_Traits,_Alloc>& __s,
  49. _CharT __delim);
  50. #if !(defined (__BORLANDC__) && !defined (_STLP_USE_OWN_NAMESPACE))
  51. template <class _CharT, class _Traits, class _Alloc>
  52. inline basic_istream<_CharT, _Traits>& _STLP_CALL
  53. getline(basic_istream<_CharT, _Traits>& __is,
  54. basic_string<_CharT,_Traits,_Alloc>& __s) {
  55. return getline(__is, __s, __is.widen('\n'));
  56. }
  57. #endif
  58. _STLP_END_NAMESPACE
  59. #if !defined (_STLP_LINK_TIME_INSTANTIATION)
  60. # include <stl/_string_io.c>
  61. #endif
  62. #endif /* _STLP_STRING_IO_H */