From 97cdaf36ac1b4790777cf3c4678dd7527eb1fbfc Mon Sep 17 00:00:00 2001 From: jakcron Date: Sun, 3 Jun 2018 16:47:28 +0800 Subject: [PATCH] [fnd] Add open constructor to fnd::SimpleFile --- lib/libfnd/include/fnd/SimpleFile.h | 1 + lib/libfnd/source/SimpleFile.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/libfnd/include/fnd/SimpleFile.h b/lib/libfnd/include/fnd/SimpleFile.h index 0b50e60..24d311a 100644 --- a/lib/libfnd/include/fnd/SimpleFile.h +++ b/lib/libfnd/include/fnd/SimpleFile.h @@ -20,6 +20,7 @@ namespace fnd }; SimpleFile(); + SimpleFile(const std::string& path, OpenMode mode); ~SimpleFile(); void open(const std::string& path, OpenMode mode); diff --git a/lib/libfnd/source/SimpleFile.cpp b/lib/libfnd/source/SimpleFile.cpp index d4cf048..c232869 100644 --- a/lib/libfnd/source/SimpleFile.cpp +++ b/lib/libfnd/source/SimpleFile.cpp @@ -14,6 +14,12 @@ SimpleFile::SimpleFile() : { } +SimpleFile::SimpleFile(const std::string& path, OpenMode mode) : + SimpleFile() +{ + open(path, mode); +} + SimpleFile::~SimpleFile() { close();