https://github.com/nir3x/filemapping.cpp
FileMapping.cpp - C++ Library for Managing File Mappings in Windows
https://github.com/nir3x/filemapping.cpp
c-plus-plus cpp file-mapping memory-management winapi windows-api
Last synced: 3 months ago
JSON representation
FileMapping.cpp - C++ Library for Managing File Mappings in Windows
- Host: GitHub
- URL: https://github.com/nir3x/filemapping.cpp
- Owner: NIR3X
- License: agpl-3.0
- Created: 2024-02-12T12:33:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-16T04:02:48.000Z (over 1 year ago)
- Last Synced: 2024-02-16T05:22:44.425Z (over 1 year ago)
- Topics: c-plus-plus, cpp, file-mapping, memory-management, winapi, windows-api
- Language: C++
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FileMapping.cpp - C++ Library for Managing File Mappings in Windows
This is a C++ library for managing file mappings in Windows using the WinAPI.
## Overview
The `FileMapping` class provided in this library allows you to create, open, and manage file mappings in Windows. File mapping is a mechanism for mapping a file into memory, allowing for efficient file access and sharing between processes.
## Features
- Create file mappings
- Open existing file mappings
- Map files into memory
- Retrieve file size
- Access memory-mapped file data## Installation
To use this package, you can clone the repository and compile it using a C++ compiler:
```bash
git clone https://github.com/NIR3X/FileMapping.cpp
cd FileMapping.cpp
make
```## Usage
To use the `FileMapping` class in your project, include the `FileMapping.h` header file and link against `FileMapping.a`.
```cpp
#include "FileMapping.h"
#includeint main() {
// Example usage
CFileMapping fileMapping(L"path_to_file");
LPVOID mapView = fileMapping.getMapView();
// Use the memory-mapped file...
return 0;
}
```## License
[](https://www.gnu.org/licenses/agpl-3.0.html)
This program is Free Software: You can use, study share and improve it at your
will. Specifically you can redistribute and/or modify it under the terms of the
[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html) as
published by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.