I want to extend the std::fstream class from the <fstream> header. I plan to add a couple functions like std::fsteam create(path), std::vector<std::string> read_lines(path), etc.
What Im asking is pretty simple. Instead of creating a whole new class, I want to be able to just simply add the methods in another file and then just make std::fstream objects and use those new methods.
I have two files. file_helper.hh where I will declare the methods, and file_helper.cc where I will define them and link them to my main.cc file.
So, what do I write within file_helper.hh to add these new methods to std::fstream if possible? Is it even possible?
fstreamby reference as a parameter.createmethod be? Compared to e.g. the constructor?