Game Development Reference
In-Depth Information
class AliasMountPoint: public iMountPoint
{
public:
AliasMountPoint( const clPtr<iMountPoint>& Src );
virtual ~AliasMountPoint();
Set the alias path:
void SetAlias( const std::string& Alias )
{
FAlias = Alias;
Str_AddTrailingChar( &FAlias, PATH_SEPARATOR );
}
virtual clPtr<iRawFile> CreateReader(
const std::string& VirtualName ) const
{ return FMP->CreateReader( FAlias + VirtualName ); }
private:
Set a preix to be appended to each ile in this mount point:
std::string FAlias;
Set a pointer to another mount point, which is hidden behind the alias:
clPtr<iMountPoint> FMP;
};
This decorator class will add the FAlias string before any ilename passed into it. This simple
mount point is useful when developing for both Android and Windows, because in Android
.apk , the iles reside lower in the folder hierarchy than they do in a Windows development
folder. Later we determine the folder, where our Android application resides, and mount it
using the AliasMountPoint class.
As a reminder, the following is the class diagram of our iMountPoint interface and its
implementations:
 
Search WWH ::




Custom Search