I guess things do get a bit visually-cleaner in part 5 and 6, which is nice. The pipeline here does feel a bit wacky, though... It's roughly the following, I think: [Data, perhaps a char*] --> ostringstream --> std::string --> char* --> nsPrintfCString --> nsCString --> char* --> `fprintf` If feels to me like if we're using string-streams, then we should just be outputting the data via a stream as well (if it's possible to wrap our `FILE* out` in a stream). That would let us do away with some of the intermediate conversions here, I think -- particularly the nsPrintfCString and nsCString. Alternately: if we're sticking with nsPrintfCString / nsCString as the "final form" of our output here, then it feels odd to be moving towards introducing intermediate streams & std::string usages.
Bug 1596339 Comment 8 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I guess things do get a bit visually-cleaner in part 5 and 6, which is nice. The pipeline here does feel a bit wacky, though... It's roughly the following, I think: [Data, perhaps a char*] --> ostringstream --> std::string --> char* --> nsPrintfCString --> nsCString --> char* --> `fprintf` If feels to me like if we're using string-streams, then we should just be outputting the final data via a stream as well, in `::List` (if it's possible to wrap our `FILE* out` in a stream). That would let us do away with some of the intermediate conversions here, I think -- particularly the nsPrintfCString and nsCString. Alternately: if we're sticking with nsPrintfCString / nsCString as the "final form" of our output here, then it feels odd to be moving towards introducing intermediate streams & std::string usages.
I guess things do get a bit visually-cleaner in part 5 and 6, which is nice. The pipeline here does feel a bit wacky, though... It's roughly the following, I think: [Data, perhaps a char*] --> ostringstream --> std::string --> char* --> nsPrintfCString --> nsCString --> char* --> `fprintf` If feels to me like if we're using string-streams, then we should just be outputting the final data via a stream as well, in `::List` (if it's possible to wrap our `FILE* out` in a stream). That would let us do away with some of the intermediate conversions here, I think -- particularly the nsPrintfCString and nsCString. Alternately: if we're sticking with nsPrintfCString / nsCString as the "final form" of our output here (which gets handed off to fprintf), then it feels odd to be moving towards introducing intermediate streams & std::string usages only to have to convert out of them into mozilla string types and then into a fprintf expression...