Inconsistency between `readEntireFile` overloads and `readEntireStream` overloads.
htiek opened this issue · 3 comments
Currently, there are two versions of the readEntireFile
function. One takes in the name of a file and returns a std::string
with the contents. The other takes in a filename and a Vector<string>&
, then populates the Vector<string>
.
There's also a readEntireStream
function. It has two overloads. One returns a string
containing the contents of the file. The other takes in a string
by reference and overwrites it with the contents of the stream.
We should consider making these functions more consistent with one another. Perhaps all versions should work with Vector<string>
? Or, alternatively, maybe we should remove the ones that take reference parameters and have them just return string
s? From there the client could stringSplit
them apart if that's what they want.
Agreed! All of filelib/strlib API could use a thorough pass to cleanup and curate. Also could use a readBinaryFile (for huffman) that doesn't open in text mode and get unwanted newline conversion