On Android, the test.txt
file is most likely to reside in the .apk
package and a lot of work needs to happen within the CreateReader()
call. The data for test.txt
is extracted and an instance of clMemFileMapper
is created. Let's travel down the hidden pipeline of file operations.
The code for CreateReader()
is simple. First, we convert the slashes and backslashes in the path to match those of the underlying operating system. Then a mount point is found which hosts the file named FileName
. Finally, an instance of clFileMapper
is created. This class implements the iIStream
interface. Let's take a closer look at all these classes:
clPtr<iIStream> clFileSystem::CreateReader( const std::string& FileName ) const { std::string Name = Arch_FixFileName( FileName ); clPtr<iMountPoint> MountPoint = FindMountPoint( Name );
Here we use the Null Object pattern (http://en.wikipedia.org/wiki/Null_Object_pattern) to define neutral behavior in the case of a non...