Public Member Functions

base::MemoryMappedFile Class Reference

Memory-mapping files. More...

#include <libppbase/base/MemoryMappedFile.h>

List of all members.

Public Member Functions

 MemoryMappedFile ()
 Constructor.
 MemoryMappedFile (const File &file, bool writeable=false, bool privt=false)
 Constructor that takes an open file to map.
 ~MemoryMappedFile ()
 Destructor.
unsigned getLength () const
 Gets the length of the mapped area.
char * getStart () const
 Gets the start address of the mapped area.
char * map (const File &file, bool writeable=false, bool privt=false)
 Maps a file.
char * map (const File &file, u_longlong_t offset, unsigned length, bool writeable=false, bool privt=false)
 Maps a part of a file.
void unmap ()
 Unmaps the file.

Detailed Description

Memory-mapping files.

Author:
Christoph Schwarz
Version:
$Id: MemoryMappedFile.h 21 2010-09-05 04:18:17Z cschwarz1 $

Constructor & Destructor Documentation

base::MemoryMappedFile::MemoryMappedFile ( const File file,
bool  writeable = false,
bool  privt = false 
)

Constructor that takes an open file to map.

Parameters:
file the file to map
writeable flag: map writeable
privt,: flag: map private

Member Function Documentation

unsigned base::MemoryMappedFile::getLength (  )  const

Gets the length of the mapped area.

Returns:
the length (file size)
char* base::MemoryMappedFile::getStart (  )  const

Gets the start address of the mapped area.

Returns:
NULL if there is no mapped file
char* base::MemoryMappedFile::map ( const File file,
u_longlong_t  offset,
unsigned  length,
bool  writeable = false,
bool  privt = false 
)

Maps a part of a file.

Parameters:
file the file to map
offset the start of the mapping (file offset)
length the number of bytes to map
writeable flag: map writeable
privt flag: map private
Returns:
the start address of the mapped area
char* base::MemoryMappedFile::map ( const File file,
bool  writeable = false,
bool  privt = false 
)

Maps a file.

Parameters:
file the file to map
writeable flag: map writeable
privt flag: map private
Returns:
the start address of the mapped area

The documentation for this class was generated from the following file: