The purpose of the File API is to provide a flexible, and nonetheless fast interface for accessing files. The main idea is to provide two classes, one fast inline class for OS file access, and one class that implements a standard auto interface AIFile (see Object Manager reference for auto interfaces description). Besides, note that the file interface should be platform-independent. This idea is implemented in the following way:
-
Each platform defines a namespace _PlatformSpecificConstants that contains definitions for various operation constants (such as file access mode)
-
The platform-specific constants are used when defining various enumerations inside the FileFlags namespace. The two-step declaration ensures that multiple platforms have the same value sets that differ only by values
-
A platform-independant file interface is defined in BZSCMN module
-
Each platform defines a class named OSFile that implements the AIFile interface and a class named OSDirectory for AIDirectory.
-
A pair of similar classes named File and Directory are defined by each platform to provide inline file access.