================================================================= CUT_MapFileDataSource Data source class for CUT_Msg class based on the mapped file =================================================================
| 177 | // Data source class for CUT_Msg class based on the mapped file |
| 178 | // ================================================================= |
| 179 | class CUT_MapFileDataSource : public CUT_DataSource { |
| 180 | protected: |
| 181 | _TCHAR m_szFileName[MAX_PATH + 1]; // File name |
| 182 | std::string m_szName; // Datasource name |
| 183 | |
| 184 | HANDLE m_hFile; // File handle |
| 185 | HANDLE m_hMapFile; // File map handle |
| 186 | LPSTR m_lpMapAddress; // Pointer to the data |
| 187 | |
| 188 | LARGE_INTEGER m_lnSize; // Allocated data size |
| 189 | LARGE_INTEGER m_lnPosition; // Current position |
| 190 | LARGE_INTEGER m_lnActualSize; // Actual size of data |
| 191 | LARGE_INTEGER m_lnIncrement; // Increment size |
| 192 | |
| 193 | OpenMsgType m_OpenType; // Last open type |
| 194 | |
| 195 | BOOL m_bTempFileName; // If TRUE delete file while closing |
| 196 | |
| 197 | public: |
| 198 | CUT_MapFileDataSource(DWORD SizeHigh, DWORD SizeLow, LPCSTR name = NULL, LPCTSTR filename = NULL); |
| 199 | virtual ~CUT_MapFileDataSource(); |
| 200 | |
| 201 | // Virtual clone constructor |
| 202 | virtual CUT_DataSource * clone(); |
| 203 | |
| 204 | // Opens data file type == UTM_OM_READING, UTM_OM_WRITING, UTM_OM_APPEND |
| 205 | virtual int Open(OpenMsgType type); |
| 206 | |
| 207 | // Close data file |
| 208 | virtual int Close(); |
| 209 | |
| 210 | // Read one line from the data file |
| 211 | virtual int ReadLine(LPSTR buffer, size_t maxsize); |
| 212 | |
| 213 | // Write one line to the data file |
| 214 | virtual int WriteLine(LPCSTR buffer); |
| 215 | |
| 216 | // Read data |
| 217 | virtual int Read(LPSTR buffer, size_t count); |
| 218 | |
| 219 | // Write data |
| 220 | virtual int Write(LPCSTR buffer, size_t count); |
| 221 | |
| 222 | // Move a current pointer to the specified location. |
| 223 | virtual long Seek(long offset, int origin); |
| 224 | |
| 225 | }; |
| 226 | |
| 227 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected