68 lines
1.5 KiB
C++
68 lines
1.5 KiB
C++
#include "StdAfx.h"
|
|
#include "PropertyLoader.h"
|
|
#include "PropertyManager.h"
|
|
#include "Property.h"
|
|
|
|
bool CPropertyLoader::OnFolder(const char* c_szFilter, const char* c_szPathName, const char* c_szFileName)
|
|
{
|
|
std::string stPathName = "";
|
|
stPathName += c_szPathName;
|
|
stPathName += c_szFileName;
|
|
|
|
CPropertyLoader PropertyLoader;
|
|
PropertyLoader.SetPropertyManager(m_pPropertyManager);
|
|
PropertyLoader.Create(c_szFilter, stPathName.c_str());
|
|
return true;
|
|
}
|
|
|
|
bool CPropertyLoader::OnFile(const char* c_szPathName, const char* c_szFileName)
|
|
{
|
|
RegisterFile(c_szPathName, c_szFileName);
|
|
return true;
|
|
}
|
|
|
|
DWORD CPropertyLoader::RegisterFile(const char * c_szPathName, const char * c_szFileName)
|
|
{
|
|
std::string strFileName = "";
|
|
strFileName += c_szPathName;
|
|
strFileName += c_szFileName;
|
|
|
|
std::string stExt;
|
|
GetFileExtension(strFileName.c_str(), strFileName.length(), &stExt);
|
|
|
|
stl_lowers(stExt);
|
|
stl_lowers(strFileName);
|
|
|
|
StringPath(strFileName);
|
|
|
|
if (0 == strFileName.compare("property/reserve"))
|
|
{
|
|
m_pPropertyManager->LoadReservedCRC(strFileName.c_str());
|
|
return 1;
|
|
}
|
|
else
|
|
{
|
|
CProperty * pProperty;
|
|
|
|
if (m_pPropertyManager->Register(strFileName.c_str(), &pProperty))
|
|
return pProperty->GetCRC();
|
|
else
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
void CPropertyLoader::SetPropertyManager(CPropertyManager * pPropertyManager)
|
|
{
|
|
m_pPropertyManager = pPropertyManager;
|
|
}
|
|
|
|
CPropertyLoader::CPropertyLoader()
|
|
{
|
|
m_pPropertyManager = NULL;
|
|
}
|
|
|
|
CPropertyLoader::~CPropertyLoader()
|
|
{
|
|
}
|
|
//martysama0134's 2e58d0b8baeb072acdf3afc4a5d1999f
|