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

Namespaces

namespace  warnings
 

Classes

struct  AppInfo
 Metadata about an installed application. More...
 
struct  AppInstallOptions
 
struct  AppInstallRecord
 
struct  AppInstallRecordParseResult
 
struct  AppInstallResult
 
struct  AssetExport
 
struct  AssetExportParts
 
struct  AtomicWriteResult
 
struct  Capability
 
struct  CapabilityUsage
 
struct  CollectResult
 
struct  CompositionInputs
 
struct  CompositionResult
 
struct  Constraint
 A single comparator constraint (e.g., ">=1.0.0" or "<2.0.0") More...
 
struct  ContractEnvelope
 
struct  EnforcementResult
 
class  Error
 Error type with code and message. More...
 
struct  ExpansionResult
 
struct  ExpansionWithLimitsResult
 
struct  FetchResult
 
struct  HashResult
 
struct  HostProfile
 
struct  HostProfileParseResult
 
struct  HostProfileRecord
 
struct  HostProfileValidation
 
struct  InstallRecordValidation
 
struct  LaunchContract
 
struct  Manifest
 
class  ManifestBuilder
 
struct  ManifestDecodeResult
 
struct  ManifestFieldsResult
 
struct  ManifestParseResult
 
class  NahHost
 
struct  NakInstallOptions
 
struct  NakInstallRecord
 
struct  NakInstallRecordParseResult
 
struct  NakInstallResult
 
struct  NakInstallValidation
 
struct  NakPackInfo
 
struct  NakPackManifest
 
struct  NakPackManifestParseResult
 
struct  NakPin
 
struct  NakRegistryEntry
 
struct  NakSelectionResult
 
struct  NapPackageInfo
 
struct  OverridesFile
 
struct  OverridesParseResult
 
struct  PackResult
 
struct  ParsedPermission
 
struct  ParsedReference
 
struct  PathResult
 
struct  PathValidation
 
struct  PinnedNakLoadResult
 
class  Result
 Result type for fallible operations. More...
 
class  Result< void, E >
 
struct  SectionReadResult
 
struct  Sha256VerifyResult
 
struct  TarEntry
 
struct  TLVEntry
 
struct  TraceEntry
 
struct  TrustInfo
 
struct  UninstallResult
 
struct  UnpackResult
 
struct  VerifyResult
 
struct  VersionRange
 A version range is a union of comparator sets (OR) More...
 
class  WarningCollector
 
struct  WarningObject
 

Typedefs

using ComparatorSet = std::vector< Constraint >
 
using Version = semver::version
 Semantic version type (MAJOR.MINOR.PATCH[-prerelease][+build])
 

Enumerations

enum class  BindingMode { Canonical , Mapped }
 
enum class  Comparator {
  Eq , Lt , Le , Gt ,
  Ge
}
 Comparator operators for range expressions. More...
 
enum class  CriticalError { MANIFEST_MISSING , ENTRYPOINT_NOT_FOUND , PATH_TRAVERSAL , INSTALL_RECORD_INVALID }
 
enum class  ErrorCode {
  FILE_NOT_FOUND , PERMISSION_DENIED , IO_ERROR , MANIFEST_MISSING ,
  INSTALL_RECORD_INVALID , PATH_TRAVERSAL , ENTRYPOINT_NOT_FOUND , PROFILE_MISSING ,
  PROFILE_PARSE_ERROR
}
 Error codes for NAH operations. More...
 
enum class  OverrideMode { Allow , Deny , Allowlist }
 
enum class  PathError { None , ContainsNul , AbsoluteNotAllowed , EscapesRoot }
 
enum class  Platform { Linux , macOS , Windows , Unknown }
 
enum class  ReferenceType { File , Https , Invalid }
 
enum class  TarEntryType {
  RegularFile , Directory , Symlink , Hardlink ,
  Other
}
 
enum class  TrustState { Verified , Unverified , Failed , Unknown }
 
enum class  Warning {
  invalid_manifest , invalid_configuration , profile_invalid , profile_missing ,
  profile_parse_error , nak_pin_invalid , nak_not_found , nak_version_unsupported ,
  binary_not_found , capability_missing , capability_malformed , capability_unknown ,
  missing_env_var , invalid_trust_state , override_denied , override_invalid ,
  invalid_library_path , trust_state_unknown , trust_state_unverified , trust_state_failed ,
  trust_state_stale
}
 
enum class  WarningAction { Warn , Ignore , Error }
 

Functions

const charaction_to_string (WarningAction a)
 
AtomicWriteResult atomic_create_directory (const std::string &path)
 
AtomicWriteResult atomic_update_symlink (const std::string &link_path, const std::string &target)
 
AtomicWriteResult atomic_write_file (const std::string &path, const std::string &content)
 
AtomicWriteResult atomic_write_file (const std::string &path, const std::vector< uint8_t > &content)
 
const charbinding_mode_to_string (BindingMode m)
 
CollectResult collect_directory_entries (const std::string &dir_path)
 
CompositionResult compose_contract (const CompositionInputs &inputs)
 
HashResult compute_sha256 (const std::string &file_path)
 
HashResult compute_sha256 (const std::vector< uint8_t > &data)
 
bool copy_file (const std::string &src, const std::string &dst)
 
PackResult create_deterministic_archive (const std::vector< TarEntry > &entries)
 
bool create_directories (const std::string &path)
 
std::unordered_map< std::string, std::string > create_warning_fields (const std::vector< WarningObject > &warnings)
 
const charcritical_error_to_string (CriticalError e)
 
ManifestDecodeResult decode_manifest_tlv (const std::vector< uint8_t > &data, std::optional< size_t > expected_total_size=std::nullopt)
 
std::vector< Capabilityderive_capabilities_from_permissions (const std::vector< std::string > &permissions)
 
std::optional< Capabilityderive_capability (const std::string &operation, const std::string &resource)
 
Capability derive_capability (const std::string &permission, WarningCollector &warnings)
 
std::optional< std::string > derive_enforcement (const std::string &capability_key, const HostProfile &profile)
 
EnforcementResult derive_enforcement (const std::vector< std::string > &filesystem_permissions, const std::vector< std::string > &network_permissions, const HostProfile &profile, WarningCollector &warnings)
 
void expand_environment_map (std::unordered_map< std::string, std::string > &environment, WarningCollector &warnings)
 
ExpansionResult expand_placeholders (const std::string &input, const std::unordered_map< std::string, std::string > &environment, const std::string &source_path, WarningCollector &warnings)
 
std::string expand_placeholders (const std::string &input, const std::unordered_map< std::string, std::string > &environment, std::vector< std::string > &missing_vars)
 
ExpansionWithLimitsResult expand_placeholders_with_limits (const std::string &input, const std::unordered_map< std::string, std::string > &environment, std::vector< std::string > &missing_vars, size_t max_size, size_t max_placeholders)
 
std::vector< std::string > expand_string_vector (const std::vector< std::string > &input, const std::unordered_map< std::string, std::string > &environment, const std::string &source_path_prefix, WarningCollector &warnings)
 
std::vector< std::string > expand_vector (const std::vector< std::string > &input, const std::unordered_map< std::string, std::string > &environment, std::vector< std::string > &missing_vars)
 
UnpackResult extract_archive_safe (const std::string &archive_path, const std::string &staging_dir)
 
UnpackResult extract_archive_safe (const std::vector< uint8_t > &archive_data, const std::string &staging_dir)
 
FetchResult fetch_https (const std::string &url)
 
std::string generate_uuid ()
 
std::unordered_map< std::string, std::string > get_all_env ()
 
HostProfile get_builtin_empty_profile ()
 
Platform get_current_platform ()
 
std::string get_current_timestamp ()
 
std::optional< std::string > get_env (const std::string &name)
 
std::string get_filename (const std::string &path)
 
std::string get_library_path_env_key ()
 
std::string get_parent_directory (const std::string &path)
 
char get_path_separator ()
 
WarningAction get_warning_action (const HostProfile &profile, const std::string &warning_key)
 
WarningAction get_warning_action (const HostProfile &profile, Warning warning)
 
NakPackInfo inspect_nak_pack (const std::string &pack_path)
 
NakPackInfo inspect_nak_pack (const std::vector< uint8_t > &archive_data)
 
NapPackageInfo inspect_nap_package (const std::string &package_path)
 
NapPackageInfo inspect_nap_package (const std::vector< uint8_t > &archive_data)
 
AppInstallResult install_app (const std::string &source, const AppInstallOptions &options)
 
NakInstallResult install_nak (const std::string &source, const NakInstallOptions &options)
 
NakInstallResult install_nak_pack (const std::string &pack_path, const NakInstallOptions &options)
 
AppInstallResult install_nap_package (const std::string &package_path, const AppInstallOptions &options)
 
bool is_directory (const std::string &path)
 
bool is_override_permitted (const std::string &target, const HostProfile &profile)
 
bool is_regular_file (const std::string &path)
 
bool is_symlink (const std::string &path)
 
std::string join_path (const std::string &base, const std::string &rel)
 
std::vector< std::string > list_directory (const std::string &path)
 
PinnedNakLoadResult load_pinned_nak (const NakPin &pin, const Manifest &manifest, const HostProfile &profile, const std::string &nah_root, WarningCollector &warnings)
 
ManifestBuilder manifest ()
 
PathResult normalize_under_root (const std::string &root, const std::string &relative_path, bool allow_absolute=false)
 
const charoverride_mode_to_string (OverrideMode m)
 
PackResult pack_directory (const std::string &dir_path)
 
PackResult pack_nak (const std::string &dir_path)
 
PackResult pack_nap (const std::string &dir_path)
 
InstallRecordValidation parse_app_install_record (const std::string &toml, AppInstallRecord &out)
 
AppInstallRecordParseResult parse_app_install_record_full (const std::string &toml_str, const std::string &source_path="")
 
ParsedReference parse_artifact_reference (const std::string &reference)
 
std::optional< AssetExportPartsparse_asset_export (const std::string &value)
 
std::optional< BindingModeparse_binding_mode (const std::string &s)
 
HostProfileValidation parse_host_profile (const std::string &toml, HostProfileRecord &out)
 
HostProfileParseResult parse_host_profile_full (const std::string &toml_str, const std::string &source_path="")
 
ManifestFieldsResult parse_manifest (const std::vector< uint8_t > &blob)
 
ManifestParseResult parse_manifest_blob (const std::vector< uint8_t > &blob)
 
NakInstallValidation parse_nak_install_record (const std::string &toml, NakInstallRecord &out)
 
NakInstallRecordParseResult parse_nak_install_record_full (const std::string &toml_str, const std::string &source_path="")
 
NakPackManifestParseResult parse_nak_pack_manifest (const std::string &toml_str)
 
std::optional< OverrideModeparse_override_mode (const std::string &s)
 
OverridesParseResult parse_overrides_file (const std::string &content, const std::string &path)
 
std::optional< ParsedPermissionparse_permission_string (const std::string &permission)
 
std::optional< VersionRangeparse_range (const std::string &str)
 Parse a version range string.
 
std::optional< TrustStateparse_trust_state (const std::string &s)
 
std::optional< Versionparse_version (const std::string &str)
 Parse a SemVer 2.0.0 version string.
 
std::optional< WarningActionparse_warning_action (const std::string &s)
 
std::optional< Warningparse_warning_key (const std::string &key)
 
bool path_exists (const std::string &path)
 
SectionReadResult read_manifest_section (const std::string &binary_path)
 
SectionReadResult read_manifest_section (const std::vector< uint8_t > &binary_data)
 
std::optional< std::string > read_symlink (const std::string &path)
 
bool remove_directory (const std::string &path)
 
bool remove_file (const std::string &path)
 
bool satisfies (const Version &version, const ComparatorSet &set)
 Check if a version satisfies a comparator set (all constraints)
 
bool satisfies (const Version &version, const Constraint &constraint)
 Check if a version satisfies a single constraint.
 
bool satisfies (const Version &version, const VersionRange &range)
 Check if a version satisfies a version range (any set)
 
std::vector< NakRegistryEntryscan_nak_registry (const std::string &nah_root)
 
NakSelectionResult select_nak_for_install (const Manifest &manifest, const HostProfile &profile, const std::vector< NakRegistryEntry > &registry, WarningCollector &warnings)
 
std::string serialize_contract_json (const ContractEnvelope &envelope, bool include_trace=false, std::optional< CriticalError > critical_error=std::nullopt)
 
std::string to_portable_path (const std::string &path)
 
const chartrust_state_to_string (TrustState s)
 
UninstallResult uninstall_app (const std::string &nah_root, const std::string &app_id, const std::string &version="")
 
UninstallResult uninstall_nak (const std::string &nah_root, const std::string &nak_id, const std::string &version)
 
bool validate_app_install_record (const AppInstallRecord &record, std::string &error)
 
PathValidation validate_extraction_path (const std::string &entry_path, const std::string &extraction_root)
 
bool validate_nak_install_record (const NakInstallRecord &record, std::string &error)
 
VerifyResult verify_app (const std::string &nah_root, const std::string &app_id, const std::string &version="")
 
Sha256VerifyResult verify_sha256 (const std::vector< uint8_t > &data, const std::string &expected_hex)
 
bool version_allowed_by_profile (const std::string &version, const HostProfile &profile)
 
bool version_matches_pattern (const std::string &version, const std::string &pattern)
 
const charwarning_to_string (Warning w)
 

Variables

constexpr size_t MAX_EXPANDED_SIZE = 64 * 1024
 
constexpr size_t MAX_PLACEHOLDERS = 128
 

Typedef Documentation

◆ ComparatorSet

A comparator set is constraints that must ALL be satisfied (AND) e.g., ">=1.0.0 <2.0.0" is two constraints ANDed together

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

Definition at line 55 of file semver.hpp.

◆ Version

using nah::Version = typedef semver::version

Semantic version type (MAJOR.MINOR.PATCH[-prerelease][+build])

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

Definition at line 36 of file semver.hpp.

Enumeration Type Documentation

◆ BindingMode

Enumerator
Canonical 
Mapped 

Definition at line 266 of file types.hpp.

◆ Comparator

Comparator operators for range expressions.

Enumerator
Eq 

=X.Y.Z or X.Y.Z (exact match)

Lt 

<X.Y.Z

Le 

<=X.Y.Z

Gt 

>X.Y.Z

Ge 

>=X.Y.Z

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

Definition at line 39 of file semver.hpp.

◆ CriticalError

Enumerator
MANIFEST_MISSING 
ENTRYPOINT_NOT_FOUND 
PATH_TRAVERSAL 
INSTALL_RECORD_INVALID 

Definition at line 94 of file types.hpp.

◆ ErrorCode

Error codes for NAH operations.

Enumerator
FILE_NOT_FOUND 
PERMISSION_DENIED 
IO_ERROR 
MANIFEST_MISSING 
INSTALL_RECORD_INVALID 
PATH_TRAVERSAL 
ENTRYPOINT_NOT_FOUND 
PROFILE_MISSING 
PROFILE_PARSE_ERROR 
Examples
/home/runner/work/nah/nah/include/nah/nahhost.hpp.

Definition at line 57 of file nahhost.hpp.

◆ OverrideMode

Enumerator
Allow 
Deny 
Allowlist 

Definition at line 245 of file types.hpp.

◆ PathError

Enumerator
None 
ContainsNul 
AbsoluteNotAllowed 
EscapesRoot 

Definition at line 7 of file path_utils.hpp.

◆ Platform

Enumerator
Linux 
macOS 
Windows 
Unknown 

Definition at line 15 of file platform.hpp.

◆ ReferenceType

Enumerator
File 
Https 
Invalid 

Definition at line 28 of file materializer.hpp.

◆ TarEntryType

Enumerator
RegularFile 
Directory 
Symlink 
Hardlink 
Other 

Definition at line 14 of file packaging.hpp.

◆ TrustState

Enumerator
Verified 
Unverified 
Failed 
Unknown 

Definition at line 125 of file types.hpp.

◆ Warning

Enumerator
invalid_manifest 
invalid_configuration 
profile_invalid 
profile_missing 
profile_parse_error 
nak_pin_invalid 
nak_not_found 
nak_version_unsupported 
binary_not_found 
capability_missing 
capability_malformed 
capability_unknown 
missing_env_var 
invalid_trust_state 
override_denied 
override_invalid 
invalid_library_path 
trust_state_unknown 
trust_state_unverified 
trust_state_failed 
trust_state_stale 

Definition at line 14 of file types.hpp.

◆ WarningAction

Enumerator
Warn 
Ignore 
Error 

Definition at line 73 of file types.hpp.

Function Documentation

◆ action_to_string()

const char * nah::action_to_string ( WarningAction  a)
inline

Definition at line 79 of file types.hpp.

◆ atomic_create_directory()

AtomicWriteResult nah::atomic_create_directory ( const std::string &  path)

◆ atomic_update_symlink()

AtomicWriteResult nah::atomic_update_symlink ( const std::string &  link_path,
const std::string &  target 
)

◆ atomic_write_file() [1/2]

AtomicWriteResult nah::atomic_write_file ( const std::string &  path,
const std::string &  content 
)

◆ atomic_write_file() [2/2]

AtomicWriteResult nah::atomic_write_file ( const std::string &  path,
const std::vector< uint8_t > &  content 
)

◆ binding_mode_to_string()

const char * nah::binding_mode_to_string ( BindingMode  m)
inline

Definition at line 271 of file types.hpp.

◆ collect_directory_entries()

CollectResult nah::collect_directory_entries ( const std::string &  dir_path)

◆ compose_contract()

CompositionResult nah::compose_contract ( const CompositionInputs inputs)

◆ compute_sha256() [1/2]

HashResult nah::compute_sha256 ( const std::string &  file_path)

◆ compute_sha256() [2/2]

HashResult nah::compute_sha256 ( const std::vector< uint8_t > &  data)

◆ copy_file()

bool nah::copy_file ( const std::string &  src,
const std::string &  dst 
)

◆ create_deterministic_archive()

PackResult nah::create_deterministic_archive ( const std::vector< TarEntry > &  entries)

◆ create_directories()

bool nah::create_directories ( const std::string &  path)

◆ create_warning_fields()

std::unordered_map< std::string, std::string > nah::create_warning_fields ( const std::vector< WarningObject > &  warnings)

◆ critical_error_to_string()

const char * nah::critical_error_to_string ( CriticalError  e)
inline

Definition at line 101 of file types.hpp.

◆ decode_manifest_tlv()

ManifestDecodeResult nah::decode_manifest_tlv ( const std::vector< uint8_t > &  data,
std::optional< size_t expected_total_size = std::nullopt 
)

◆ derive_capabilities_from_permissions()

std::vector< Capability > nah::derive_capabilities_from_permissions ( const std::vector< std::string > &  permissions)

◆ derive_capability() [1/2]

std::optional< Capability > nah::derive_capability ( const std::string &  operation,
const std::string &  resource 
)

◆ derive_capability() [2/2]

Capability nah::derive_capability ( const std::string &  permission,
WarningCollector warnings 
)

◆ derive_enforcement() [1/2]

std::optional< std::string > nah::derive_enforcement ( const std::string &  capability_key,
const HostProfile profile 
)

◆ derive_enforcement() [2/2]

EnforcementResult nah::derive_enforcement ( const std::vector< std::string > &  filesystem_permissions,
const std::vector< std::string > &  network_permissions,
const HostProfile profile,
WarningCollector warnings 
)

◆ expand_environment_map()

void nah::expand_environment_map ( std::unordered_map< std::string, std::string > &  environment,
WarningCollector warnings 
)

◆ expand_placeholders() [1/2]

ExpansionResult nah::expand_placeholders ( const std::string &  input,
const std::unordered_map< std::string, std::string > &  environment,
const std::string &  source_path,
WarningCollector warnings 
)

◆ expand_placeholders() [2/2]

std::string nah::expand_placeholders ( const std::string &  input,
const std::unordered_map< std::string, std::string > &  environment,
std::vector< std::string > &  missing_vars 
)

◆ expand_placeholders_with_limits()

ExpansionWithLimitsResult nah::expand_placeholders_with_limits ( const std::string &  input,
const std::unordered_map< std::string, std::string > &  environment,
std::vector< std::string > &  missing_vars,
size_t  max_size,
size_t  max_placeholders 
)

◆ expand_string_vector()

std::vector< std::string > nah::expand_string_vector ( const std::vector< std::string > &  input,
const std::unordered_map< std::string, std::string > &  environment,
const std::string &  source_path_prefix,
WarningCollector warnings 
)

◆ expand_vector()

std::vector< std::string > nah::expand_vector ( const std::vector< std::string > &  input,
const std::unordered_map< std::string, std::string > &  environment,
std::vector< std::string > &  missing_vars 
)

◆ extract_archive_safe() [1/2]

UnpackResult nah::extract_archive_safe ( const std::string &  archive_path,
const std::string &  staging_dir 
)

◆ extract_archive_safe() [2/2]

UnpackResult nah::extract_archive_safe ( const std::vector< uint8_t > &  archive_data,
const std::string &  staging_dir 
)

◆ fetch_https()

FetchResult nah::fetch_https ( const std::string &  url)

◆ generate_uuid()

std::string nah::generate_uuid ( )

◆ get_all_env()

std::unordered_map< std::string, std::string > nah::get_all_env ( )

◆ get_builtin_empty_profile()

HostProfile nah::get_builtin_empty_profile ( )

◆ get_current_platform()

Platform nah::get_current_platform ( )

◆ get_current_timestamp()

std::string nah::get_current_timestamp ( )

◆ get_env()

std::optional< std::string > nah::get_env ( const std::string &  name)

◆ get_filename()

std::string nah::get_filename ( const std::string &  path)

◆ get_library_path_env_key()

std::string nah::get_library_path_env_key ( )

◆ get_parent_directory()

std::string nah::get_parent_directory ( const std::string &  path)

◆ get_path_separator()

char nah::get_path_separator ( )

◆ get_warning_action() [1/2]

WarningAction nah::get_warning_action ( const HostProfile profile,
const std::string &  warning_key 
)

◆ get_warning_action() [2/2]

WarningAction nah::get_warning_action ( const HostProfile profile,
Warning  warning 
)

◆ inspect_nak_pack() [1/2]

NakPackInfo nah::inspect_nak_pack ( const std::string &  pack_path)

◆ inspect_nak_pack() [2/2]

NakPackInfo nah::inspect_nak_pack ( const std::vector< uint8_t > &  archive_data)

◆ inspect_nap_package() [1/2]

NapPackageInfo nah::inspect_nap_package ( const std::string &  package_path)

◆ inspect_nap_package() [2/2]

NapPackageInfo nah::inspect_nap_package ( const std::vector< uint8_t > &  archive_data)

◆ install_app()

AppInstallResult nah::install_app ( const std::string &  source,
const AppInstallOptions options 
)

◆ install_nak()

NakInstallResult nah::install_nak ( const std::string &  source,
const NakInstallOptions options 
)

◆ install_nak_pack()

NakInstallResult nah::install_nak_pack ( const std::string &  pack_path,
const NakInstallOptions options 
)

◆ install_nap_package()

AppInstallResult nah::install_nap_package ( const std::string &  package_path,
const AppInstallOptions options 
)

◆ is_directory()

bool nah::is_directory ( const std::string &  path)

◆ is_override_permitted()

bool nah::is_override_permitted ( const std::string &  target,
const HostProfile profile 
)

◆ is_regular_file()

bool nah::is_regular_file ( const std::string &  path)

◆ is_symlink()

bool nah::is_symlink ( const std::string &  path)

◆ join_path()

std::string nah::join_path ( const std::string &  base,
const std::string &  rel 
)

◆ list_directory()

std::vector< std::string > nah::list_directory ( const std::string &  path)

◆ load_pinned_nak()

PinnedNakLoadResult nah::load_pinned_nak ( const NakPin pin,
const Manifest manifest,
const HostProfile profile,
const std::string &  nah_root,
WarningCollector warnings 
)

◆ manifest()

ManifestBuilder nah::manifest ( )
inline

Definition at line 56 of file manifest_builder.hpp.

◆ normalize_under_root()

PathResult nah::normalize_under_root ( const std::string &  root,
const std::string &  relative_path,
bool  allow_absolute = false 
)

◆ override_mode_to_string()

const char * nah::override_mode_to_string ( OverrideMode  m)
inline

Definition at line 251 of file types.hpp.

◆ pack_directory()

PackResult nah::pack_directory ( const std::string &  dir_path)

◆ pack_nak()

PackResult nah::pack_nak ( const std::string &  dir_path)

◆ pack_nap()

PackResult nah::pack_nap ( const std::string &  dir_path)

◆ parse_app_install_record()

InstallRecordValidation nah::parse_app_install_record ( const std::string &  toml,
AppInstallRecord out 
)

◆ parse_app_install_record_full()

AppInstallRecordParseResult nah::parse_app_install_record_full ( const std::string &  toml_str,
const std::string &  source_path = "" 
)

◆ parse_artifact_reference()

ParsedReference nah::parse_artifact_reference ( const std::string &  reference)

◆ parse_asset_export()

std::optional< AssetExportParts > nah::parse_asset_export ( const std::string &  value)

◆ parse_binding_mode()

std::optional< BindingMode > nah::parse_binding_mode ( const std::string &  s)

◆ parse_host_profile()

HostProfileValidation nah::parse_host_profile ( const std::string &  toml,
HostProfileRecord out 
)

◆ parse_host_profile_full()

HostProfileParseResult nah::parse_host_profile_full ( const std::string &  toml_str,
const std::string &  source_path = "" 
)

◆ parse_manifest()

ManifestFieldsResult nah::parse_manifest ( const std::vector< uint8_t > &  blob)

◆ parse_manifest_blob()

ManifestParseResult nah::parse_manifest_blob ( const std::vector< uint8_t > &  blob)

◆ parse_nak_install_record()

NakInstallValidation nah::parse_nak_install_record ( const std::string &  toml,
NakInstallRecord out 
)

◆ parse_nak_install_record_full()

NakInstallRecordParseResult nah::parse_nak_install_record_full ( const std::string &  toml_str,
const std::string &  source_path = "" 
)

◆ parse_nak_pack_manifest()

NakPackManifestParseResult nah::parse_nak_pack_manifest ( const std::string &  toml_str)

◆ parse_override_mode()

std::optional< OverrideMode > nah::parse_override_mode ( const std::string &  s)

◆ parse_overrides_file()

OverridesParseResult nah::parse_overrides_file ( const std::string &  content,
const std::string &  path 
)

◆ parse_permission_string()

std::optional< ParsedPermission > nah::parse_permission_string ( const std::string &  permission)

◆ parse_range()

std::optional< VersionRange > nah::parse_range ( const std::string &  str)

Parse a version range string.

Parameters
strRange string (e.g., ">=1.0.0 <2.0.0", "1.0.0 || >=2.0.0")
Returns
Parsed range or nullopt on failure

Supports: =, <, <=, >, >= comparators, space-separated AND, || for OR

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

◆ parse_trust_state()

std::optional< TrustState > nah::parse_trust_state ( const std::string &  s)

◆ parse_version()

std::optional< Version > nah::parse_version ( const std::string &  str)

Parse a SemVer 2.0.0 version string.

Parameters
strVersion string (e.g., "1.2.3", "1.0.0-alpha+build")
Returns
Parsed version or nullopt on failure
Examples
/home/runner/work/nah/nah/include/nah/semver.hpp.

◆ parse_warning_action()

std::optional< WarningAction > nah::parse_warning_action ( const std::string &  s)

◆ parse_warning_key()

std::optional< Warning > nah::parse_warning_key ( const std::string &  key)

◆ path_exists()

bool nah::path_exists ( const std::string &  path)

◆ read_manifest_section() [1/2]

SectionReadResult nah::read_manifest_section ( const std::string &  binary_path)

◆ read_manifest_section() [2/2]

SectionReadResult nah::read_manifest_section ( const std::vector< uint8_t > &  binary_data)

◆ read_symlink()

std::optional< std::string > nah::read_symlink ( const std::string &  path)

◆ remove_directory()

bool nah::remove_directory ( const std::string &  path)

◆ remove_file()

bool nah::remove_file ( const std::string &  path)

◆ satisfies() [1/3]

bool nah::satisfies ( const Version version,
const ComparatorSet set 
)

Check if a version satisfies a comparator set (all constraints)

◆ satisfies() [2/3]

bool nah::satisfies ( const Version version,
const Constraint constraint 
)

Check if a version satisfies a single constraint.

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

◆ satisfies() [3/3]

bool nah::satisfies ( const Version version,
const VersionRange range 
)

Check if a version satisfies a version range (any set)

◆ scan_nak_registry()

std::vector< NakRegistryEntry > nah::scan_nak_registry ( const std::string &  nah_root)

◆ select_nak_for_install()

NakSelectionResult nah::select_nak_for_install ( const Manifest manifest,
const HostProfile profile,
const std::vector< NakRegistryEntry > &  registry,
WarningCollector warnings 
)

◆ serialize_contract_json()

std::string nah::serialize_contract_json ( const ContractEnvelope envelope,
bool  include_trace = false,
std::optional< CriticalError critical_error = std::nullopt 
)

◆ to_portable_path()

std::string nah::to_portable_path ( const std::string &  path)

◆ trust_state_to_string()

const char * nah::trust_state_to_string ( TrustState  s)
inline

Definition at line 132 of file types.hpp.

◆ uninstall_app()

UninstallResult nah::uninstall_app ( const std::string &  nah_root,
const std::string &  app_id,
const std::string &  version = "" 
)

◆ uninstall_nak()

UninstallResult nah::uninstall_nak ( const std::string &  nah_root,
const std::string &  nak_id,
const std::string &  version 
)

◆ validate_app_install_record()

bool nah::validate_app_install_record ( const AppInstallRecord record,
std::string &  error 
)

◆ validate_extraction_path()

PathValidation nah::validate_extraction_path ( const std::string &  entry_path,
const std::string &  extraction_root 
)

◆ validate_nak_install_record()

bool nah::validate_nak_install_record ( const NakInstallRecord record,
std::string &  error 
)

◆ verify_app()

VerifyResult nah::verify_app ( const std::string &  nah_root,
const std::string &  app_id,
const std::string &  version = "" 
)

◆ verify_sha256()

Sha256VerifyResult nah::verify_sha256 ( const std::vector< uint8_t > &  data,
const std::string &  expected_hex 
)

◆ version_allowed_by_profile()

bool nah::version_allowed_by_profile ( const std::string &  version,
const HostProfile profile 
)

◆ version_matches_pattern()

bool nah::version_matches_pattern ( const std::string &  version,
const std::string &  pattern 
)

◆ warning_to_string()

const char * nah::warning_to_string ( Warning  w)
inline

Definition at line 39 of file types.hpp.

Variable Documentation

◆ MAX_EXPANDED_SIZE

constexpr size_t nah::MAX_EXPANDED_SIZE = 64 * 1024
constexpr

Definition at line 16 of file expansion.hpp.

◆ MAX_PLACEHOLDERS

constexpr size_t nah::MAX_PLACEHOLDERS = 128
constexpr

Definition at line 17 of file expansion.hpp.