![]() |
Polygon Crucher SDK - Documentation
Documentation
|
CStdioFileEx reads or write unicode or ansi / utf8 string and convert them to CXString using string conversion if needed. More...
CStdioFileEx reads or write unicode or ansi / utf8 string and convert them to CXString using string conversion if needed.
#include <StdioFileEx.h>
Public Types | |
enum | OpenFlags { modeWriteUnicode = specificFlags } |
Additional flags to CXFile::OpenFlags. More... | |
![]() | |
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 | |
CStdioFileEx (bool allowException=true) | |
CStdioFileEx (LPCTSTR lpszFileName, unsigned int nOpenFlags) | |
virtual int | FScanfS (const LPCTSTR format,...) |
virtual bool | Open (LPCTSTR lpszFileName, unsigned int nOpenFlags, CXFileException *pError=NULL) |
nOpenFlags is a combination of CXFile::OpenFlags | |
virtual bool | ReadString (CXString &rString) |
Read a CXString whatever if the file is encoded in unicode or utf8. | |
virtual fileuint | Seek (longint lOff, CXFile::SeekPosition nFrom) |
virtual void | WriteString (LPCTSTR lpsz) |
Write a CXString. The string is converted accordingly is the file is opened using modeWriteUnicode. | |
bool | IsFileUnicodeText () const |
bool | IsFileUTF8 () const |
fileuint | GetCharCount () |
void | SkipLines (unsigned int lines, unsigned int nFrom) |
void | SetCodePage (xStringEncoding codPage) |
A code page could be provided on Windows. | |
![]() | |
CXStdioFile (bool allowException=true) | |
CXStdioFile (FILE *pOpenStream, bool allowException=true) | |
CXStdioFile (LPCTSTR lpszFileName, unsigned int nOpenFlags) | |
nOpenFlags is a combination of CXFile::OpenFlags | |
virtual LPTSTR | ReadString (LPTSTR lpsz, unsigned int nMax) |
virtual fileuint | GetPosition () const |
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 () |
FILE * | GetStream () |
![]() | |
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 CXString | GetFileName () const |
virtual CXString | GetFilePath () const |
virtual void | SetFilePath (LPCTSTR lpszNewName) |
fileuint | SeekToEnd () |
void | SeekToBegin () |
virtual bool | SetLength (fileuint newlength) |
Static Public Member Functions | |
static xStringEncoding | GetFileEncoding (const CXString &sFilePath, bool &asBoom) |
Returns the file encoding and check if there is a boom marker. | |
Additional flags to CXFile::OpenFlags.
Enumerator | |
---|---|
modeWriteUnicode | equivalent to CXFile::typeUnicode |
It implements a secured version of fscanf on OS that support it: FcanS(_T("%s", SCANS_TEXT_PARAM(buf, _countof(buf)), SCANS_LAST_PARAM);
|
virtual |
nOpenFlags is a combination of CXFile::OpenFlags
Reimplemented from CXStdioFile.
Read a CXString whatever if the file is encoded in unicode or utf8.
Reimplemented from CXStdioFile.
Reimplemented from CXStdioFile.
Write a CXString. The string is converted accordingly is the file is opened using modeWriteUnicode.
Reimplemented from CXStdioFile.