-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathfs_factory_impl.cpp
More file actions
40 lines (28 loc) · 954 Bytes
/
fs_factory_impl.cpp
File metadata and controls
40 lines (28 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "fs/impl/fs_factory_impl.hpp"
#include "fs/impl/memory/fs_memory_file_system.hpp"
#include "fs/impl/physical/fs_physical_file_system.hpp"
//------------------------------------------------------------------------------
namespace fs
{
//------------------------------------------------------------------------------
FactoryImpl::~FactoryImpl() = default;
//------------------------------------------------------------------------------
FileSystem & FactoryImpl::getPhysicalFileSystem()
{
if( !m_physicalFs )
{
m_physicalFs = std::make_unique< physical::PhysicalFileSystem >();
}
return *m_physicalFs;
}
//------------------------------------------------------------------------------
FileSystem & FactoryImpl::getMemoryFileSystem()
{
if( !m_memoryFs )
{
m_memoryFs = std::make_unique< memory::MemoryFileSystem >();
}
return *m_memoryFs;
}
//------------------------------------------------------------------------------
}