NAH 1.0.6
Native Application Host - Library API Reference
Loading...
Searching...
No Matches
NAH - Native Application Host

NAH standardizes how native applications are installed, inspected, and launched. It provides a deterministic contract between applications and hosts.

Quick Start

#include <nah/nahhost.hpp>
#include <nah/semver.hpp>
// Create a host instance
auto host = nah::NahHost::create("/nah");
// List installed applications
for (const auto& app : host->listApplications()) {
std::cout << app.id << "@" << app.version << "\n";
}
// Get launch contract for an app
auto result = host->getLaunchContract("com.example.myapp");
if (result.isOk()) {
const auto& contract = result.value().contract;
// Use contract.execution.binary, contract.environment, etc.
}
static std::unique_ptr< NahHost > create(const std::string &root_path)
Create a NahHost instance for a NAH root directory.
Main NAH library interface for contract composition.
Semantic Versioning 2.0.0 support.

Key Headers

Header Description
<nah/nahhost.hpp> Main API - NahHost class for contract composition
<nah/semver.hpp> Semantic versioning - parse and compare versions
<nah/manifest.hpp> Manifest parsing and building
<nah/types.hpp> Core types - Manifest, Contract, etc.

Integration

CMake FetchContent

include(FetchContent)
FetchContent_Declare(nah
GIT_REPOSITORY https://github.com/rtorr/nah.git
GIT_TAG v1.0.0)
FetchContent_MakeAvailable(nah)
target_link_libraries(your_target PRIVATE nahhost)

Conan 2

def requirements(self):
self.requires("nah/1.0.0")

Links