home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Runimage / Delphi50 / Source / Toolsapi / FILEINTF.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  3.8 KB  |  84 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Visual Component Library         }
  5. {                                                       }
  6. {       Copyright (c) 1995,99 Inprise Corporation       }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit FileIntf;
  11.  
  12. interface
  13.  
  14. uses ActiveX, SysUtils, VirtIntf;
  15.  
  16. {
  17.   This is the definition of the IDE's virtual file system.  An expert,
  18.   VCS manager, property editor, or component editor can register a new
  19.   file system interface with the IDE.  This allows for re-vectoring of
  20.   file operations to the editor and form/data model designer.
  21.   NOTE: Currently the only way to specify an alternate file system for
  22.         a file, is to open it through the Tools API (See ToolIntf.pas).
  23.         This is also only for saving/loading of files.  The default file
  24.         open/save dialogs and file system will always be used by the IDE
  25.         except in the case mentioned above.
  26.  
  27.   All references to the term "file" depend on how it is defined by the
  28.   file system.  The "file" could be a Memo Blob field, SQL text, etc...
  29.  
  30.   A file system instance must provide the following;
  31.  
  32.   GetFileStream     -  This is the core of the file system.  The file system
  33.                        must return an instance of a TIStream for reading/
  34.                        writing according to the Mode (see Classes.pas for
  35.                        mode values).
  36.   FileAge           -  This should return long value corresponding to the DOS
  37.                        file date format.
  38.   RenameFile        -  Returns True if the file system was able to rename the
  39.                        file.
  40.   IsReadonly        -  Return True if the given file is read only.
  41.   IsFileBased       -  Return True if the file system closely matches the OS
  42.                        file system.  If this is False, certain operations
  43.                        are not performed.
  44.   DeleteFile        -  Return True is the file was successfully deleted.
  45.   FileExists        -  Return True if the specifiedl file exists in this
  46.                        file system.
  47.   GetTempFileName   -  Returns a Temporary file name based on the name given.
  48.   GetBackupFileName -  Returns a backup file name based on the name given.
  49.                        By convention, the extension is shifted one character
  50.                        to the right and a tilde '~' character is inserted.
  51.                        (eg unit1.pas -> unit1.~pa).
  52.   GetIDString       -  Returns a unique ID string used to identify the file
  53.                        system. By conventions this string should be in the
  54.                        form <Vendor or Product>.<FileSystemName>.
  55.                        (eg. Borland.SQLFileSystem ).
  56. }
  57.  
  58. type
  59.   TIVirtualFileSystem = class(TInterface)
  60.   public
  61.     function GetFileStream(const FileName: TFileName; Mode: Integer): IStream;
  62.       virtual; stdcall; abstract;
  63.     function FileAge(const FileName: TFileName): Longint;
  64.       virtual; stdcall; abstract;
  65.     function RenameFile(const OldName, NewName: TFileName): Boolean;
  66.       virtual; stdcall; abstract;
  67.     function IsReadonly(const FileName: TFileName): Boolean;
  68.       virtual; stdcall; abstract;
  69.     function IsFileBased: Boolean; virtual; stdcall; abstract;
  70.     function DeleteFile(const FileName: TFileName): Boolean;
  71.       virtual; stdcall; abstract;
  72.     function FileExists(const FileName: TFileName): Boolean;
  73.       virtual; stdcall; abstract;
  74.     function GetTempFileName(const FileName: TFileName): TFileName;
  75.       virtual; stdcall; abstract;
  76.     function GetBackupFileName(const FileName: TFileName): TFileName;
  77.       virtual; stdcall; abstract;
  78.     function GetIDString: string; virtual; stdcall; abstract;
  79.   end;
  80.  
  81. implementation
  82.  
  83. end.
  84.