This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Save and restore setup.exe window geometry attempt #2


On Wed, May 20, 2009 at 11:50 AM, Dave Korn wrote:
> Jonathon Merz wrote:
>> 1. In my current version, the GeometrySetting class just writes/reads
>> a raw WINDOWPLACEMENT struct to/from the geometry settings file. ?This
>> keeps the code nice and succinct, but is a departure from the way the
>> other settings files are handled in that the resulting file is not
>> human readable/editable. ?The question is: is it preferred to have the
>> settings files be human readable at the expense of larger code (which
>> would be entirely contained within the new GeometrySetting class's
>> save() and load() functions) or is it acceptable as attached?
>
> ?I'm afraid not, but it's a simple thing to fix. ?We do want the setting
> files to be plain ascii text. ?Makes it a lot easier to debug people's setup
> problems sometimes if we can get them to post the contents. ?Should be as easy
> as reading the io_stream's contents into some sort of strsteambuf (but don't
> quote me on that until I've had time to look up an STL reference) and using
> the << or >> operators.

Makes sense, and was rather what I assumed.  I've found istringstream
and ostringstream (the [io]strstream's have been marked deprecated at
some point.) and they will work fine.

Since the WINDOWPLACEMENT struct is more complex than some of the
other data recorded in setup's settings files (it consists of 6
values, of which 3 are structs themselves with 2, 2, and 4 values in
them), is there any preference regarding file layout?  I'm inclined to
write them all out as key=value, but it could be as short as a comma
separated list.  I wouldn't plan to actually parse the key names (the
code will read values in an expected order) but having the keys will
make it easier to remember which value is which when examining the
settings file manually.

-Jonathon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]