The file abstractions mentioned in the preceding section are very powerful. They can be used to create nested mount points to access files packed within other files. Let's demonstrate the flexibility of this approach by defining clAliasMountPoint,
which acts like a symbolic link on Unix or NTFS filesystems.
The implementation redirects each iMountPoint::
method call to another mount point instance while transforming the file name on the fly by prepending each virtual file name we want to access with a specified FAlias
prefix:
class clAliasMountPoint: public iMountPoint { public: explicit clAliasMountPoint( const clPtr<iMountPoint>& Src ) : Falias(), FMP( Src ) {} virtual bool FileExists( const std::string& VirtualName ) const { return FMP->FileExists( FAlias + VirtualName ); } virtual std::string MapName( const std::string& VirtualName ) const { return FMP->MapName( FAlias + VirtualName ); } virtual clPtr<iRawFile> CreateReader( const std...