I'm trying to write an object oriented application framework. The programs can be console or GUI based, but I'm having some difficulty providing a consistent interface for outputting structures. The structures will be displayed by a variable description and its value. So, for a RECT structure the output on console would look like the following.
The numbers should be aligned next to their description. In console mode, white space must be appended to each description. In GUI, this extra process will not be necessary (some other processing might be, but it will be different).
The right way to display data in C++ is of course using a stream and defining the appropriate operator<<.
Note that endl and the spacing has been omitted. This is because GUI output will also be implemented as a stream and they do not require a carriage return or padding. Should I define a StructStream object?
After I use the structstream object to store the output as a stream how should the output be written to the screen. Should I call cout from within the stream object. Should I have two buffers, one which borrows cout.rdbuf()? Should I call printf? Should I open another standard out file and use write? Should I convert the buffer to a string which will be display by cout or a winout? Can someone give me an idea of what I should do? Thanks.