| ofs | hex dump | ascii | 
|---|
| 0000 |  2f 2f 0d 0a 2f 2f 20 43 6f 6e 53 74 72 65 61 6d    2e 63 70 70 3a 20 69 6d 70 6c 65 6d 65 6e 74 61  | //..//.ConStream.cpp:.implementa | 
| 0020 |  74 69 6f 6e 20 6f 66 20 74 68 65 20 43 6f 6e 53    74 72 65 61 6d 20 63 6c 61 73 73 2e 0d 0a 2f 2f  | tion.of.the.ConStream.class...// | 
| 0040 |  0d 0a 2f 2f 20 4d 61 72 6b 20 4e 65 6c 73 6f 6e    2c 20 4f 63 74 6f 62 65 72 20 31 37 2c 20 31 39  | ..//.Mark.Nelson,.October.17,.19 | 
| 0060 |  39 38 0d 0a 2f 2f 0d 0a 2f 2f 20 54 68 65 20 43    6f 6e 53 74 72 65 61 6d 20 63 6c 61 73 73 20 63  | 98..//..//.The.ConStream.class.c | 
| 0080 |  72 65 61 74 65 73 20 61 20 43 2b 2b 20 6f 73 74    72 65 61 6d 20 6f 62 6a 65 63 74 20 74 68 61 74  | reates.a.C++.ostream.object.that | 
| 00a0 |  20 63 61 6e 20 62 65 20 0d 0a 2f 2f 20 75 73 65    64 20 69 6e 20 57 69 6e 33 32 20 43 2b 2b 20 70  | .can.be...//.used.in.Win32.C++.p | 
| 00c0 |  72 6f 67 72 61 6d 73 20 74 6f 20 77 72 69 74 65    20 74 6f 20 61 20 63 6f 6e 73 6f 6c 65 20 77 69  | rograms.to.write.to.a.console.wi | 
| 00e0 |  6e 64 6f 77 2c 20 6f 66 74 65 6e 0d 0a 2f 2f 20    66 6f 72 20 64 65 62 75 67 67 69 6e 67 20 70 75  | ndow,.often..//.for.debugging.pu | 
| 0100 |  72 70 6f 73 65 73 2e 20 54 68 69 73 20 63 6f 64    65 20 69 73 20 64 65 6d 6f 6e 73 74 72 61 74 65  | rposes..This.code.is.demonstrate | 
| 0120 |  64 20 69 6e 20 74 68 65 20 0d 0a 2f 2f 20 43 6f    6e 53 74 72 65 61 6d 44 65 6d 6f 20 4d 46 43 20  | d.in.the...//.ConStreamDemo.MFC. | 
| 0140 |  70 72 6f 67 72 61 6d 2c 20 61 6e 64 20 69 73 20    66 75 6c 6c 79 20 65 78 70 6c 61 69 6e 65 64 20  | program,.and.is.fully.explained. | 
| 0160 |  69 6e 20 74 68 65 20 0d 0a 2f 2f 20 61 63 63 6f    6d 70 61 6e 79 69 6e 67 20 44 72 2e 20 44 6f 62  | in.the...//.accompanying.Dr..Dob | 
| 0180 |  62 27 73 20 4a 6f 75 72 6e 61 6c 20 61 72 74 69    63 6c 65 2e 20 46 6f 72 20 6d 6f 72 65 20 64 65  | b's.Journal.article..For.more.de | 
| 01a0 |  74 61 69 6c 73 2c 0d 0a 2f 2f 20 73 65 65 20 74    68 65 20 61 72 74 69 63 6c 65 20 6f 6e 6c 69 6e  | tails,..//.see.the.article.onlin | 
| 01c0 |  65 20 61 74 20 68 74 74 70 3a 2f 2f 77 77 77 2e    64 6f 67 6d 61 2e 6e 65 74 2f 6d 61 72 6b 6e 0d  | e.at.http://www.dogma.net/markn. | 
| 01e0 |  0a 2f 2f 0d 0a 0d 0a 2f 2f 0d 0a 2f 2f 20 49 6d    70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f 66 20  | .//....//..//.Implementation.of. | 
| 0200 |  74 68 69 73 20 63 6c 61 73 73 20 72 65 71 75 69    72 65 73 20 74 68 61 74 20 79 6f 75 20 6c 69 6e  | this.class.requires.that.you.lin | 
| 0220 |  6b 20 69 6e 20 74 68 65 20 49 4f 2e 48 0d 0a 2f    2f 20 61 6e 64 20 46 43 4e 54 4c 2e 48 20 68 65  | k.in.the.IO.H..//.and.FCNTL.H.he | 
| 0240 |  61 64 65 72 20 66 69 6c 65 73 20 66 72 6f 6d 20    74 68 65 20 73 74 61 6e 64 61 72 64 20 43 20 6c  | ader.files.from.the.standard.C.l | 
| 0260 |  69 62 72 61 72 79 2e 20 59 6f 75 20 73 68 6f 75    6c 64 0d 0a 2f 2f 20 62 65 20 61 62 6c 65 20 74  | ibrary..You.should..//.be.able.t | 
| 0280 |  6f 20 73 75 62 73 74 69 74 75 74 65 20 3c 63 69    6f 3e 20 61 6e 64 20 3c 63 66 63 6e 74 3e 20 66  | o.substitute.<cio>.and.<cfcnt>.f | 
| 02a0 |  6f 72 20 74 68 65 73 65 20 74 77 6f 20 69 6e 63    6c 75 64 65 73 2e 0d 0a 2f 2f 20 73 74 64 61 66  | or.these.two.includes...//.stdaf | 
| 02c0 |  78 2e 68 20 69 73 20 68 65 72 65 20 62 65 63 61    75 73 65 20 74 68 65 20 63 6f 64 65 20 69 73 20  | x.h.is.here.because.the.code.is. | 
| 02e0 |  62 65 69 6e 67 20 75 73 65 64 20 69 6e 20 61 6e    20 4d 46 43 20 61 70 70 6c 69 63 61 74 69 6f 6e  | being.used.in.an.MFC.application | 
| 0300 |  0d 0a 2f 2f 20 0d 0a 0d 0a 23 69 6e 63 6c 75 64    65 20 22 73 74 64 61 66 78 2e 68 22 0d 0a 23 69  | ..//.....#include."stdafx.h"..#i | 
| 0320 |  6e 63 6c 75 64 65 20 3c 69 6f 2e 68 3e 0d 0a 23    69 6e 63 6c 75 64 65 20 3c 66 63 6e 74 6c 2e 68  | nclude.<io.h>..#include.<fcntl.h | 
| 0340 |  3e 0d 0a 0d 0a 23 69 6e 63 6c 75 64 65 20 22 43    6f 6e 53 74 72 65 61 6d 2e 68 22 0d 0a 0d 0a 2f  | >....#include."ConStream.h"..../ | 
| 0360 |  2f 0d 0a 2f 2f 20 54 68 65 20 43 6f 6e 53 74 72    65 61 6d 20 63 6f 6e 73 74 72 75 63 74 6f 72 20  | /..//.The.ConStream.constructor. | 
| 0380 |  69 6e 69 74 69 61 6c 69 7a 65 73 20 74 68 65 20    6f 62 6a 65 63 74 20 74 6f 20 70 6f 69 6e 74 20  | initializes.the.object.to.point. | 
| 03a0 |  74 6f 20 74 68 65 20 0d 0a 2f 2f 20 4e 55 4c 20    64 65 76 69 63 65 2e 20 49 74 20 64 6f 65 73 20  | to.the...//.NUL.device..It.does. | 
| 03c0 |  74 68 69 73 20 62 79 20 63 61 6c 6c 69 6e 67 20    74 77 6f 20 63 6f 6e 73 65 63 75 74 69 76 65 20  | this.by.calling.two.consecutive. | 
| 03e0 |  63 6f 6e 73 74 72 75 63 74 6f 72 73 2e 0d 0a 2f    2f 20 46 69 72 73 74 2c 20 74 68 65 20 6d 65 6d  | constructors...//.First,.the.mem | 
| 0400 |  62 65 72 20 76 61 72 69 61 62 6c 65 20 6d 5f 4e    75 6c 20 69 73 20 69 6e 69 74 69 61 6c 69 7a 65  | ber.variable.m_Nul.is.initialize | 
| 0420 |  64 20 77 69 74 68 20 61 20 46 49 4c 45 20 6f 62    6a 65 63 74 0d 0a 2f 2f 20 63 72 65 61 74 65 64  | d.with.a.FILE.object..//.created | 
| 0440 |  20 62 79 20 6f 70 65 6e 69 6e 67 20 64 65 76 69    63 65 20 22 6e 75 6c 22 2c 20 74 68 65 20 62 69  | .by.opening.device."nul",.the.bi | 
| 0460 |  74 20 62 75 63 6b 65 74 2e 20 53 65 63 6f 6e 64    2c 20 74 68 65 20 62 61 73 65 0d 0a 2f 2f 20 63  | t.bucket..Second,.the.base..//.c | 
| 0480 |  6c 61 73 73 20 63 6f 6e 73 74 72 75 63 74 6f 72    20 69 73 20 63 61 6c 6c 65 64 20 77 69 74 68 20  | lass.constructor.is.called.with. | 
| 04a0 |  61 20 72 65 66 65 72 65 6e 63 65 20 74 6f 20 6d    5f 4e 75 6c 2c 20 77 68 69 63 68 20 69 73 0d 0a  | a.reference.to.m_Nul,.which.is.. | 
| 04c0 |  2f 2f 20 61 6e 20 6f 66 73 74 72 65 61 6d 20 6f    62 6a 65 63 74 2e 20 54 68 69 73 20 73 65 74 73  | //.an.ofstream.object..This.sets | 
| 04e0 |  20 75 70 20 43 6f 6e 53 74 72 65 61 6d 20 73 6f    20 74 68 61 74 20 69 74 20 77 69 6c 6c 20 64 69  | .up.ConStream.so.that.it.will.di | 
| 0500 |  72 65 63 74 0d 0a 2f 2f 20 69 74 73 20 6f 75 74    70 75 74 20 74 6f 20 74 68 65 20 67 69 76 65 6e  | rect..//.its.output.to.the.given | 
| 0520 |  20 66 69 6c 65 2e 0d 0a 2f 2f 0d 0a 0d 0a 43 6f    6e 53 74 72 65 61 6d 3a 3a 43 6f 6e 53 74 72 65  | .file...//....ConStream::ConStre | 
| 0540 |  61 6d 28 29 20 3a 20 6d 5f 4e 75 6c 28 20 6d 5f    66 4e 75 6c 20 3d 20 66 6f 70 65 6e 28 20 22 6e  | am().:.m_Nul(.m_fNul.=.fopen(."n | 
| 0560 |  75 6c 22 2c 20 22 77 22 20 29 20 29 2c 0d 0a 23    69 66 64 65 66 20 5f 55 4e 49 43 4f 44 45 0d 0a  | ul",."w".).),..#ifdef._UNICODE.. | 
| 0580 |  20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20    20 20 20 20 20 20 20 20 20 62 61 73 69 63 5f 6f  | .........................basic_o | 
| 05a0 |  73 74 72 65 61 6d 3c 77 63 68 61 72 5f 74 3e 28    20 26 6d 5f 4e 75 6c 20 29 20 0d 0a 23 65 6c 73  | stream<wchar_t>(.&m_Nul.)...#els | 
| 05c0 |  65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20    20 20 20 20 20 20 20 20 20 20 20 20 62 61 73 69  | e...........................basi | 
| 05e0 |  63 5f 6f 73 74 72 65 61 6d 3c 63 68 61 72 3e 28    20 26 6d 5f 4e 75 6c 20 29 20 0d 0a 23 65 6e 64  | c_ostream<char>(.&m_Nul.)...#end | 
| 0600 |  69 66 0d 0a 7b 0d 0a 20 20 20 20 6d 5f 46 69 6c    65 42 75 66 20 3d 20 30 3b 0d 0a 20 20 20 20 6d  | if..{......m_FileBuf.=.0;......m | 
| 0620 |  5f 68 43 6f 6e 73 6f 6c 65 20 3d 20 49 4e 56 41    4c 49 44 5f 48 41 4e 44 4c 45 5f 56 41 4c 55 45  | _hConsole.=.INVALID_HANDLE_VALUE | 
| 0640 |  3b 0d 0a 7d 0d 0a 0d 0a 2f 2f 0d 0a 2f 2f 20 54    68 65 20 43 6f 6e 53 74 72 65 61 6d 20 64 65 73  | ;..}....//..//.The.ConStream.des | 
| 0660 |  74 72 75 63 74 6f 72 20 61 6c 77 61 79 73 20 68    61 73 20 74 6f 20 63 6c 6f 73 65 20 74 68 65 20  | tructor.always.has.to.close.the. | 
| 0680 |  6d 5f 66 4e 75 6c 20 46 49 4c 45 20 6f 62 6a 65    63 74 0d 0a 2f 2f 20 77 68 69 63 68 20 77 61 73  | m_fNul.FILE.object..//.which.was | 
| 06a0 |  20 63 72 65 61 74 65 64 20 69 6e 20 74 68 65 20    63 6f 6e 73 74 72 75 63 74 6f 72 2e 20 45 76 65  | .created.in.the.constructor..Eve | 
| 06c0 |  6e 20 69 66 20 74 68 65 20 4f 70 65 6e 28 29 20    6d 65 74 68 6f 64 20 68 61 73 0d 0a 2f 2f 20 62  | n.if.the.Open().method.has..//.b | 
| 06e0 |  65 65 6e 20 63 61 6c 6c 65 64 20 61 6e 64 20 74    68 65 20 62 69 74 20 62 75 63 6b 65 74 20 69 73  | een.called.and.the.bit.bucket.is | 
| 0700 |  6e 27 74 20 62 65 69 6e 67 20 75 73 65 64 2c 20    74 68 65 20 46 49 4c 45 20 6f 62 6a 65 63 74 20  | n't.being.used,.the.FILE.object. | 
| 0720 |  69 73 0d 0a 2f 2f 20 73 74 69 6c 6c 20 75 73 69    6e 67 20 6d 65 6d 6f 72 79 20 61 6e 64 20 61 20  | is..//.still.using.memory.and.a. | 
| 0740 |  73 79 73 74 65 6d 20 66 69 6c 65 20 68 61 6e 64    6c 65 2e 0d 0a 2f 2f 0d 0a 2f 2f 20 49 66 20 74  | system.file.handle...//..//.If.t | 
| 0760 |  68 65 20 43 6f 6e 53 74 72 65 61 6d 20 6f 62 6a    65 63 74 20 68 61 73 20 62 65 65 6e 20 6f 70 65  | he.ConStream.object.has.been.ope | 
| 0780 |  6e 65 64 20 77 69 74 68 20 61 20 63 61 6c 6c 20    74 6f 20 6d 65 6d 62 65 72 20 66 75 6e 63 74 69  | ned.with.a.call.to.member.functi | 
| 07a0 |  6f 6e 0d 0a 2f 2f 20 4f 70 65 6e 28 29 2c 20 77    65 20 68 61 76 65 20 74 6f 20 63 61 6c 6c 20 74  | on..//.Open(),.we.have.to.call.t | 
| 07c0 |  68 65 20 57 69 6e 33 32 20 41 50 49 20 66 75 6e    63 74 69 6f 6e 20 46 72 65 65 43 6f 6e 73 6f 6c  | he.Win32.API.function.FreeConsol | 
| 07e0 |  65 28 29 20 74 6f 20 63 6c 6f 73 65 0d 0a 2f 2f    20 74 68 65 20 63 6f 6e 73 6f 6c 65 20 77 69 6e  | e().to.close..//.the.console.win | 
| 0800 |  64 6f 77 2e 20 49 66 20 74 68 65 20 63 6f 6e 73    6f 6c 65 20 77 69 6e 64 6f 77 20 77 61 73 20 6f  | dow..If.the.console.window.was.o | 
| 0820 |  70 65 6e 2c 20 77 65 20 61 6c 73 6f 20 63 61 6c    6c 20 74 68 65 0d 0a 2f 2f 20 43 20 66 63 6c 6f  | pen,.we.also.call.the..//.C.fclo | 
| 0840 |  73 65 28 29 20 66 75 6e 63 74 69 6f 6e 20 6f 6e    20 74 68 65 20 6d 5f 66 43 6f 6e 73 6f 6c 65 20  | se().function.on.the.m_fConsole. | 
| 0860 |  6d 65 6d 62 65 72 2e 0d 0a 2f 2f 0d 0a 43 6f 6e    53 74 72 65 61 6d 3a 3a 7e 43 6f 6e 53 74 72 65  | member...//..ConStream::~ConStre | 
| 0880 |  61 6d 28 29 0d 0a 7b 0d 0a 20 20 20 20 64 65 6c    65 74 65 20 6d 5f 46 69 6c 65 42 75 66 3b 0d 0a  | am()..{......delete.m_FileBuf;.. | 
| 08a0 |  20 20 20 20 69 66 20 28 20 6d 5f 68 43 6f 6e 73    6f 6c 65 20 21 3d 20 49 4e 56 41 4c 49 44 5f 48  | ....if.(.m_hConsole.!=.INVALID_H | 
| 08c0 |  41 4e 44 4c 45 5f 56 41 4c 55 45 20 29 20 7b 0d    0a 20 20 20 20 20 20 20 20 46 72 65 65 43 6f 6e  | ANDLE_VALUE.).{..........FreeCon | 
| 08e0 |  73 6f 6c 65 28 29 3b 0d 0a 20 20 20 20 20 20 20    20 66 63 6c 6f 73 65 28 20 6d 5f 66 43 6f 6e 73  | sole();..........fclose(.m_fCons | 
| 0900 |  6f 6c 65 20 29 3b 0d 0a 20 20 20 20 7d 0d 0a 20    20 20 20 66 63 6c 6f 73 65 28 20 6d 5f 66 4e 75  | ole.);......}......fclose(.m_fNu | 
| 0920 |  6c 20 29 3b 0d 0a 7d 0d 0a 0d 0a 2f 2f 0d 0a 2f    2f 20 4f 70 65 6e 69 6e 67 20 74 68 65 20 73 74  | l.);..}....//..//.Opening.the.st | 
| 0940 |  72 65 61 6d 20 6d 65 61 6e 73 20 64 6f 69 6e 67    20 74 68 65 73 65 20 74 68 69 6e 67 73 3a 0d 0a  | ream.means.doing.these.things:.. | 
| 0960 |  2f 2f 20 20 20 31 29 20 4f 70 65 6e 69 6e 67 20    61 20 57 69 6e 33 32 20 63 6f 6e 73 6f 6c 65 20  | //...1).Opening.a.Win32.console. | 
| 0980 |  75 73 69 6e 67 20 74 68 65 20 57 69 6e 33 32 20    41 50 49 0d 0a 2f 2f 20 20 20 32 29 20 47 65 74  | using.the.Win32.API..//...2).Get | 
| 09a0 |  74 69 6e 67 20 61 6e 20 4f 2f 53 20 68 61 6e 64    6c 65 20 74 6f 20 74 68 65 20 63 6f 6e 73 6f 6c  | ting.an.O/S.handle.to.the.consol | 
| 09c0 |  65 0d 0a 2f 2f 20 20 20 33 29 20 43 6f 6e 76 65    72 74 69 6e 67 20 74 68 65 20 4f 2f 53 20 68 61  | e..//...3).Converting.the.O/S.ha | 
| 09e0 |  6e 64 6c 65 20 74 6f 20 61 20 43 20 73 74 64 69    6f 20 66 69 6c 65 20 68 61 6e 64 6c 65 0d 0a 2f  | ndle.to.a.C.stdio.file.handle../ | 
| 0a00 |  2f 20 20 20 34 29 20 43 6f 6e 76 65 72 74 69 6e    67 20 74 68 65 20 43 20 73 74 64 69 6f 20 66 69  | /...4).Converting.the.C.stdio.fi | 
| 0a20 |  6c 65 20 68 61 6e 64 6c 65 72 20 74 6f 20 61 20    43 20 46 49 4c 45 20 6f 62 6a 65 63 74 0d 0a 2f  | le.handler.to.a.C.FILE.object../ | 
| 0a40 |  2f 20 20 20 35 29 20 41 74 74 61 63 68 69 6e 67    20 74 68 65 20 43 20 46 49 4c 45 20 6f 62 6a 65  | /...5).Attaching.the.C.FILE.obje | 
| 0a60 |  63 74 20 74 6f 20 61 20 43 2b 2b 20 66 69 6c 65    62 75 66 0d 0a 2f 2f 20 20 20 36 29 20 41 74 74  | ct.to.a.C++.filebuf..//...6).Att | 
| 0a80 |  61 63 68 69 6e 67 20 74 68 65 20 66 69 6c 65 62    75 66 20 6f 62 6a 65 63 74 20 74 6f 20 74 68 69  | aching.the.filebuf.object.to.thi | 
| 0aa0 |  73 0d 0a 2f 2f 20 20 20 37 29 20 44 69 73 61 62    6c 69 6e 67 20 62 75 66 66 65 72 69 6e 67 20 73  | s..//...7).Disabling.buffering.s | 
| 0ac0 |  6f 20 77 65 20 73 65 65 20 6f 75 72 20 6f 75 74    70 75 74 20 69 6e 20 72 65 61 6c 20 74 69 6d 65  | o.we.see.our.output.in.real.time | 
| 0ae0 |  2e 0d 0a 2f 2f 0d 0a 76 6f 69 64 20 43 6f 6e 53    74 72 65 61 6d 3a 3a 4f 70 65 6e 28 29 0d 0a 7b  | ...//..void.ConStream::Open()..{ | 
| 0b00 |  0d 0a 20 20 20 20 69 66 20 28 20 6d 5f 68 43 6f    6e 73 6f 6c 65 20 3d 3d 20 49 4e 56 41 4c 49 44  | ......if.(.m_hConsole.==.INVALID | 
| 0b20 |  5f 48 41 4e 44 4c 45 5f 56 41 4c 55 45 20 29 20    7b 0d 0a 09 09 41 6c 6c 6f 63 43 6f 6e 73 6f 6c  | _HANDLE_VALUE.).{....AllocConsol | 
| 0b40 |  65 28 29 3b 0d 0a 09 09 6d 5f 68 43 6f 6e 73 6f    6c 65 20 3d 20 47 65 74 53 74 64 48 61 6e 64 6c  | e();....m_hConsole.=.GetStdHandl | 
| 0b60 |  65 28 20 53 54 44 5f 4f 55 54 50 55 54 5f 48 41    4e 44 4c 45 20 29 3b 0d 0a 09 09 69 6e 74 20 68  | e(.STD_OUTPUT_HANDLE.);....int.h | 
| 0b80 |  61 6e 64 6c 65 20 3d 20 5f 6f 70 65 6e 5f 6f 73    66 68 61 6e 64 6c 65 28 20 28 6c 6f 6e 67 29 20  | andle.=._open_osfhandle(.(long). | 
| 0ba0 |  6d 5f 68 43 6f 6e 73 6f 6c 65 2c 20 5f 4f 5f 54    45 58 54 20 29 3b 0d 0a 09 09 6d 5f 66 43 6f 6e  | m_hConsole,._O_TEXT.);....m_fCon | 
| 0bc0 |  73 6f 6c 65 20 3d 20 5f 66 64 6f 70 65 6e 28 20    68 61 6e 64 6c 65 2c 20 22 77 22 20 29 3b 0d 0a  | sole.=._fdopen(.handle,."w".);.. | 
| 0be0 |  23 69 66 64 65 66 20 5f 55 4e 49 43 4f 44 45 0d    0a 09 09 6d 5f 46 69 6c 65 42 75 66 20 3d 20 6e  | #ifdef._UNICODE....m_FileBuf.=.n | 
| 0c00 |  65 77 20 62 61 73 69 63 5f 66 69 6c 65 62 75 66    3c 77 63 68 61 72 5f 74 3e 28 20 6d 5f 66 43 6f  | ew.basic_filebuf<wchar_t>(.m_fCo | 
| 0c20 |  6e 73 6f 6c 65 20 29 3b 0d 0a 23 65 6c 73 65 0d    0a 09 09 6d 5f 46 69 6c 65 42 75 66 20 3d 20 6e  | nsole.);..#else....m_FileBuf.=.n | 
| 0c40 |  65 77 20 62 61 73 69 63 5f 66 69 6c 65 62 75 66    3c 63 68 61 72 3e 28 20 6d 5f 66 43 6f 6e 73 6f  | ew.basic_filebuf<char>(.m_fConso | 
| 0c60 |  6c 65 20 29 3b 0d 0a 23 65 6e 64 69 66 0d 0a 09    09 69 6e 69 74 28 20 6d 5f 46 69 6c 65 42 75 66  | le.);..#endif....init(.m_FileBuf | 
| 0c80 |  20 29 3b 0d 0a 09 09 73 65 74 66 28 69 6f 73 3a    3a 75 6e 69 74 62 75 66 29 3b 0d 0a 09 7d 0d 0a  | .);....setf(ios::unitbuf);...}.. | 
| 0ca0 |  7d 3b 0d 0a 0d 0a 2f 2f 0d 0a 2f 2f 20 43 6c 6f    73 69 6e 67 20 74 68 65 20 43 6f 6e 53 74 72 65  | };....//..//.Closing.the.ConStre | 
| 0cc0 |  61 6d 20 69 73 20 63 6f 6e 73 69 64 65 72 61 62    6c 79 20 73 69 6d 70 6c 65 72 2e 20 57 65 20 6a  | am.is.considerably.simpler..We.j | 
| 0ce0 |  75 73 74 20 75 73 65 20 74 68 65 0d 0a 2f 2f 20    69 6e 69 74 28 29 20 63 61 6c 6c 20 74 6f 20 61  | ust.use.the..//.init().call.to.a | 
| 0d00 |  74 74 61 63 68 20 74 68 69 73 20 74 6f 20 74 68    65 20 4e 55 4c 20 66 69 6c 65 20 73 74 72 65 61  | ttach.this.to.the.NUL.file.strea | 
| 0d20 |  6d 2c 20 74 68 65 6e 20 63 6c 6f 73 65 0d 0a 2f    2f 20 74 68 65 20 63 6f 6e 73 6f 6c 65 20 64 65  | m,.then.close..//.the.console.de | 
| 0d40 |  73 63 72 69 70 74 6f 72 73 2e 0d 0a 2f 2f 0d 0a    76 6f 69 64 20 43 6f 6e 53 74 72 65 61 6d 3a 3a  | scriptors...//..void.ConStream:: | 
| 0d60 |  43 6c 6f 73 65 28 29 0d 0a 7b 0d 0a 20 20 20 20    69 66 20 28 20 6d 5f 68 43 6f 6e 73 6f 6c 65 20  | Close()..{......if.(.m_hConsole. | 
| 0d80 |  21 3d 20 49 4e 56 41 4c 49 44 5f 48 41 4e 44 4c    45 5f 56 41 4c 55 45 20 29 20 7b 0d 0a 20 20 20  | !=.INVALID_HANDLE_VALUE.).{..... | 
| 0da0 |  20 20 20 20 20 69 6e 69 74 28 20 26 6d 5f 4e 75    6c 20 29 3b 0d 0a 20 20 20 20 20 20 20 20 46 72  | .....init(.&m_Nul.);..........Fr | 
| 0dc0 |  65 65 43 6f 6e 73 6f 6c 65 28 29 3b 0d 0a 20 20    20 20 20 20 20 20 66 63 6c 6f 73 65 28 20 6d 5f  | eeConsole();..........fclose(.m_ | 
| 0de0 |  66 43 6f 6e 73 6f 6c 65 20 29 3b 0d 0a 20 20 20    20 20 20 20 20 6d 5f 68 43 6f 6e 73 6f 6c 65 20  | fConsole.);..........m_hConsole. | 
| 0e00 |  3d 20 49 4e 56 41 4c 49 44 5f 48 41 4e 44 4c 45    5f 56 41 4c 55 45 3b 0d 0a 20 20 20 20 7d 0d 0a  | =.INVALID_HANDLE_VALUE;......}.. | 
| 0e20 |  7d 3b 0d 0a 00 00 00 00  | };...... |