libnmbs 1.0.0
Loading...
Searching...
No Matches
nmbs.h
Go to the documentation of this file.
1
27
28#pragma once
29
30#include <string>
31#include <filesystem>
32
33#include "binding.h"
35#include "binding_information.h"
36#include "expected.h"
37
47namespace nmbs
48{
49
58 [[nodiscard]] std::string_view version() noexcept;
59
64 void cleanup();
65
76 [[nodiscard]] Expected<std::string> write_labels(
77 const std::filesystem::path& path,
78 const std::vector<ConfidentialityLabel>& confidentiality_labels,
79 std::optional<binding::ProfileSupport> binding_support = std::nullopt);
80
89 [[nodiscard]] Expected<std::optional<binding::BindingInformation>> read_binding(
90 const std::filesystem::path& path,
91 std::optional<binding::ProfileSupport> binding_support = std::nullopt);
92
100 [[nodiscard]] Expected<std::optional<std::string>> read_binding_xml(
101 const std::filesystem::path& path,
102 std::optional<binding::ProfileSupport> binding_support = std::nullopt);
103
110 const std::filesystem::path& path,
111 std::optional<binding::ProfileSupport> binding_support = std::nullopt);
112
113}
binding.h brief
binding_information.h brief
Object representation of a Confidentiality Label as per ADatP-4774.
expected.h brief
Definition binding.h:32
Lightweight helpers for generating NATO confidentiality metadata.
Definition binding.h:32
std::expected< T, Error > Expected
Convenience typedef to standardise usage of nmbs::error in all std::expected usages.
Definition expected.h:116
void cleanup()
Free up any allocated memory and state to keep tools like Valgrind clean.
Expected< std::optional< binding::BindingInformation > > read_binding(const std::filesystem::path &path, std::optional< binding::ProfileSupport > binding_support=std::nullopt)
Reads the full ADatP-4778 binding from the file.
Expected< std::optional< std::string > > read_binding_xml(const std::filesystem::path &path, std::optional< binding::ProfileSupport > binding_support=std::nullopt)
Reads the full ADatP-4778 binding from the file.
Expected< void > remove_binding(const std::filesystem::path &path, std::optional< binding::ProfileSupport > binding_support=std::nullopt)
Removes the ADatP-4778 binding from the file.
Expected< std::string > write_labels(const std::filesystem::path &path, const std::vector< ConfidentialityLabel > &confidentiality_labels, std::optional< binding::ProfileSupport > binding_support=std::nullopt)
Writes ADatP‑4778 binding information using the best possible binding profile.
std::string_view version() noexcept
Returns the semantic version of the library.
Struct representation of the ADatP-4774 "Confidentiality Label".
Definition confidentiality_label.h:45