summaryrefslogtreecommitdiff
path: root/src/KM_fileio.h
diff options
context:
space:
mode:
authormilla <marc.illa@dolby.com>2021-06-15 13:12:01 +0200
committermilla <marc.illa@dolby.com>2021-06-15 13:13:12 +0200
commit8df78decb4e01b579bbbd1f479d187adf34fc030 (patch)
tree67151d234a56581e949b8d00e11c23fef166a4ff /src/KM_fileio.h
parentb423f01ad10fd3cf7f860cace315c7d06e74db06 (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.h')
-rwxr-xr-xsrc/KM_fileio.h39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/KM_fileio.h b/src/KM_fileio.h
index f7713fc..1ef5e75 100755
--- a/src/KM_fileio.h
+++ b/src/KM_fileio.h
@@ -67,7 +67,7 @@ namespace Kumu
};
- //
+ //
enum DirectoryEntryType_t {
DET_FILE,
DET_DIR,
@@ -84,7 +84,7 @@ namespace Kumu
KM_NO_COPY_CONSTRUCT(DirScannerEx);
public:
-
+
DirScannerEx();
~DirScannerEx() { Close(); }
@@ -133,7 +133,7 @@ namespace Kumu
//
// error: 'void Kumu::compile_time_size_checker() [with bool sizecheck = false]' previously declared here
//
- // This is happening because the equality being tested below is false. The reason for this
+ // This is happening because the equality being tested below is false. The reason for this
// will depend on your OS, but on Linux it is probably because you have not used -D_FILE_OFFSET_BITS=64
// Adding this magic macro to your CFLAGS will get you going again. If you are on a system that
// does not support 64-bit files, you can disable this check by using -DKM_SMALL_FILES_OK. You
@@ -190,7 +190,7 @@ namespace Kumu
std::string PathJoin(const std::string& Path1, const std::string& Path2, char separator = '/');
std::string PathJoin(const std::string& Path1, const std::string& Path2, const std::string& Path3, char separator = '/');
std::string PathJoin(const std::string& Path1, const std::string& Path2,
- const std::string& Path3, const std::string& Path4, char separator = '/');
+ const std::string& Path3, const std::string& Path4, char separator = '/');
//------------------------------------------------------------------------------------------
@@ -247,10 +247,10 @@ namespace Kumu
// Search all paths in SearchPaths for filenames matching Pattern (no directories are returned).
// Put results in FoundPaths. Returns after first find if one_shot is true.
PathList_t& FindInPath(const IPathMatch& Pattern, const std::string& SearchDir,
- PathList_t& FoundPaths, bool one_shot = false, char separator = '/');
+ PathList_t& FoundPaths, bool one_shot = false, char separator = '/');
PathList_t& FindInPaths(const IPathMatch& Pattern, const PathList_t& SearchPaths,
- PathList_t& FoundPaths, bool one_shot = false, char separator = '/');
+ PathList_t& FoundPaths, bool one_shot = false, char separator = '/');
std::string GetExecutablePath(const std::string& default_path);
@@ -294,7 +294,7 @@ namespace Kumu
//
// Unarchives a file into a buffer
Result_t ReadFileIntoBuffer(const std::string& Filename, Kumu::ByteString& Buffer,
- ui32_t max_size = 8 * Kumu::Megabyte);
+ ui32_t max_size = 8 * Kumu::Megabyte);
// Archives a buffer into a file
Result_t WriteBufferIntoFile(const Kumu::ByteString& Buffer, const std::string& Filename);
@@ -315,7 +315,7 @@ namespace Kumu
//------------------------------------------------------------------------------------------
//
class IFileReader
- {
+ {
public:
virtual ~IFileReader(){}
@@ -328,17 +328,17 @@ namespace Kumu
virtual bool IsOpen() const = 0; // returns true if the file is open
inline int64_t TellPosition() const // report the file pointer's location
- {
- int64_t tmp_pos;
- Tell(&tmp_pos);
- return tmp_pos;
- }
- };
+ {
+ int64_t tmp_pos;
+ Tell(&tmp_pos);
+ return tmp_pos;
+ }
+ };
//
class FileReader : public IFileReader
- {
- KM_NO_COPY_CONSTRUCT(FileReader);
+ {
+ KM_NO_COPY_CONSTRUCT(FileReader);
public:
FileReader();
@@ -350,14 +350,15 @@ namespace Kumu
virtual Result_t Tell(Kumu::fpos_t* pos) const; // report the file pointer's location
virtual Result_t Read(byte_t*, ui32_t, ui32_t* = 0) const; // read a buffer of data
- inline virtual bool IsOpen() const { // returns true if the file is open
- return (m_Handle != INVALID_HANDLE_VALUE);
+ inline virtual bool IsOpen() const // returns true if the file is open
+ {
+ return (m_Handle != INVALID_HANDLE_VALUE);
}
protected:
std::string m_Filename;
FileHandle m_Handle;
- };
+ };
//
class IFileReaderFactory