NAH 1.0.6
Native Application Host - Library API Reference
Loading...
Searching...
No Matches
nah::NahHost Class Reference

#include <nahhost.hpp>

Public Member Functions

Result< ContractEnvelopecomposeContract (const CompositionInputs &inputs) const
 Low-level contract composition from explicit inputs.
 
Result< AppInfofindApplication (const std::string &id, const std::string &version="") const
 Find an installed application by ID.
 
Result< HostProfilegetActiveHostProfile () const
 Get the currently active host profile.
 
Result< ContractEnvelopegetLaunchContract (const std::string &app_id, const std::string &version="", const std::string &profile="", bool enable_trace=false) const
 Generate a launch contract for an application.
 
std::vector< AppInfolistApplications () const
 List all installed applications.
 
std::vector< std::string > listProfiles () const
 List all available profile names.
 
Result< HostProfileloadProfile (const std::string &name) const
 Load a specific profile by name.
 
const std::string & root () const
 Get the NAH root path.
 
Result< voidsetActiveHostProfile (const std::string &name)
 Set the active host profile by name.
 
Result< voidvalidateProfile (const HostProfile &profile) const
 Validate a host profile.
 

Static Public Member Functions

static std::unique_ptr< NahHostcreate (const std::string &root_path)
 Create a NahHost instance for a NAH root directory.
 

Detailed Description

Definition at line 200 of file nahhost.hpp.

Member Function Documentation

◆ composeContract()

Result< ContractEnvelope > nah::NahHost::composeContract ( const CompositionInputs inputs) const

Low-level contract composition from explicit inputs.

Parameters
inputsComposition inputs (manifest, profile, paths, etc.)
Returns
ContractEnvelope containing the composed contract
Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

◆ create()

static std::unique_ptr< NahHost > nah::NahHost::create ( const std::string &  root_path)
static

Create a NahHost instance for a NAH root directory.

Parameters
root_pathPath to the NAH root (e.g., "/nah")
Returns
Unique pointer to NahHost instance
Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

◆ findApplication()

Result< AppInfo > nah::NahHost::findApplication ( const std::string &  id,
const std::string &  version = "" 
) const

Find an installed application by ID.

Parameters
idApplication identifier (e.g., "com.example.myapp")
versionOptional specific version (default: latest)
Returns
AppInfo or error if not found
Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

◆ getActiveHostProfile()

Result< HostProfile > nah::NahHost::getActiveHostProfile ( ) const

Get the currently active host profile.

Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

◆ getLaunchContract()

Result< ContractEnvelope > nah::NahHost::getLaunchContract ( const std::string &  app_id,
const std::string &  version = "",
const std::string &  profile = "",
bool  enable_trace = false 
) const

Generate a launch contract for an application.

Parameters
app_idApplication identifier
versionOptional specific version (default: latest installed)
profileOptional profile name (default: active profile)
enable_traceInclude composition trace in result
Returns
ContractEnvelope containing the launch contract
Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

◆ listApplications()

std::vector< AppInfo > nah::NahHost::listApplications ( ) const

List all installed applications.

Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

◆ listProfiles()

std::vector< std::string > nah::NahHost::listProfiles ( ) const

List all available profile names.

Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

◆ loadProfile()

Result< HostProfile > nah::NahHost::loadProfile ( const std::string &  name) const

Load a specific profile by name.

Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

◆ root()

const std::string & nah::NahHost::root ( ) const
inline

Get the NAH root path.

Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

Definition at line 210 of file nahhost.hpp.

◆ setActiveHostProfile()

Result< void > nah::NahHost::setActiveHostProfile ( const std::string &  name)

Set the active host profile by name.

Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

◆ validateProfile()

Result< void > nah::NahHost::validateProfile ( const HostProfile profile) const

Validate a host profile.

Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

The documentation for this class was generated from the following file: