mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-02 18:47:01 -05:00 
			
		
		
		
	Make the File object virtual so I can override it
This commit is contained in:
		
							parent
							
								
									67f689c7fb
								
							
						
					
					
						commit
						a59bdda2db
					
				@ -78,42 +78,42 @@ class File
 | 
				
			|||||||
    bool Open(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_READ);
 | 
					    bool Open(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_READ);
 | 
				
			||||||
    void TOpen(const char *Name,const wchar *NameW=NULL);
 | 
					    void TOpen(const char *Name,const wchar *NameW=NULL);
 | 
				
			||||||
    bool WOpen(const char *Name,const wchar *NameW=NULL);
 | 
					    bool WOpen(const char *Name,const wchar *NameW=NULL);
 | 
				
			||||||
    bool Create(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_UPDATE|FMF_SHAREREAD);
 | 
					    virtual bool Create(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_UPDATE|FMF_SHAREREAD); // virtual added by Kovid
 | 
				
			||||||
    void TCreate(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_UPDATE|FMF_SHAREREAD);
 | 
					    virtual void TCreate(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_UPDATE|FMF_SHAREREAD); // virtual added by Kovid
 | 
				
			||||||
    bool WCreate(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_UPDATE|FMF_SHAREREAD);
 | 
					    virtual bool WCreate(const char *Name,const wchar *NameW=NULL,uint Mode=FMF_UPDATE|FMF_SHAREREAD); // virtual added by Kovid
 | 
				
			||||||
    bool Close();
 | 
					    virtual bool Close(); // virtual added by Kovid
 | 
				
			||||||
    void Flush();
 | 
					    virtual void Flush(); // virtual added by Kovid
 | 
				
			||||||
    bool Delete();
 | 
					    virtual bool Delete(); // virtual added by Kovid
 | 
				
			||||||
    bool Rename(const char *NewName,const wchar *NewNameW=NULL);
 | 
					    virtual bool Rename(const char *NewName,const wchar *NewNameW=NULL); // virtual added by Kovid
 | 
				
			||||||
    void Write(const void *Data,size_t Size);
 | 
					    virtual void Write(const void *Data,size_t Size); // virtual added by Kovid
 | 
				
			||||||
    int Read(void *Data,size_t Size);
 | 
					    virtual int Read(void *Data,size_t Size); // virtual added by Kovid
 | 
				
			||||||
    int DirectRead(void *Data,size_t Size);
 | 
					    virtual int DirectRead(void *Data,size_t Size); // virtual added by Kovid
 | 
				
			||||||
    void Seek(int64 Offset,int Method);
 | 
					    virtual void Seek(int64 Offset,int Method); // virtual added by Kovid
 | 
				
			||||||
    bool RawSeek(int64 Offset,int Method);
 | 
					    virtual bool RawSeek(int64 Offset,int Method); // virtual added by Kovid
 | 
				
			||||||
    int64 Tell();
 | 
					    virtual int64 Tell(); // virtual added by Kovid
 | 
				
			||||||
    void Prealloc(int64 Size);
 | 
					    virtual void Prealloc(int64 Size); // virtual added by Kovid
 | 
				
			||||||
    byte GetByte();
 | 
					    virtual byte GetByte(); // virtual added by Kovid
 | 
				
			||||||
    void PutByte(byte Byte);
 | 
					    virtual void PutByte(byte Byte); // virtual added by Kovid
 | 
				
			||||||
    bool Truncate();
 | 
					    virtual bool Truncate(); // virtual added by Kovid
 | 
				
			||||||
    void SetOpenFileTime(RarTime *ftm,RarTime *ftc=NULL,RarTime *fta=NULL);
 | 
					    virtual void SetOpenFileTime(RarTime *ftm,RarTime *ftc=NULL,RarTime *fta=NULL); // virtual added by Kovid
 | 
				
			||||||
    void SetCloseFileTime(RarTime *ftm,RarTime *fta=NULL);
 | 
					    virtual void SetCloseFileTime(RarTime *ftm,RarTime *fta=NULL); // virtual added by Kovid
 | 
				
			||||||
    static void SetCloseFileTimeByName(const char *Name,RarTime *ftm,RarTime *fta); 
 | 
					    static void SetCloseFileTimeByName(const char *Name,RarTime *ftm,RarTime *fta); 
 | 
				
			||||||
    void GetOpenFileTime(RarTime *ft);
 | 
					    virtual void GetOpenFileTime(RarTime *ft); // virtual added by Kovid
 | 
				
			||||||
    bool IsOpened() {return(hFile!=BAD_HANDLE);};
 | 
					    virtual bool IsOpened() {return(hFile!=BAD_HANDLE);}; // virtual added by Kovid
 | 
				
			||||||
    int64 FileLength();
 | 
					    virtual int64 FileLength(); // virtual added by Kovid
 | 
				
			||||||
    void SetHandleType(FILE_HANDLETYPE Type);
 | 
					    virtual void SetHandleType(FILE_HANDLETYPE Type); // virtual added by Kovid
 | 
				
			||||||
    FILE_HANDLETYPE GetHandleType() {return(HandleType);};
 | 
					    virtual FILE_HANDLETYPE GetHandleType() {return(HandleType);}; // virtual added by Kovid
 | 
				
			||||||
    bool IsDevice();
 | 
					    virtual bool IsDevice(); // virtual added by Kovid
 | 
				
			||||||
    void fprintf(const char *fmt,...);
 | 
					    virtual void fprintf(const char *fmt,...); // virtual added by Kovid
 | 
				
			||||||
    static bool RemoveCreated(); 
 | 
					    static bool RemoveCreated(); 
 | 
				
			||||||
    FileHandle GetHandle() {return(hFile);};
 | 
					    virtual FileHandle GetHandle() {return(hFile);}; // virtual added by Kovid
 | 
				
			||||||
    void SetIgnoreReadErrors(bool Mode) {IgnoreReadErrors=Mode;};
 | 
					    virtual void SetIgnoreReadErrors(bool Mode) {IgnoreReadErrors=Mode;}; // virtual added by Kovid
 | 
				
			||||||
    char *GetName() {return(FileName);}
 | 
					    virtual char *GetName() {return(FileName);} // virtual added by Kovid
 | 
				
			||||||
    int64 Copy(File &Dest,int64 Length=INT64NDF);
 | 
					    virtual int64 Copy(File &Dest,int64 Length=INT64NDF); // virtual added by Kovid
 | 
				
			||||||
    void SetAllowDelete(bool Allow) {AllowDelete=Allow;}
 | 
					    virtual void SetAllowDelete(bool Allow) {AllowDelete=Allow;} // virtual added by Kovid
 | 
				
			||||||
    void SetExceptions(bool Allow) {AllowExceptions=Allow;}
 | 
					    virtual void SetExceptions(bool Allow) {AllowExceptions=Allow;} // virtual added by Kovid
 | 
				
			||||||
#ifdef _WIN_ALL
 | 
					#ifdef _WIN_ALL
 | 
				
			||||||
    void RemoveSequentialFlag() {NoSequentialRead=true;}
 | 
					    virtual void RemoveSequentialFlag() {NoSequentialRead=true;} // virtual added by Kovid
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user