part4: adapt codebase to changes in lib/

mostly straightforward except for CVSFile / Filesystem. moved the former
into the newly created latter component. removed VFSUtil entirely (that
functionality is available from lib/file/file_system_util.h)

Xeromyces.cpp: simplify buffer handling since smart pointers are now in
play. also use WriteBuffer instead of membuffer.

This was SVN commit r5519.
This commit is contained in:
janwas
2007-12-20 20:21:45 +00:00
parent 63086f4e26
commit e2eb5b2610
68 changed files with 619 additions and 980 deletions
+7 -9
View File
@@ -2,29 +2,27 @@
#include "TechnologyCollection.h"
#include "ps/CLogger.h"
#include "ps/VFSUtil.h"
#include "ps/Player.h"
#define LOG_CATEGORY "tech"
void CTechnologyCollection::LoadFile( const char* path )
void CTechnologyCollection::LoadFile( const VfsPath& pathname )
{
//Make tech file reading
CStrW tag = CStr(path).AfterLast("/").BeforeLast(".xml");
m_techFilenames[tag] = path;
CStrW basename(Basename(pathname));
m_techFilenames[basename] = pathname.string();
}
static void LoadTechThunk( const char* path, const DirEnt* UNUSED(ent), uintptr_t cbData )
static LibError LoadTechThunk( const VfsPath& pathname, const FileInfo& UNUSED(fileInfo), uintptr_t cbData )
{
CTechnologyCollection* this_ = (CTechnologyCollection*)cbData;
this_->LoadFile(path);
this_->LoadFile(pathname);
return INFO::CB_CONTINUE;
}
int CTechnologyCollection::LoadTechnologies()
{
// Load all files in techs/ and subdirectories.
THROW_ERR( vfs_dir_enum( "technologies/", VFS_DIR_RECURSIVE, "*.xml",
LoadTechThunk, (uintptr_t)this ) );
THROW_ERR( fs_ForEachFile(g_VFS, "technologies/", LoadTechThunk, (uintptr_t)this, "*.xml", DIR_RECURSIVE));
return 0;
}