summaryrefslogtreecommitdiffstats
path: root/private/crt32/iostream/iostrini.cxx
blob: e6bb83ba27cf8863d53becb33308c302c71e7f21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/***
*iostrini.cxx - definition and initialization for predefined stream cout.
*
*	Copyright (c) 1991-1992, Microsoft Corporation.  All rights reserved.
*
*Purpose:
*	Definition and initialization of and predefined iostream cout.
*
*Revision History:
*	11-18-91   KRS	Created.
*
*******************************************************************************/
#include <cruntime.h>
#include <internal.h>
#include <iostream.h>
#include <fstream.h>
#pragma hdrstop

// put contructors in special MS-specific XIFM segment
#pragma warning(disable:4074)	// disable init_seg warning
#pragma init_seg(compiler)

#if ((!defined(_WINDOWS)) || defined(_QWIN))
ostream_withassign cout(new filebuf(1));

static Iostream_init  __InitCout(cout,-1);

#endif

/***
*Iostream_init::Iostream_init() - initialize predefined streams
*
*Purpose:
*	 For compatibility only.  Not used.
*Entry:
*
*Exit:
*
*Exceptions:
*
*******************************************************************************/
	Iostream_init::Iostream_init() { }	// do nothing

/***
*Iostream_init::Iostream_init() - initialize predefined streams
*
*Purpose:
*	 Initializes predefined streams: cin, cout, cerr, clog;
*Entry:
*	pstrm = cin, cout, cerr, or clog
*	sflg =  1 if cerr (unit buffered)
*	sflg = -1 if cout
*
*Exit:
*
*Exceptions:
*
*******************************************************************************/
	Iostream_init::Iostream_init(ios& pstrm, int sflg)
{
#if ((!defined(_WINDOWS)) || defined(_QWIN))
	pstrm.delbuf(1);
	if (sflg>=0)	// make sure not cout
		pstrm.tie(&cout);
	if (sflg>0)
		pstrm.setf(ios::unitbuf);
#endif
}

/***
*Iostream_init::~Iostream_init() - destroy predefined streams on exit
*
*Purpose:
*	 Destroy predefined streams: cin, cout, cerr, clog;
*Entry:
*
*Exit:
*
*Exceptions:
*
*******************************************************************************/
	Iostream_init::~Iostream_init() { }	// do nothing