我有个问题。我有很多以这种方式使用 ifstreams 的代码:
前任:
bool AudioManager::_loadSounds( const std::string& path, const std::string& appendPath )
{
//open the file
std::ifstream ifs( path.c_str() );
//ensure it is open
if(!ifs.is_open())
{
return false;
}
std::string line;
//read each sound
while( getline( ifs, line ) )
{
...
问题是我需要在应用程序范围内进行更改才能使用 PhysFS。所有数据将保持结构相同的目录明智,除了它将被划分为 zip 文件。
有没有一种简单的方法可以让 PhysFS 应用于 ifstreams,这样我就不需要修改所有这些类?