FileSystem.cpp 658 Bytes
Newer Older
1 2
#include "factory/FileSystem.h"
#include "filesystem/IDirectory.h"
3
#include "filesystem/IFile.h"
4 5 6

#if defined(__linux__) || defined(__APPLE__)
# include "filesystem/unix/Directory.h"
7
# include "filesystem/unix/File.h"
8 9 10 11 12 13 14 15 16 17 18 19
#else
# error No filesystem implementation for this architecture
#endif

namespace factory
{

std::unique_ptr<fs::IDirectory> FileSystemDefaultFactory::createDirectory( const std::string& path )
{
    return std::unique_ptr<fs::IDirectory>( new fs::Directory( path ) );
}

20
std::unique_ptr<fs::IFile> FileSystemDefaultFactory::createFile(const std::string& fileName)
21
{
22
    return std::unique_ptr<fs::IFile>( new fs::File( fileName ) );
23 24
}

25
}