2015-05-21 02:33:05 +00:00
|
|
|
|
|
|
|
|
2015-05-17 04:55:29 +00:00
|
|
|
#include "HECLDatabase.hpp"
|
|
|
|
|
|
|
|
#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)
|
|
|
|
{
|
2015-05-21 02:33:05 +00:00
|
|
|
case IDatabase::T_LOOSE:
|
2015-05-17 04:55:29 +00:00
|
|
|
return new CLooseDatabase(path, access);
|
2015-05-21 02:33:05 +00:00
|
|
|
case IDatabase::T_PACKED:
|
2015-05-17 04:55:29 +00:00
|
|
|
return new CPackedDatabase(path);
|
2015-05-21 02:33:05 +00:00
|
|
|
case IDatabase::T_MEMORY:
|
2015-05-17 04:55:29 +00:00
|
|
|
return new CMemoryDatabase(access);
|
2015-05-21 02:33:05 +00:00
|
|
|
case IDatabase::T_UNKNOWN:
|
2015-05-17 04:55:29 +00:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|