![]() |
Polygon Crucher SDK - Documentation
Documentation
|
CXFile is the base class for CXStdioFile, CXStdioFileEx, CXMemFile. More...
CXFile is the base class for CXStdioFile, CXStdioFileEx, CXMemFile.
#include <XFile.h>
Public Types | |
enum | OpenFlags { modeRead = 0x00000 , modeWrite = 0x00001 , modeReadWrite = 0x00002 , readFlags = modeRead|modeWrite|modeReadWrite , shareExclusive = 0x00010 , shareDenyWrite = 0x00020 , shareDenyRead = 0x00030 , shareDenyNone = 0x00040 , shareFlags = shareExclusive| shareDenyWrite|shareDenyRead|shareDenyNone , typeUnicode = 0x00400 , typeUtf8 = 0x00800 , modeCreate = 0x01000 , modeNoTruncate = 0x02000 , typeText = 0x04000 , typeBinary = 0x08000 , noException = 0x100000 , specificFlags = 0x10000000 } |
Specify the open mode for file. More... | |
enum | SeekPosition { begin = 0x00 , current = 0x01 , end = 0x02 } |
typedef enum CXFile::SeekPosition | SeekPosition |
Public Member Functions | |
CXFile (bool allowException=true) | |
CXFile (xFileHandle hFile, bool allowException=true) | |
CXFile (LPCTSTR lpszFileName, unsigned int openFlags) | |
CXFile (CFile *pfile, bool allowException=true) | |
allowException = false then no exception is send by the class which return false instead | |
virtual fileuint | GetPosition () const |
virtual CXString | GetFileName () const |
virtual CXString | GetFilePath () const |
virtual void | SetFilePath (LPCTSTR lpszNewName) |
virtual bool | Open (LPCTSTR lpszFileName, unsigned int openMode, CXFileException *pError=NULL) |
Open does not send any exception but can fill CXFileException with the appropriate cause of the failing. | |
fileuint | SeekToEnd () |
void | SeekToBegin () |
virtual fileuint | Seek (longint lOff, CXFile::SeekPosition nFrom) |
virtual bool | SetLength (fileuint newlength) |
virtual fileuint | GetLength () const |
virtual unsigned int | Read (void *buffer, unsigned int maxByteToRead) |
virtual void | Write (const void *buffer, unsigned int byteToWrite) |
virtual void | Abort () |
virtual void | Flush () |
virtual void | Close () |
Specify the open mode for file.
By default an open file is no inherited by child processes
Enumerator | |
---|---|
shareExclusive | Default mode, if nothing specified. Deny file being opened for reading/writing to other process. |
shareDenyWrite | Deny file being opened for writing to other process. |
shareDenyRead | Deny file being opened for reading to other process. |
shareDenyNone | file could be opened by other process |
typeUnicode | used in derived classes (e.g. CXStdioFile) only |
typeUtf8 | Windows only, as it is always the case under MacOS / Linux. used in derived classes (e.g. CXStdioFile) only. |
modeCreate | Existing file is replaced, unless modeNoTruncate is used. |
typeText | CXFile are always binary, intended to be used in derived classes (e.g. CXStdioFile) only. |
typeBinary | CXFile are always binary, intended to be used in derived classes (e.g. CXStdioFile) only. |
noException | By default CXFile send exception. This flag turn off exception. |
specificFlags | Override class mode base flags. |
|
virtual |
Open does not send any exception but can fill CXFileException with the appropriate cause of the failing.
Reimplemented in CStdioFileEx, and CXStdioFile.