Home » U++ Library support » U++ Core » streaming [FEATURE REQUEST]
|
|
Re: streaming [FEATURE REQUEST] [message #19361 is a reply to message #19348] |
Fri, 28 November 2008 21:00 |
|
amando1957
Messages: 57 Registered: November 2007 Location: Wien/Vienna/Viden
|
Member |
|
|
Hi Mirek
Quote: | You can use StringStream.
|
Thank you.
Quote: | maybe only the output is what we need there, right?
|
Yes, I consider string to be an outstream. String could also get a saveAs() function, then the FileOut would even get obsolete, for text.
Quote: |
Quote: |
The FileOut have got a Put(), but do not provide the operator<<.
|
It does.
|
Excuse me, my mistake. I have overlooked.
Quote: |
Quote: |
Alternative FileOut could get a constructor which allows to select binary or text
|
And that would do what?
|
Would save it as binary file or as text file ("wt" or "wb" with FILE pointer), no matter which operator was used for filling. At Windows there are both possible (unlike Linux I've heard).
Quote: | Convert '\n' to "\r\n" on Windows?
|
at Windows I have always written \n to a text file and never had a problem, thus I don't see the need for.
Quote: | IMO it is more logical to use specific Putn[le|be].
|
Do not know what you mean with Putn[le|be].
Quote: | LE/BE is usually not a variable for given file format.
|
Hmmm, I am pretty sure it is. For a *.wav (LE) I need to write/read the low byte first, for a *.mid (BE) at last.
Now its not a problem to sort that myself and push the single bytes then. It would be just more convenient to put a dword LE or BE like:
StringStream binData(LE).
dword d = 0xAA2244FF;
binData % d;
But its your business of course how you make it ultimatly.
kind greets
Martin
|
|
|
Re: streaming [FEATURE REQUEST] [message #19363 is a reply to message #19361] |
Fri, 28 November 2008 21:11 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Quote: |
Would save it as binary file or as text file ("wt" or "wb" with FILE pointer), no matter which operator was used for filling. At Windows there are both possible (unlike Linux I've heard).
|
Yeah, but what is the difference?
There is no "wt" or "wb" in Linux, because in Linux there is no difference at all. In Windows, the difference is only in resolving that stupid '\r' issue. In U++, that is succesfully hidden by GetLine usually.
Quote: |
Do not know what you mean with Putn[le|be].
|
Put32le, Get32be etc...
[quote]
Quote: | LE/BE is usually not a variable for given file format.
|
Hmmm, I am pretty sure it is. For a *.wav (LE) I need to write/read the low byte first, for a *.mid (BE) at last.
[/quoute]
Variable = can be different for one format. It is either one or another (usually based on what system the format has emerged. Amiga / Mac orginated formats tend to be BE, PC formats LE).
There are of course exception to this rule, some formats can e.g. have flags that resolves this.
Quote: |
StringStream binData(LE).
dword d = 0xAA2244FF;
binData % d;
But its your business of course how you make it ultimatly.
|
You should never read 'public' file formats using serialization, the way how things are serialized is "implementation detail".
Use those Getn[le|be] instead.
Mirek
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 23 22:22:49 CEST 2024
Total time taken to generate the page: 0.01671 seconds
|