2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
7 #ifndef _MMAP_INCLUDED_
8 #define _MMAP_INCLUDED_
11 // Encapsulate memory mapped files
16 TMMap(const char* fileName) :
17 fSize(-1), // -1 is the error value returned by GetFileSize()
19 fBuff(0) // 0 is the error value returned by MapViewOfFile()
21 if ((fp = fopen(fileName, "r")) == NULL)
32 fBuff = (char*)malloc(sizeof(char) * fSize);
42 char* getData() { return fBuff; }
43 int getSize() { return fSize; }
51 int fSize; // size of file to map in
53 char* fBuff; // the actual data;
56 #endif // _MMAP_INCLUDED_