mmap.h
Go to the documentation of this file.
#ifndef WIBBLE_SYS_MMAP_H
#define WIBBLE_SYS_MMAP_H
/*
* Copyright (C) 2006--2008 Enrico Zini <enrico@enricozini.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <wibble/sys/macros.h>
#include <string>
namespace wibble {
namespace sys {
#if __cplusplus >= 201103L
inline namespace v1 {
#endif
struct MMap
{
public:
MMap();
MMap(const MMap& mmap);
MMap(const std::string& filename);
~MMap();
MMap& operator=(const MMap& mmap);
void map(const std::string& filename);
void unmap();
std::string filename;
size_t size;
int fd;
const char* buf;
};
#if __cplusplus >= 201103L
}
#endif
}
}
// vim:set ts=4 sw=4:
#endif
wibble::sys::MMap::fd
int fd
Definition: mmap.h:59
wibble::sys::MMap::size
size_t size
Definition: mmap.h:58
wibble::sys::MMap::filename
std::string filename
Definition: mmap.h:57
macros.h
wibble::sys::MMap::buf
const char * buf
Definition: mmap.h:60
wibble::sys::MMap
Map a file into memory.
Definition: mmap.h:44
wibble
Definition: amorph.h:17
wibble::list::map
Map< List, F > map(const List &l, const F &f)
Definition: list.h:381