Commit dee88723 authored by Max Kellermann's avatar Max Kellermann

fs/io/FileOutputStream: move code to Open()

parent 4ba9357a
...@@ -34,6 +34,12 @@ ...@@ -34,6 +34,12 @@
FileOutputStream::FileOutputStream(Path _path, Mode _mode) FileOutputStream::FileOutputStream(Path _path, Mode _mode)
:path(_path), mode(_mode) :path(_path), mode(_mode)
{ {
Open();
}
inline void
FileOutputStream::Open()
{
switch (mode) { switch (mode) {
case Mode::CREATE: case Mode::CREATE:
OpenCreate(false); OpenCreate(false);
......
...@@ -133,6 +133,7 @@ public: ...@@ -133,6 +133,7 @@ public:
private: private:
void OpenCreate(bool visible); void OpenCreate(bool visible);
void OpenAppend(bool create); void OpenAppend(bool create);
void Open();
bool Close() noexcept { bool Close() noexcept {
assert(IsDefined()); assert(IsDefined());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment