metaforce/hecl/lib/database/HECLDatabase.cpp

28 lines
597 B
C++
Raw Normal View History

2015-05-17 04:55:29 +00:00
#include "HECLDatabase.hpp"
#define HECLDATABASE_CPP
#include "CLooseDatabase.hpp"
#include "CPackedDatabase.hpp"
#include "CMemoryDatabase.hpp"
namespace HECLDatabase
{
IDatabase* NewDatabase(IDatabase::Type type, IDatabase::Access access, const std::string& path)
{
switch (type)
{
case IDatabase::LOOSE:
return new CLooseDatabase(path, access);
case IDatabase::PACKED:
return new CPackedDatabase(path);
case IDatabase::MEMORY:
return new CMemoryDatabase(access);
case IDatabase::UNKNOWN:
return nullptr;
}
return nullptr;
}
}