home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18646 < prev    next >
Encoding:
Internet Message Format  |  1993-01-03  |  1.6 KB

  1. Path: sparky!uunet!hela.iti.org!ais.org!roofus!empath
  2. Message-ID: <765346d7371303t1@roofus.ann-arbor.mi.us>
  3. Date: Saturday, 2 January 1993 20:24:14 EST
  4. X-Mailer: TMail version 1.14R
  5. From: "Tim Triemstra" <empath@ais.org>
  6. Organization: Empath Software
  7. Subject: Creating Streams
  8. Newsgroups: comp.lang.c++
  9. Distribution: world
  10. Lines: 26
  11.  
  12. I am interested in writing functions very similar to COUT and CIN for use
  13. within a GUI.  Essentially, I want the functions to the exactly like
  14. COUT and CIN, except I want whatever information COUT or CIN would be
  15. piping in or out to first get piped into another function.
  16.  
  17. For instance, to say COUT << "Hello\n"  I would like COUT to put the
  18. hello as a parameter to a function called GUI_COUT or something of that
  19. sort.  GUI_COUT would of course have to be overloaded to take strings and
  20. int's and whatnot - but that's not a big deal.  GUI_COUT would, of course,
  21. use the graphical font functions to output the string or number or whatnot
  22. onto the screen.  It would also, once complete, also keep track of the
  23. graphical cursor and control word-wrap and all kinds of other neat things.
  24.  
  25. So, how could I do this?  I assume you could just look into the source for
  26. the file IO and look to change some of this stuff so I could create a
  27. stream similar to ofstream and ifstream and create an object of that
  28. stream.  However, as I am new to C++ and its details I'd love some info on
  29. it.  Thanks in advance.
  30.  
  31. Tim
  32.  
  33. -------------------------------------------------------
  34. | When the end comes, there will be two men standing: |
  35. |   Me, and the guy I gotta kill.   - Gosh I'm EVIL   |
  36. ------ Tim Triemstra ------------- empath@ais.org -----
  37.