mirror of
https://github.com/allankoechke/mantisbase-admin.git
synced 2026-12-02 09:26:48 +00:00
mb-admin
Mantis Admin Dashboard
Release brach for the master branch targetted at C++ integration. This branch should be updated automatically with every release of the master branch.
What's the plan here?
- When master is tagged for release, build
masterartefacts - Add the artefacts to this branch
- C++ project pulls this branch for integration directly.
Library Usage
The mantisbase_admin library provides embedded web assets (HTML, CSS, JS, images) compiled into your C++ application using CMakeRC.
Linking
In your CMakeLists.txt:
target_link_libraries(your_app PRIVATE mantisbase_admin)
Accessing Resources
In your C++ code:
#include <cmrc/cmrc.hpp>
// Declare the resource namespace
CMRC_DECLARE(mantis);
int main() {
// Get filesystem handle
auto fs = cmrc::mantis::get_filesystem();
// Open a resource file
auto resource = fs.open("index.html");
std::string content(resource.begin(), resource.end());
// Check if file exists
if (fs.is_file("assets/style.css")) {
auto file = fs.open("assets/style.css");
}
// Iterate directory
for (auto& entry : fs.iterate_directory("public")) {
if (entry.is_file()) {
std::cout << entry.filename() << std::endl;
}
}
}
CMRC API Reference
cmrc::<namespace>::get_filesystem()- Get handle to embedded filesystemopen(path)- Open a file, returnscmrc::fileis_file(path)- Check if path is a fileis_directory(path)- Check if path is a directoryexists(path)- Check if path existsiterate_directory(path)- Iterate directory contents
See CMRC Documentation for more details.
Description
v0.4.3
Latest
Languages
TypeScript
99.2%
CSS
0.6%
JavaScript
0.2%