PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/TeXmacs-1.0.7.11-src/src/System/Files/tm_ostream.hpp

#
C++ Header | 73 lines | 49 code | 13 blank | 11 comment | 1 complexity | bc93d825bff0003c9d2953000b1072f4 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, MPL-2.0-no-copyleft-exception
  1. /******************************************************************************
  2. * MODULE : tm_ostream.hpp
  3. * DESCRIPTION: Output stream class
  4. * COPYRIGHT : (C) 2009 David MICHEL
  5. *******************************************************************************
  6. * This software falls under the GNU general public license version 3 or later.
  7. * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
  8. * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
  9. ******************************************************************************/
  10. #ifndef OUT_STREAM_HPP
  11. #define OUT_STREAM_HPP
  12. //#include "url.hpp"
  13. #include <cstdio>
  14. class string;
  15. class tm_ostream {
  16. FILE *file;
  17. string *buf;
  18. bool is_w;
  19. bool is_mine;
  20. bool is_buf;
  21. static tm_ostream private_cout;
  22. static tm_ostream private_cerr;
  23. tm_ostream (const tm_ostream&);
  24. tm_ostream& operator= (const tm_ostream&);
  25. public:
  26. static tm_ostream& cout;
  27. static tm_ostream& cerr;
  28. tm_ostream ();
  29. tm_ostream (char*);
  30. tm_ostream (FILE*);
  31. ~tm_ostream ();
  32. bool open ();
  33. // bool open (url);
  34. bool open (char*);
  35. bool open (FILE*);
  36. bool is_writable () const;
  37. bool is_buffered () const;
  38. void flush ();
  39. void close ();
  40. void buffer ();
  41. string unbuffer ();
  42. tm_ostream& operator << (bool);
  43. tm_ostream& operator << (char);
  44. tm_ostream& operator << (short);
  45. tm_ostream& operator << (unsigned short);
  46. tm_ostream& operator << (int);
  47. tm_ostream& operator << (unsigned int);
  48. tm_ostream& operator << (long);
  49. tm_ostream& operator << (unsigned long);
  50. tm_ostream& operator << (long long int);
  51. tm_ostream& operator << (unsigned long long int);
  52. tm_ostream& operator << (float);
  53. tm_ostream& operator << (double);
  54. tm_ostream& operator << (long double);
  55. tm_ostream& operator << (const char*);
  56. bool operator == (tm_ostream&);
  57. };
  58. extern tm_ostream& cout;
  59. extern tm_ostream& cerr;
  60. #endif // defined OUT_STREAM_HPP