~ubuntu-branches/ubuntu/hardy/libterralib/hardy

« back to all changes in this revision

Viewing changes to src/STLport/iostream.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2005-11-25 22:32:59 UTC
  • Revision ID: james.westby@ubuntu.com-20051125223259-3zubal8ux4ki4fjg
Tags: upstream-3.0.3b2
ImportĀ upstreamĀ versionĀ 3.0.3b2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 1999 
 
3
 * Boris Fomitchev
 
4
 *
 
5
 * This material is provided "as is", with absolutely no warranty expressed
 
6
 * or implied. Any use is at your own risk.
 
7
 *
 
8
 * Permission to use or copy this software for any purpose is hereby granted 
 
9
 * without fee, provided the above notices are retained on all copies.
 
10
 * Permission to modify the code and to distribute modified code is granted,
 
11
 * provided the above notices are retained, and a notice that the code was
 
12
 * modified is included with the above copyright notice.
 
13
 *
 
14
 */
 
15
 
 
16
#ifndef _STLP_IOSTREAM_H
 
17
# define _STLP_IOSTREAM_H
 
18
 
 
19
# ifndef _STLP_OUTERMOST_HEADER_ID
 
20
#  define _STLP_OUTERMOST_HEADER_ID 0x2035
 
21
#  include <stl/_prolog.h>
 
22
# endif
 
23
 
 
24
# ifdef _STLP_OWN_IOSTREAMS
 
25
 
 
26
#ifdef __BORLANDC__
 
27
# include <iostream.>
 
28
#else
 
29
# include <iostream>
 
30
#endif
 
31
 
 
32
// Those should be included all separately, as they do contain using declarations
 
33
# include <streambuf.h>
 
34
# include <ostream.h>
 
35
# include <istream.h>
 
36
 
 
37
# ifndef _STLP_HAS_NO_NAMESPACES
 
38
 
 
39
#  ifdef _STLP_BROKEN_USING_DIRECTIVE
 
40
using namespace _STLP_STD;
 
41
#  else
 
42
using _STLP_STD::cin;
 
43
using _STLP_STD::cout;
 
44
using _STLP_STD::clog;
 
45
using _STLP_STD::cerr;
 
46
using _STLP_STD::iostream;
 
47
 
 
48
#   ifndef _STLP_NO_WCHAR_T
 
49
using _STLP_STD::wcin;
 
50
using _STLP_STD::wcout;
 
51
using _STLP_STD::wclog;
 
52
using _STLP_STD::wcerr;
 
53
#   endif
 
54
 
 
55
#  endif
 
56
 
 
57
# endif /* _STLP_HAS_NO_NAMESPACES */
 
58
 
 
59
// Obsolete classes for old-style backwards compatibility
 
60
 
 
61
 
 
62
class istream_withassign : public istream {
 
63
 public:
 
64
  istream_withassign() : istream((streambuf*)0) {}
 
65
  ~istream_withassign() {}
 
66
  
 
67
  istream_withassign& operator=(istream& __s) { 
 
68
    ios::init(__s.rdbuf()); 
 
69
    return *this; 
 
70
  }
 
71
  istream_withassign& operator=(streambuf* __s) {
 
72
    ios::init(__s); 
 
73
    return *this; 
 
74
  }
 
75
};
 
76
 
 
77
class ostream_withassign : public ostream {
 
78
 public:
 
79
  ostream_withassign() : ostream((streambuf*)0) {}
 
80
  ~ostream_withassign() {}
 
81
  
 
82
  ostream_withassign& operator=(ostream& __s) { 
 
83
    ios::init(__s.rdbuf()); 
 
84
    return *this; 
 
85
  }
 
86
  ostream_withassign& operator=(streambuf* __s) { 
 
87
    ios::init(__s); 
 
88
    return *this; 
 
89
  }
 
90
};
 
91
 
 
92
class iostream_withassign : public iostream {
 
93
 public:
 
94
  iostream_withassign() : iostream((streambuf*)0) {}
 
95
  ~iostream_withassign() {}
 
96
  iostream_withassign & operator=(ios& __i) {
 
97
    ios::init(__i.rdbuf());
 
98
    return *this; 
 
99
  }
 
100
  iostream_withassign & operator=(streambuf* __s) {
 
101
    ios::init(__s); 
 
102
    return *this; 
 
103
  }
 
104
} ;
 
105
 
 
106
# elif ! defined (_STLP_USE_NO_IOSTREAMS)
 
107
#  include <wrap_std/h/iostream.h>
 
108
# endif
 
109
 
 
110
# if (_STLP_OUTERMOST_HEADER_ID == 0x2035)
 
111
#  include <stl/_epilog.h>
 
112
#  undef _STLP_OUTERMOST_HEADER_ID
 
113
# endif
 
114
 
 
115
#endif /* _STLP_IOSTREAM_H */
 
116
 
 
117
// Local Variables:
 
118
// mode:C++
 
119
// End: