File: GenericFile_map.h

package info (click to toggle)
snap-aligner 2.0.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 6,652 kB
  • sloc: cpp: 41,051; ansic: 5,239; python: 227; makefile: 85; sh: 28
file content (43 lines) | stat: -rw-r--r-- 736 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*++

Module Name:

    GenericFile_map.h

Abstract:

    Generic IO class for SNAP that can map an input file.

Authors:

    Bill Bolosky, September, 2014

Environment:

User mode service.

Revision History:


--*/

#pragma once

#include "GenericFile_Blob.h"
#include "Compat.h"

class GenericFile_map : public GenericFile_Blob
{
public:
	static GenericFile_map *open(const char *filename);
	virtual ~GenericFile_map();
	virtual _int64 prefetch();	// Ignore the return value, it's just to trick the compiler into not optimizing it away.
	virtual void close();

private:
	GenericFile_map(MemoryMappedFile *i_mappedFile, void *i_contents, size_t i_fileSize);

	MemoryMappedFile *mappedFile;
	const char *contents;
	size_t fileSize;
};