Fast, clean, and efficient solution for archiving and retrieving web content.
- CMake
- C++17
- NodeJS (only used for example app)
This project provides two components:
- hyperpage: A library with an API for reading and writing archives
- hyperpack: A command line tool for archiving web content
Hyperpage is the C++ API provided by this project. It provides all of the interfaces required to utilize the hyperpage database:
- 
hyperpage::page: An abstract class representing a single entry in the database. It provides the path, mime type, and content.
- 
hyperpage::reader: Loads pages from the database. Given a path, the reader will provide a pointer to a page if it exists.
- 
hyperpage::writer: Stores pages in the database. Given a page, the writer will create a database entry that can later be loaded by path.
Hyperpack is a command line utility used to create a hyperpage database file:
Usage: hyperpack [--help] [--version] [--output VAR] [--verbose] directories...
Positional arguments:
  directories    Directories to scan for files to pack into the hyperpage database [nargs: 1 or more] [required]
Optional arguments:
  -h, --help     shows help message and exits
  -v, --version  prints version information and exits
  -o, --output   Output file for the hyperpage database [nargs=0..1] [default: "hyperpage.db"]
  -v, --verbose  Show detailed output information
If two or more files share the same relative subpath (i.e., the same path within their respective parent directories), the file from the rightmost directory specified on the command line will overwrite the others in the final archive.
Only exact path matches are considered conflicts — differing subdirectories or filenames will coexist as separate entries.
Suppose you run:
hyperpack -o output.hp dir1 dir2 dir3And the directories contain:
dir1/Subdir1/index.html
dir2/Subdir2/index.html
dir3/Index.htmlThese will result in three distinct files inside the archive:
Subdir1/index.html
/Subdir2/index.html
/Index.htmlHowever, if two or more directories contain the same relative path, for example:
dir1/public/index.html
dir2/public/index.htmlthen the file from dir2 (the rightmost one) will overwrite the file from dir1 in the resulting archive entry:
/public/index.htmlThis is only intended to cover basic usage. For more info about the API, see the docs. To see how hyperpage is used in a basic use case, the example should be helpful.