[quote=“thebluefish”]File::Open seems to be what you want.
Alternatively you can use ResourceCache to open it.[/quote]
I’m looking at resource cache documentation but just not sure how to open it. I have something like
[code]// load game assets
bool GameAssetData::LoadGameAssets(Vector<GameAsset*>* AllData)
{
// Get Resource
ResourceCache* resCache = g_pApp->GetConstantResCache();
// create a empty file
Vector<String> m_datafiles;
String m_UsePackage;
// search files
for(unsigned i=0; i<=m_pDataFiles->Size(); ++i)
{
// temporary clear data
m_datafiles.Clear();
m_datafiles = SWResourceCache::Match(g_pApp->GetConstantResCache(), m_pDataFiles->At(i), m_pDataPath->CString());
// if file is found
if(m_datafiles.Size()>0)
{
// Use this package
UsePackage.Append(m_pDataFiles->at(i));
break;
}
}
// If datafiles is 0 or empty return - meaning nothing was found
if(UsePackage.Empty())
{
return false;
}
// Set File Pointer to file
SharedPtr<File> m_DataFile = rescache->GetFile("GameAssetOption.xml");
return true;
}[/code]