diff options
| author | milla <marc.illa@dolby.com> | 2021-06-15 13:12:01 +0200 |
|---|---|---|
| committer | milla <marc.illa@dolby.com> | 2021-06-15 13:13:12 +0200 |
| commit | 8df78decb4e01b579bbbd1f479d187adf34fc030 (patch) | |
| tree | 67151d234a56581e949b8d00e11c23fef166a4ff /src/KM_fileio.cpp | |
| parent | b423f01ad10fd3cf7f860cace315c7d06e74db06 (diff) | |
Fix indentation
Use smart pointer for Reader
Don't define fileReader constructor and destructor twice (win and posix) but just once as their implementation is the same
Diffstat (limited to 'src/KM_fileio.cpp')
| -rw-r--r-- | src/KM_fileio.cpp | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/src/KM_fileio.cpp b/src/KM_fileio.cpp index c753012..03c3214 100644 --- a/src/KM_fileio.cpp +++ b/src/KM_fileio.cpp @@ -762,6 +762,16 @@ Kumu::FileWriter::Writev(const byte_t* buf, ui32_t buf_len) return RESULT_OK; } +Kumu::FileReader::FileReader() +{ + m_Handle = INVALID_HANDLE_VALUE; + assert(sizeof(off_t) <= sizeof(int64_t)); +} + +Kumu::FileReader::~FileReader() +{ + Kumu::FileReader::Close(); +} #ifdef KM_WIN32 #ifdef KM_WIN32_UTF8 @@ -816,18 +826,6 @@ Kumu::utf8_to_wbstr(const std::string& in, Kumu::ByteString& out) //------------------------------------------------------------------------------------------ // -Kumu::FileReader::FileReader() -{ - m_Handle = INVALID_HANDLE_VALUE; - assert(sizeof(off_t) <= sizeof(int64_t)); -} - -Kumu::FileReader::~FileReader() -{ - Kumu::FileReader::Close(); -} - -Kumu::Result_t Kumu::FileReader::OpenRead(const std::string& filename) const { const_cast<FileReader*>(this)->m_Filename = filename; @@ -1077,17 +1075,6 @@ Kumu::FileWriter::Write(const byte_t* buf, ui32_t buf_len, ui32_t* bytes_written // POSIX // -Kumu::FileReader::FileReader() -{ - m_Handle = INVALID_HANDLE_VALUE; - assert(sizeof(off_t) <= sizeof(int64_t)); -} - -// -Kumu::FileReader::~FileReader() -{ - Kumu::FileReader::Close(); -} Kumu::Result_t Kumu::FileReader::OpenRead(const std::string& filename) const |
