#include <CStdFile.h>
Public Member Functions | |
| CStdFile () | |
| ~CStdFile () override | |
| bool | Create (const char *szFileName, bool fCompressed=false, bool fExecutable=false, bool fMemory=false) |
| bool | Open (const char *szFileName, bool fCompressed=false) |
| bool | Append (const char *szFilename, bool text=false) |
| bool | Close (StdBuf **ppMemory=nullptr) |
| bool | Default () |
| bool | Read (void *pBuffer, size_t iSize) override |
| bool | Read (void *pBuffer, size_t iSize, size_t *ipFSize) |
| bool | Write (const void *pBuffer, int iSize) |
| bool | WriteString (const char *szStr) |
| bool | Rewind () |
| bool | Advance (int iOffset) override |
| int | Seek (long int offset, int whence) |
| long int | Tell () |
| bool | IsOpen () const |
| bool | Flush () |
| size_t | AccessedEntrySize () const override |
Public Attributes | |
| bool | Status |
| char | Name [_MAX_PATH_LEN] |
Protected Member Functions | |
| void | ClearBuffer () |
| int | LoadBuffer () |
| bool | SaveBuffer () |
Protected Attributes | |
| FILE * | hFile |
| gzFile | hgzFile |
| StdBuf * | pMemory |
| int | MemoryPtr |
| BYTE | Buffer [CStdFileBufSize] |
| int | BufferLoad |
| int | BufferPtr |
| bool | ModeWrite |
| StdThreadCheck | thread_check |
Definition at line 38 of file CStdFile.h.
| CStdFile::CStdFile | ( | ) |
Definition at line 32 of file CStdFile.cpp.
References ClearBuffer(), hFile, hgzFile, ModeWrite, Name, pMemory, StdThreadCheck::Set(), Status, and thread_check.
|
override |
Definition at line 44 of file CStdFile.cpp.
References Close().
|
overridevirtual |
Implements CStdStream.
Definition at line 347 of file CStdFile.cpp.
References FileSize(), hFile, and hgzFile.
|
overridevirtual |
Implements CStdStream.
Definition at line 285 of file CStdFile.cpp.
References BufferLoad, BufferPtr, StdThreadCheck::Check(), hFile, LoadBuffer(), ModeWrite, and thread_check.
| bool CStdFile::Append | ( | const char * | szFilename, |
| bool | text = false |
||
| ) |
Definition at line 132 of file CStdFile.cpp.
References _MAX_PATH, ClearBuffer(), GetWideChar(), hFile, ModeWrite, Name, SCopy(), StdThreadCheck::Set(), Status, C4ScriptGuiWindowPropertyName::text, and thread_check.
Referenced by C4TableGraph::DumpToFile(), and C4MessageInput::ProcessCommand().
|
protected |
Definition at line 234 of file CStdFile.cpp.
References BufferLoad, BufferPtr, StdThreadCheck::Check(), and thread_check.
Referenced by Append(), Create(), CStdFile(), Open(), and Rewind().
| bool CStdFile::Close | ( | StdBuf ** | ppMemory = nullptr | ) |
Definition at line 151 of file CStdFile.cpp.
References BufferLoad, c4_gzclose(), StdThreadCheck::Check(), hFile, hgzFile, MemoryPtr, ModeWrite, Name, pMemory, SaveBuffer(), Status, and thread_check.
Referenced by C4Playback::Clear(), C4ConfigGeneral::CreateSaveFolder(), C4UpdatePackage::Execute(), C4Group::ExtractEntry(), GetFileCRC(), GetFileSHA1(), main(), C4UpdatePackage::MakeUpdate(), C4Group::Open(), C4MessageInput::ProcessCommand(), C4Group::Save(), C4PXSSystem::Save(), CSurface8::Save(), C4Record::Stop(), and ~CStdFile().
| bool CStdFile::Create | ( | const char * | szFileName, |
| bool | fCompressed = false, |
||
| bool | fExecutable = false, |
||
| bool | fMemory = false |
||
| ) |
Definition at line 49 of file CStdFile.cpp.
References _MAX_PATH, _O_BINARY, c4_gzdopen(), ClearBuffer(), StdStrBuf::Format(), StdStrBuf::getData(), GetWideChar(), hFile, hgzFile, MemoryPtr, ModeWrite, Name, O_CLOEXEC, pMemory, SCopy(), StdThreadCheck::Set(), Status, and thread_check.
Referenced by C4ConfigGeneral::CreateSaveFolder(), C4TableGraph::DumpToFile(), C4UpdatePackage::Execute(), C4Group::ExtractEntry(), main(), C4UpdatePackage::MakeUpdate(), C4Playback::Open(), C4Group::Open(), C4Group::Save(), C4PXSSystem::Save(), CSurface8::Save(), and C4Record::Start().
| bool CStdFile::Default | ( | ) |
Definition at line 174 of file CStdFile.cpp.
References BufferLoad, BufferPtr, hFile, hgzFile, MemoryPtr, Name, pMemory, StdThreadCheck::Set(), Status, and thread_check.
|
inline |
Definition at line 70 of file CStdFile.h.
References BufferLoad, ModeWrite, and SaveBuffer().
Referenced by LogSilent(), C4Record::Rec(), and C4UpdatePackage::WriteLog().
|
inline |
|
protected |
Definition at line 213 of file CStdFile.cpp.
References Buffer, BufferLoad, BufferPtr, c4_gzread(), StdThreadCheck::Check(), CStdFileBufSize, hFile, hgzFile, and thread_check.
Referenced by Advance(), and Read().
| bool CStdFile::Open | ( | const char * | szFileName, |
| bool | fCompressed = false |
||
| ) |
Definition at line 95 of file CStdFile.cpp.
References _MAX_PATH, _O_BINARY, c4_gzclose(), c4_gzdirect(), c4_gzdopen(), ClearBuffer(), GetWideChar(), hFile, hgzFile, ModeWrite, Name, O_CLOEXEC, SCopy(), StdThreadCheck::Set(), Status, and thread_check.
Referenced by GetFileCRC(), GetFileSHA1(), main(), and C4Playback::Open().
|
inlineoverridevirtual |
Implements CStdStream.
Definition at line 60 of file CStdFile.h.
Referenced by C4Playback::Check(), GetFileCRC(), GetFileSHA1(), main(), C4Playback::NextSequentialChunk(), and Read().
| bool CStdFile::Read | ( | void * | pBuffer, |
| size_t | iSize, | ||
| size_t * | ipFSize | ||
| ) |
Definition at line 187 of file CStdFile.cpp.
References Buffer, BufferLoad, BufferPtr, StdThreadCheck::Check(), iSize, LoadBuffer(), ModeWrite, and thread_check.
| bool CStdFile::Rewind | ( | ) |
Definition at line 275 of file CStdFile.cpp.
References c4_gzrewind(), StdThreadCheck::Check(), ClearBuffer(), hFile, hgzFile, ModeWrite, and thread_check.
|
protected |
Definition at line 222 of file CStdFile.cpp.
References StdBuf::Append(), Buffer, BufferLoad, c4_gzwrite(), StdThreadCheck::Check(), hFile, hgzFile, pMemory, and thread_check.
Referenced by Close(), Flush(), and Write().
| int CStdFile::Seek | ( | long int | offset, |
| int | whence | ||
| ) |
| long int CStdFile::Tell | ( | ) |
| bool CStdFile::Write | ( | const void * | pBuffer, |
| int | iSize | ||
| ) |
Definition at line 240 of file CStdFile.cpp.
References Buffer, BufferLoad, StdThreadCheck::Check(), CStdFileBufSize, iSize, ModeWrite, SaveBuffer(), and thread_check.
Referenced by C4Playback::Check(), C4UpdatePackage::Execute(), C4Group::ExtractEntry(), LogSilent(), main(), C4UpdatePackage::MakeUpdate(), C4Record::Rec(), C4Group::Save(), C4PXSSystem::Save(), CSurface8::Save(), C4Record::Stop(), C4UpdatePackage::WriteLog(), and WriteString().
| bool CStdFile::WriteString | ( | const char * | szStr | ) |
Definition at line 264 of file CStdFile.cpp.
References StdThreadCheck::Check(), SLen(), thread_check, and Write().
Referenced by C4ConfigGeneral::CreateSaveFolder(), C4TableGraph::DumpToFile(), and C4MessageInput::ProcessCommand().
|
protected |
Definition at line 50 of file CStdFile.h.
Referenced by LoadBuffer(), Read(), SaveBuffer(), and Write().
|
protected |
Definition at line 51 of file CStdFile.h.
Referenced by Advance(), ClearBuffer(), Close(), Default(), Flush(), LoadBuffer(), Read(), SaveBuffer(), and Write().
|
protected |
Definition at line 51 of file CStdFile.h.
Referenced by Advance(), ClearBuffer(), Default(), LoadBuffer(), and Read().
|
protected |
Definition at line 46 of file CStdFile.h.
Referenced by AccessedEntrySize(), Advance(), Append(), Close(), Create(), CStdFile(), Default(), IsOpen(), LoadBuffer(), Open(), Rewind(), SaveBuffer(), Seek(), and Tell().
|
protected |
Definition at line 47 of file CStdFile.h.
Referenced by AccessedEntrySize(), Close(), Create(), CStdFile(), Default(), IsOpen(), LoadBuffer(), Open(), Rewind(), SaveBuffer(), Seek(), and Tell().
|
protected |
Definition at line 49 of file CStdFile.h.
|
protected |
| char CStdFile::Name[_MAX_PATH_LEN] |
Definition at line 44 of file CStdFile.h.
Referenced by Append(), Close(), Create(), CStdFile(), Default(), and Open().
|
protected |
Definition at line 48 of file CStdFile.h.
Referenced by Close(), Create(), CStdFile(), Default(), and SaveBuffer().
| bool CStdFile::Status |
Definition at line 43 of file CStdFile.h.
Referenced by Append(), Close(), Create(), CStdFile(), Default(), and Open().
|
protected |
Definition at line 53 of file CStdFile.h.
Referenced by Advance(), Append(), ClearBuffer(), Close(), Create(), CStdFile(), Default(), LoadBuffer(), Open(), Read(), Rewind(), SaveBuffer(), Write(), and WriteString().