| ofs | hex dump | ascii | 
|---|
| 0000 |  2f 2f 0d 0a 2f 2f 20 43 6f 6e 53 74 72 65 61 6d    2e 68 3a 20 69 6e 74 65 72 66 61 63 65 20 66 6f  | //..//.ConStream.h:.interface.fo | 
| 0020 |  72 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 0d 0a 2f 2f 20 4d  | r.the.ConStream.class...//..//.M | 
| 0040 |  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 39 38 0d 0a 2f 2f  | ark.Nelson,.October.17,.1998..// | 
| 0060 |  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 72 65 61 74 65 73  | ..//.The.ConStream.class.creates | 
| 0080 |  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 20 63 61 6e 20 62  | .a.C++.ostream.object.that.can.b | 
| 00a0 |  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 72 6f 67 72 61 6d  | e...//.used.in.Win32.C++.program | 
| 00c0 |  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 6e 64 6f 77 2c 20  | s.to.write.to.a.console.window,. | 
| 00e0 |  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 72 70 6f 73 65 73  | often..//.for.debugging.purposes | 
| 0100 |  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 64 20 69 6e 20 74  | ..This.code.is.demonstrated.in.t | 
| 0120 |  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 70 72 6f 67 72 61  | he...//.ConStreamDemo.MFC.progra | 
| 0140 |  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 69 6e 20 74 68 65  | m,.and.is.fully.explained.in.the | 
| 0160 |  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 62 27 73 20 4a 6f  | ...//.accompanying.Dr..Dobb's.Jo | 
| 0180 |  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 74 61 69 6c 73 2c  | urnal.article..For.more.details, | 
| 01a0 |  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 65 20 61 74 20 68  | ..//.see.the.article.online.at.h | 
| 01c0 |  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 0a 2f 2f 0d 0a 0d  | ttp://www.dogma.net/markn..//... | 
| 01e0 |  0a 2f 2f 0d 0a 2f 2f 20 54 68 69 73 20 68 65 61    64 65 72 20 66 69 6c 65 20 64 65 66 69 6e 65 73  | .//..//.This.header.file.defines | 
| 0200 |  20 74 68 65 20 65 6e 74 69 72 65 20 69 6e 74 65    72 66 61 63 65 20 74 6f 20 74 68 65 20 43 6f 6e  | .the.entire.interface.to.the.Con | 
| 0220 |  53 74 72 65 61 6d 20 63 6c 61 73 73 2e 0d 0a 2f    2f 20 43 6f 6e 53 74 72 65 61 6d 20 69 73 20 61  | Stream.class...//.ConStream.is.a | 
| 0240 |  20 63 6c 61 73 73 20 74 68 61 74 20 77 6f 72 6b    73 20 6c 69 6b 65 20 61 20 73 74 61 6e 64 61 72  | .class.that.works.like.a.standar | 
| 0260 |  64 20 69 6f 73 74 72 65 61 6d 2c 20 61 6e 64 20    77 72 69 74 65 73 20 0d 0a 2f 2f 20 74 6f 20 61  | d.iostream,.and.writes...//.to.a | 
| 0280 |  20 63 6f 6e 73 6f 6c 65 20 77 69 6e 64 6f 77 20    77 68 65 6e 20 63 72 65 61 74 65 64 20 69 6e 20  | .console.window.when.created.in. | 
| 02a0 |  61 20 57 69 6e 33 32 20 61 70 70 6c 69 63 61 74    69 6f 6e 2e 20 59 6f 75 20 63 61 6e 20 6f 6e 6c  | a.Win32.application..You.can.onl | 
| 02c0 |  79 0d 0a 2f 2f 20 68 61 76 65 20 61 20 73 69 6e    67 6c 65 20 63 6f 6e 73 6f 6c 65 20 77 69 6e 64  | y..//.have.a.single.console.wind | 
| 02e0 |  6f 77 20 6f 70 65 6e 20 61 74 20 61 20 74 69 6d    65 2c 20 73 6f 20 6f 6e 6c 79 20 61 20 73 69 6e  | ow.open.at.a.time,.so.only.a.sin | 
| 0300 |  67 6c 65 20 43 6f 6e 53 74 72 65 61 6d 0d 0a 2f    2f 20 63 6c 61 73 73 20 69 73 20 6f 72 64 69 6e  | gle.ConStream..//.class.is.ordin | 
| 0320 |  61 72 69 6c 79 20 63 72 65 61 74 65 64 20 69 6e    20 61 6e 20 61 70 70 6c 69 63 61 74 69 6f 6e 2e  | arily.created.in.an.application. | 
| 0340 |  20 43 6f 6e 53 74 72 65 61 6d 20 69 73 20 63 6f    6d 70 61 74 69 62 6c 65 20 77 69 74 68 0d 0a 2f  | .ConStream.is.compatible.with../ | 
| 0360 |  2f 20 57 69 6e 64 6f 77 73 20 39 78 20 61 6e 64    20 57 69 6e 64 6f 77 73 20 4e 54 2e 20 49 74 20  | /.Windows.9x.and.Windows.NT..It. | 
| 0380 |  75 73 65 73 20 55 6e 69 63 6f 64 65 20 74 65 78    74 20 69 66 20 74 68 65 20 5f 55 4e 49 43 4f 44  | uses.Unicode.text.if.the._UNICOD | 
| 03a0 |  45 20 6d 61 63 72 6f 0d 0a 2f 2f 20 69 73 20 64    65 66 69 6e 65 64 2e 20 49 74 20 6d 75 73 74 20  | E.macro..//.is.defined..It.must. | 
| 03c0 |  62 65 20 6c 69 6e 6b 65 64 20 77 69 74 68 20 73    6f 75 72 63 65 20 63 6f 64 65 20 66 6f 75 6e 64  | be.linked.with.source.code.found | 
| 03e0 |  20 69 6e 20 43 6f 6e 53 74 72 65 61 6d 2e 63 70    70 0d 0a 2f 2f 0d 0a 23 69 66 20 21 64 65 66 69  | .in.ConStream.cpp..//..#if.!defi | 
| 0400 |  6e 65 64 28 20 5f 43 4f 4e 53 54 52 45 41 4d 5f    48 20 29 0d 0a 23 64 65 66 69 6e 65 20 5f 43 4f  | ned(._CONSTREAM_H.)..#define._CO | 
| 0420 |  4e 53 54 52 45 41 4d 5f 48 0d 0a 0d 0a 2f 2f 0d    0a 2f 2f 20 4e 6f 74 65 20 74 68 61 74 20 43 6f  | NSTREAM_H....//..//.Note.that.Co | 
| 0440 |  6e 53 74 72 65 61 6d 20 75 73 65 73 20 74 68 65    20 73 74 61 6e 64 61 72 64 20 43 2b 2b 20 6c 69  | nStream.uses.the.standard.C++.li | 
| 0460 |  62 72 61 72 69 65 73 20 74 68 61 74 20 73 68 69    70 20 77 69 74 68 0d 0a 2f 2f 20 56 69 73 75 61  | braries.that.ship.with..//.Visua | 
| 0480 |  6c 20 43 2b 2b 20 35 2e 30 20 61 6e 64 20 6c 61    74 65 72 2c 20 6e 6f 74 20 74 68 65 20 6f 6c 64  | l.C++.5.0.and.later,.not.the.old | 
| 04a0 |  65 72 20 6c 69 62 72 61 72 69 65 73 20 77 69 74    68 20 74 68 65 20 2e 68 20 73 75 66 66 69 78 2e  | er.libraries.with.the..h.suffix. | 
| 04c0 |  0d 0a 2f 2f 20 54 68 65 20 6c 69 62 72 61 72 79    20 77 6f 75 6c 64 20 72 65 71 75 69 72 65 20 73  | ..//.The.library.would.require.s | 
| 04e0 |  6f 6d 65 20 6d 6f 64 69 66 69 63 61 74 69 6f 6e    73 20 74 6f 20 77 6f 72 6b 20 77 69 74 68 20 74  | ome.modifications.to.work.with.t | 
| 0500 |  68 65 20 6f 6c 64 65 72 0d 0a 2f 2f 20 6c 69 62    72 61 72 69 65 73 2e 0d 0a 2f 2f 0d 0a 23 69 6e  | he.older..//.libraries...//..#in | 
| 0520 |  63 6c 75 64 65 20 3c 69 6f 73 74 72 65 61 6d 3e    0d 0a 23 69 6e 63 6c 75 64 65 20 3c 66 73 74 72  | clude.<iostream>..#include.<fstr | 
| 0540 |  65 61 6d 3e 0d 0a 0d 0a 75 73 69 6e 67 20 6e 61    6d 65 73 70 61 63 65 20 73 74 64 3b 0d 0a 0d 0a  | eam>....using.namespace.std;.... | 
| 0560 |  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 69 73 20 64 65  | //..//.The.ConStream.class.is.de | 
| 0580 |  72 69 76 65 64 20 66 72 6f 6d 20 77 68 61 74 20    77 65 20 6e 6f 72 6d 61 6c 6c 79 20 74 68 69 6e  | rived.from.what.we.normally.thin | 
| 05a0 |  6b 20 6f 66 20 61 73 20 6f 73 74 72 65 61 6d 2c    0d 0a 2f 2f 20 77 68 69 63 68 20 6d 65 61 6e 73  | k.of.as.ostream,..//.which.means | 
| 05c0 |  20 79 6f 75 20 63 61 6e 20 75 73 65 20 73 74 61    6e 64 61 72 64 20 69 6e 73 65 72 74 69 6f 6e 20  | .you.can.use.standard.insertion. | 
| 05e0 |  6f 70 65 72 61 74 6f 72 73 20 74 6f 20 77 72 69    74 65 20 74 6f 20 69 74 2e 20 4f 66 0d 0a 2f 2f  | operators.to.write.to.it..Of..// | 
| 0600 |  20 63 6f 75 72 73 65 2c 20 74 68 69 73 20 69 6e    63 6c 75 64 65 73 20 69 6e 73 65 72 74 69 6f 6e  | .course,.this.includes.insertion | 
| 0620 |  20 6f 70 65 72 61 74 6f 72 73 20 66 6f 72 20 75    73 65 72 20 64 65 66 69 6e 65 64 20 63 6c 61 73  | .operators.for.user.defined.clas | 
| 0640 |  73 65 73 2e 20 41 74 0d 0a 2f 2f 20 61 6c 6c 20    74 69 6d 65 73 2c 20 61 20 43 6f 6e 53 74 72 65  | ses..At..//.all.times,.a.ConStre | 
| 0660 |  61 6d 20 6f 62 6a 65 63 74 20 69 73 20 65 69 74    68 65 72 20 77 72 69 74 69 6e 67 20 6f 75 74 20  | am.object.is.either.writing.out. | 
| 0680 |  74 6f 20 74 6f 20 61 20 46 49 4c 45 20 0d 0a 2f    2f 20 6f 62 6a 65 63 74 20 61 74 74 61 63 68 65  | to.to.a.FILE...//.object.attache | 
| 06a0 |  64 20 74 6f 20 74 68 65 20 4e 55 4c 20 64 65 76    69 63 65 2c 20 6f 72 20 61 20 46 49 4c 45 20 6f  | d.to.the.NUL.device,.or.a.FILE.o | 
| 06c0 |  62 6a 65 63 74 20 61 74 74 61 63 68 65 64 20 74    6f 20 61 20 63 6f 6e 73 6f 6c 65 0d 0a 2f 2f 20  | bject.attached.to.a.console..//. | 
| 06e0 |  63 72 65 61 74 65 64 20 75 73 69 6e 67 20 74 68    65 20 57 69 6e 33 32 20 41 50 49 2e 20 57 68 69  | created.using.the.Win32.API..Whi | 
| 0700 |  63 68 20 6f 66 20 74 68 65 20 74 77 6f 20 69 73    20 69 6e 20 75 73 65 20 64 65 70 65 6e 64 73 20  | ch.of.the.two.is.in.use.depends. | 
| 0720 |  6f 6e 20 77 68 65 74 68 65 72 0d 0a 2f 2f 20 6f    72 20 6e 6f 74 20 74 68 65 20 43 6f 6e 53 74 72  | on.whether..//.or.not.the.ConStr | 
| 0740 |  65 61 6d 20 6f 62 6a 65 63 74 20 68 61 73 20 68    61 64 20 69 74 73 20 4f 70 65 6e 28 29 20 6f 72  | eam.object.has.had.its.Open().or | 
| 0760 |  20 43 6c 6f 73 65 28 29 20 6d 65 74 68 6f 64 20    63 61 6c 6c 65 64 2e 0d 0a 2f 2f 0d 0a 63 6c 61  | .Close().method.called...//..cla | 
| 0780 |  73 73 20 43 6f 6e 53 74 72 65 61 6d 20 0d 0a 23    69 66 64 65 66 20 5f 55 4e 49 43 4f 44 45 0d 0a  | ss.ConStream...#ifdef._UNICODE.. | 
| 07a0 |  20 20 3a 20 70 75 62 6c 69 63 20 62 61 73 69 63    5f 6f 73 74 72 65 61 6d 3c 77 63 68 61 72 5f 74  | ..:.public.basic_ostream<wchar_t | 
| 07c0 |  3e 0d 0a 23 65 6c 73 65 0d 0a 20 20 3a 20 70 75    62 6c 69 63 20 62 61 73 69 63 5f 6f 73 74 72 65  | >..#else....:.public.basic_ostre | 
| 07e0 |  61 6d 3c 63 68 61 72 3e 0d 0a 23 65 6e 64 69 66    0d 0a 7b 0d 0a 70 75 62 6c 69 63 20 3a 0d 0a 20  | am<char>..#endif..{..public.:... | 
| 0800 |  20 20 20 43 6f 6e 53 74 72 65 61 6d 28 29 3b 0d    0a 20 20 20 20 76 69 72 74 75 61 6c 20 7e 43 6f  | ...ConStream();......virtual.~Co | 
| 0820 |  6e 53 74 72 65 61 6d 28 29 3b 0d 0a 20 20 20 20    76 6f 69 64 20 4f 70 65 6e 28 29 3b 0d 0a 20 20  | nStream();......void.Open();.... | 
| 0840 |  20 20 76 6f 69 64 20 43 6c 6f 73 65 28 29 3b 0d    0a 70 72 6f 74 65 63 74 65 64 20 3a 0d 0a 20 20  | ..void.Close();..protected.:.... | 
| 0860 |  20 20 48 41 4e 44 4c 45 20 6d 5f 68 43 6f 6e 73    6f 6c 65 3b 0d 0a 23 69 66 64 65 66 20 5f 55 4e  | ..HANDLE.m_hConsole;..#ifdef._UN | 
| 0880 |  49 43 4f 44 45 0d 0a 20 20 20 20 62 61 73 69 63    5f 66 69 6c 65 62 75 66 3c 77 63 68 61 72 5f 74  | ICODE......basic_filebuf<wchar_t | 
| 08a0 |  3e 20 2a 6d 5f 46 69 6c 65 42 75 66 3b 0d 0a 20    20 20 20 62 61 73 69 63 5f 66 69 6c 65 62 75 66  | >.*m_FileBuf;......basic_filebuf | 
| 08c0 |  3c 77 63 68 61 72 5f 74 3e 20 6d 5f 4e 75 6c 3b    20 20 20 20 20 20 0d 0a 23 65 6c 73 65 0d 0a 20  | <wchar_t>.m_Nul;........#else... | 
| 08e0 |  20 20 20 62 61 73 69 63 5f 66 69 6c 65 62 75 66    3c 63 68 61 72 3e 20 2a 6d 5f 46 69 6c 65 42 75  | ...basic_filebuf<char>.*m_FileBu | 
| 0900 |  66 3b 20 20 20 20 0d 0a 20 20 20 20 62 61 73 69    63 5f 66 69 6c 65 62 75 66 3c 63 68 61 72 3e 20  | f;..........basic_filebuf<char>. | 
| 0920 |  6d 5f 4e 75 6c 3b 20 20 20 20 20 20 20 20 0d 0a    23 65 6e 64 69 66 0d 0a 20 20 20 20 46 49 4c 45  | m_Nul;..........#endif......FILE | 
| 0940 |  20 2a 6d 5f 66 4e 75 6c 3b 20 20 20 20 20 20 20    20 20 20 20 20 20 20 20 20 20 20 20 20 20 0d 0a  | .*m_fNul;....................... | 
| 0960 |  20 20 20 20 46 49 4c 45 20 2a 6d 5f 66 43 6f 6e    73 6f 6c 65 3b 20 20 20 20 20 20 20 20 20 20 20  | ....FILE.*m_fConsole;........... | 
| 0980 |  20 20 20 20 20 20 0d 0a 7d 3b 0d 0a 0d 0a 23 65    6e 64 69 66 20 2f 2f 20 21 64 65 66 69 6e 65 64  | ........};....#endif.//.!defined | 
| 09a0 |  28 20 5f 43 4f 4e 53 54 52 45 41 4d 5f 48 20 29    0d 0a 00 00 00 00 00 00  | (._CONSTREAM_H.)........ |