unrarsrc  6.1.7
About: unrar extracts, views and tests the contents of archives created with the RAR archiver.
  Fossies Dox: unrarsrc-6.1.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

File Class Reference

#include <file.hpp>

Inheritance diagram for File:
[legend]

Public Member Functions

 File ()
 
virtual ~File ()
 
void operator= (File &SrcFile)
 
virtual bool Open (const wchar *Name, uint Mode=FMF_READ)
 
void TOpen (const wchar *Name)
 
bool WOpen (const wchar *Name)
 
bool Create (const wchar *Name, uint Mode=FMF_UPDATE|FMF_SHAREREAD)
 
void TCreate (const wchar *Name, uint Mode=FMF_UPDATE|FMF_SHAREREAD)
 
bool WCreate (const wchar *Name, uint Mode=FMF_UPDATE|FMF_SHAREREAD)
 
virtual bool Close ()
 
bool Delete ()
 
bool Rename (const wchar *NewName)
 
bool Write (const void *Data, size_t Size)
 
virtual int Read (void *Data, size_t Size)
 
int DirectRead (void *Data, size_t Size)
 
virtual void Seek (int64 Offset, int Method)
 
bool RawSeek (int64 Offset, int Method)
 
virtual int64 Tell ()
 
void Prealloc (int64 Size)
 
byte GetByte ()
 
void PutByte (byte Byte)
 
bool Truncate ()
 
void Flush ()
 
void SetOpenFileTime (RarTime *ftm, RarTime *ftc=NULL, RarTime *fta=NULL)
 
void SetCloseFileTime (RarTime *ftm, RarTime *fta=NULL)
 
void GetOpenFileTime (RarTime *ft)
 
virtual bool IsOpened ()
 
int64 FileLength ()
 
void SetHandleType (FILE_HANDLETYPE Type)
 
void SetLineInputMode (bool Mode)
 
FILE_HANDLETYPE GetHandleType ()
 
bool IsSeekable ()
 
bool IsDevice ()
 
FileHandle GetHandle ()
 
void SetHandle (FileHandle Handle)
 
void SetReadErrorMode (FILE_READ_ERROR_MODE Mode)
 
int64 Copy (File &Dest, int64 Length=INT64NDF)
 
void SetAllowDelete (bool Allow)
 
void SetExceptions (bool Allow)
 
void SetPreserveAtime (bool Preserve)
 
bool IsTruncatedAfterReadError ()
 

Static Public Member Functions

static void SetCloseFileTimeByName (const wchar *Name, RarTime *ftm, RarTime *fta)
 
static bool RemoveCreated ()
 
static size_t CopyBufferSize ()
 

Public Attributes

wchar FileName [NM]
 
FILE_ERRORTYPE ErrorType
 

Protected Attributes

bool OpenShared
 

Private Attributes

FileHandle hFile
 
bool LastWrite
 
FILE_HANDLETYPE HandleType
 
bool LineInput
 
bool SkipClose
 
FILE_READ_ERROR_MODE ReadErrorMode
 
bool NewFile
 
bool AllowDelete
 
bool AllowExceptions
 
bool PreserveAtime
 
bool TruncatedAfterReadError
 
int64 CurFilePos
 

Detailed Description

Definition at line 56 of file file.hpp.

Constructor & Destructor Documentation

◆ File()

◆ ~File()

File::~File ( )
virtual

Definition at line 26 of file file.cpp.

References Close(), Delete(), FILE_BAD_HANDLE, hFile, NewFile, and SkipClose.

Member Function Documentation

◆ Close()

◆ Copy()

int64 File::Copy ( File Dest,
int64  Length = INT64NDF 
)

Definition at line 774 of file file.cpp.

References CopyBufferSize(), INT64NDF, Read(), Array< T >::Size(), Wait(), and Write().

◆ CopyBufferSize()

static size_t File::CopyBufferSize ( )
inlinestatic

Definition at line 148 of file file.hpp.

References WinNT(), and WNT_WXP.

Referenced by Copy(), and CmdExtract::UnstoreFile().

◆ Create()

◆ Delete()

bool File::Delete ( )

Definition at line 271 of file file.cpp.

References AllowDelete, Close(), DelFile(), FILE_BAD_HANDLE, FILE_HANDLENORMAL, FileName, HandleType, and hFile.

Referenced by ~File().

◆ DirectRead()

int File::DirectRead ( void *  Data,
size_t  Size 
)

Definition at line 448 of file file.cpp.

References DirectRead(), FILE_HANDLENORMAL, FILE_HANDLESTD, HandleType, hFile, IsDevice(), LastWrite, and Read().

Referenced by DirectRead(), and Read().

◆ FileLength()

◆ Flush()

void File::Flush ( )

Definition at line 650 of file file.cpp.

References hFile.

◆ GetByte()

byte File::GetByte ( )

Definition at line 626 of file file.cpp.

References Read().

Referenced by Archive::DoGetComment(), Archive::ReadHeader15(), RecVolumes3::Restore(), and RecVolumes3::Test().

◆ GetHandle()

FileHandle File::GetHandle ( )
inline

Definition at line 130 of file file.hpp.

References hFile.

◆ GetHandleType()

FILE_HANDLETYPE File::GetHandleType ( )
inline

Definition at line 126 of file file.hpp.

References HandleType.

◆ GetOpenFileTime()

void File::GetOpenFileTime ( RarTime ft)

Definition at line 735 of file file.cpp.

References hFile, and RarTime::SetUnix().

◆ IsDevice()

bool File::IsDevice ( )

Definition at line 760 of file file.cpp.

References FILE_BAD_HANDLE, and hFile.

Referenced by DirectRead(), CmdExtract::ExtractCurrentFile(), and Archive::IsArchive().

◆ IsOpened()

virtual bool File::IsOpened ( )
inlinevirtual

Definition at line 122 of file file.hpp.

References FILE_BAD_HANDLE, and hFile.

Referenced by ProcessFile(), and ComprDataIO::UnpRead().

◆ IsSeekable()

bool File::IsSeekable ( )
inline

◆ IsTruncatedAfterReadError()

bool File::IsTruncatedAfterReadError ( )
inline

Definition at line 137 of file file.hpp.

References TruncatedAfterReadError.

◆ Open()

◆ operator=()

void File::operator= ( File SrcFile)

Definition at line 36 of file file.cpp.

References ASIZE, FileName, HandleType, hFile, LastWrite, NewFile, SkipClose, TruncatedAfterReadError, and wcsncpyz().

◆ Prealloc()

void File::Prealloc ( int64  Size)

Definition at line 606 of file file.cpp.

References RawSeek(), Seek(), and Truncate().

Referenced by CmdExtract::ExtractCurrentFile(), and RecVolumes5::Restore().

◆ PutByte()

void File::PutByte ( byte  Byte)

Definition at line 634 of file file.cpp.

References Write().

Referenced by RecVolumes3::Restore().

◆ RawSeek()

bool File::RawSeek ( int64  Offset,
int  Method 
)

Definition at line 521 of file file.cpp.

References ASIZE, CurFilePos, FILE_BAD_HANDLE, FileLength(), hFile, IsSeekable(), LastWrite, Min, Read(), and Tell().

Referenced by Prealloc(), and Seek().

◆ Read()

◆ RemoveCreated()

static bool File::RemoveCreated ( )
static

◆ Rename()

bool File::Rename ( const wchar NewName)

Definition at line 283 of file file.cpp.

References ASIZE, FileName, RenameFile(), and wcsncpyz().

◆ Seek()

◆ SetAllowDelete()

void File::SetAllowDelete ( bool  Allow)
inline

Definition at line 134 of file file.hpp.

References AllowDelete.

Referenced by CmdExtract::ExtractCurrentFile().

◆ SetCloseFileTime()

void File::SetCloseFileTime ( RarTime ftm,
RarTime fta = NULL 
)

Definition at line 687 of file file.cpp.

References FileName, and SetCloseFileTimeByName().

Referenced by CmdExtract::ExtractCurrentFile().

◆ SetCloseFileTimeByName()

void File::SetCloseFileTimeByName ( const wchar Name,
RarTime ftm,
RarTime fta 
)
static

Definition at line 701 of file file.cpp.

References ASIZE, RarTime::GetUnix(), RarTime::GetUnixNS(), RarTime::IsSet(), and WideToChar().

Referenced by SetCloseFileTime(), and SetDirTime().

◆ SetExceptions()

void File::SetExceptions ( bool  Allow)
inline

Definition at line 135 of file file.hpp.

References AllowExceptions.

◆ SetHandle()

void File::SetHandle ( FileHandle  Handle)
inline

Definition at line 131 of file file.hpp.

References Close(), and hFile.

Referenced by CreateReparsePoint().

◆ SetHandleType()

void File::SetHandleType ( FILE_HANDLETYPE  Type)
inline

Definition at line 124 of file file.hpp.

References HandleType.

Referenced by CmdExtract::ExtractArchive(), CmdExtract::ExtrCreateFile(), getwstr(), and ReadTextFile().

◆ SetLineInputMode()

void File::SetLineInputMode ( bool  Mode)
inline

Definition at line 125 of file file.hpp.

References LineInput.

Referenced by getwstr().

◆ SetOpenFileTime()

void File::SetOpenFileTime ( RarTime ftm,
RarTime ftc = NULL,
RarTime fta = NULL 
)

Definition at line 663 of file file.cpp.

References FMF_UNDEFINED, FMF_WRITE, hFile, and RarTime::IsSet().

Referenced by CreateReparsePoint(), and CmdExtract::ExtractCurrentFile().

◆ SetPreserveAtime()

void File::SetPreserveAtime ( bool  Preserve)
inline

Definition at line 136 of file file.hpp.

References PreserveAtime.

◆ SetReadErrorMode()

void File::SetReadErrorMode ( FILE_READ_ERROR_MODE  Mode)
inline

Definition at line 132 of file file.hpp.

References ReadErrorMode.

◆ TCreate()

void File::TCreate ( const wchar Name,
uint  Mode = FMF_UPDATE|FMF_SHAREREAD 
)

Definition at line 224 of file file.cpp.

References ErrHandler, ErrorHandler::Exit(), RARX_FATAL, and WCreate().

◆ Tell()

◆ TOpen()

void File::TOpen ( const wchar Name)

Definition at line 159 of file file.cpp.

References ErrHandler, ErrorHandler::Exit(), RARX_OPEN, and WOpen().

Referenced by Archive::CheckOpen(), and RecVolumes3::Restore().

◆ Truncate()

bool File::Truncate ( )

Definition at line 640 of file file.cpp.

References hFile, Tell(), and TRUE.

Referenced by CmdExtract::ExtractCurrentFile(), Prealloc(), and RecVolumes3::Restore().

◆ WCreate()

bool File::WCreate ( const wchar Name,
uint  Mode = FMF_UPDATE|FMF_SHAREREAD 
)

Definition at line 232 of file file.cpp.

References Create(), ErrorHandler::CreateErrorMsg(), and ErrHandler.

Referenced by TCreate().

◆ WOpen()

◆ Write()

Member Data Documentation

◆ AllowDelete

bool File::AllowDelete
private

Definition at line 75 of file file.hpp.

Referenced by Delete(), File(), and SetAllowDelete().

◆ AllowExceptions

bool File::AllowExceptions
private

Definition at line 76 of file file.hpp.

Referenced by Close(), File(), Read(), Seek(), SetExceptions(), Tell(), and Write().

◆ CurFilePos

int64 File::CurFilePos
private

Definition at line 84 of file file.hpp.

Referenced by File(), RawSeek(), Read(), and Tell().

◆ ErrorType

FILE_ERRORTYPE File::ErrorType

Definition at line 90 of file file.hpp.

Referenced by File(), Open(), and Read().

◆ FileName

◆ HandleType

FILE_HANDLETYPE File::HandleType
private

◆ hFile

◆ LastWrite

bool File::LastWrite
private

Definition at line 60 of file file.hpp.

Referenced by DirectRead(), File(), operator=(), RawSeek(), and Write().

◆ LineInput

bool File::LineInput
private

Definition at line 70 of file file.hpp.

Referenced by File(), Read(), and SetLineInputMode().

◆ NewFile

bool File::NewFile
private

Definition at line 74 of file file.hpp.

Referenced by Create(), File(), Open(), operator=(), and ~File().

◆ OpenShared

bool File::OpenShared
protected

Definition at line 86 of file file.hpp.

Referenced by Archive::Archive(), Create(), File(), and Open().

◆ PreserveAtime

bool File::PreserveAtime
private

Definition at line 81 of file file.hpp.

Referenced by File(), Open(), and SetPreserveAtime().

◆ ReadErrorMode

FILE_READ_ERROR_MODE File::ReadErrorMode
private

Definition at line 73 of file file.hpp.

Referenced by File(), Read(), and SetReadErrorMode().

◆ SkipClose

bool File::SkipClose
private

Definition at line 72 of file file.hpp.

Referenced by Close(), Create(), File(), Open(), operator=(), and ~File().

◆ TruncatedAfterReadError

bool File::TruncatedAfterReadError
private

Definition at line 82 of file file.hpp.

Referenced by File(), IsTruncatedAfterReadError(), Open(), operator=(), and Read().


The documentation for this class was generated from the following files: