From 28bef31ea80478fe58bc4eeaf1b245005f15b36a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 25 Sep 2018 17:38:16 -0400 Subject: vfs_concat/vfs_layered: Remove friend declarations from ConcatenatedVfsFile Given these are only added to the class to allow those functions to access the private constructor, it's a better approach to just make them static functions in the interface, to make the dependency explicit. --- src/core/file_sys/vfs_concat.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/core/file_sys/vfs_concat.h') diff --git a/src/core/file_sys/vfs_concat.h b/src/core/file_sys/vfs_concat.h index 17fa40ade..c90f9d5d1 100644 --- a/src/core/file_sys/vfs_concat.h +++ b/src/core/file_sys/vfs_concat.h @@ -14,16 +14,20 @@ namespace FileSys { // Class that wraps multiple vfs files and concatenates them, making reads seamless. Currently // read-only. class ConcatenatedVfsFile : public VfsFile { - friend VirtualFile ConcatenateFiles(std::vector files, std::string name); - friend VirtualFile ConcatenateFiles(u8 filler_byte, std::map files, - std::string name); - ConcatenatedVfsFile(std::vector files, std::string name); ConcatenatedVfsFile(std::map files, std::string name); public: ~ConcatenatedVfsFile() override; + /// Wrapper function to allow for more efficient handling of files.size() == 0, 1 cases. + static VirtualFile MakeConcatenatedFile(std::vector files, std::string name); + + /// Convenience function that turns a map of offsets to files into a concatenated file, filling + /// gaps with a given filler byte. + static VirtualFile MakeConcatenatedFile(u8 filler_byte, std::map files, + std::string name); + std::string GetName() const override; std::size_t GetSize() const override; bool Resize(std::size_t new_size) override; @@ -40,11 +44,4 @@ private: std::string name; }; -// Wrapper function to allow for more efficient handling of files.size() == 0, 1 cases. -VirtualFile ConcatenateFiles(std::vector files, std::string name); - -// Convenience function that turns a map of offsets to files into a concatenated file, filling gaps -// with a given filler byte. -VirtualFile ConcatenateFiles(u8 filler_byte, std::map files, std::string name); - } // namespace FileSys -- cgit v1.2.3