|
libnmbs 1.0.0
|
Lightweight utilities for NATO confidentiality metadata. More...
Namespaces | |
| namespace | binding |
| Functionality for the numerous binding profiles of ADatP-4778. | |
Classes | |
| struct | ConfidentialityLabel |
| Struct representation of the ADatP-4774 "Confidentiality Label". More... | |
| class | Error |
| Lightweight domain error container for use with nmbs::Expected. More... | |
Typedefs | |
| template<typename T> | |
| using | Expected = std::expected<T, Error> |
| Alias for std::expected standardized with nmbs::Error. | |
Enumerations | |
| enum | ExitCode { success = 0 , invalid_arguments = 1 , file_not_found = 10 , xmp_not_found = 11 , xmp_key_not_found = 12 , xml_could_not_parse = 13 , xml_could_not_create_xpath_context = 14 , no_label_present = 15 , no_binding_support = 16 , unknown_error = 99 } |
| Standard exit codes produced by nmbs tools. More... | |
Functions | |
| std::string_view | version () noexcept |
| Retrieves the semantic version of the library. | |
| void | cleanup () |
| Releases globally allocated memory and resets library state. | |
| 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 optimal binding profile. | |
| Expected< std::optional< binding::BindingInformation > > | read_binding (const std::filesystem::path &path, std::optional< binding::ProfileSupport > binding_support=std::nullopt) |
| Reads and deserializes the ADatP-4778 binding from the specified file. | |
| Expected< std::optional< std::string > > | read_binding_xml (const std::filesystem::path &path, std::optional< binding::ProfileSupport > binding_support=std::nullopt) |
| Reads the raw XML of the ADatP-4778 binding from the specified 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 specified file. | |
Lightweight utilities for NATO confidentiality metadata.
Implements core components of ADatP-4774, ADatP-4778, and STANAG 5636. Provides a dependency-free toolkit to attach standards-compliant labels to low-sensitivity artifacts.
| using nmbs::Expected = std::expected<T, Error> |
| enum nmbs::ExitCode |
Standard exit codes produced by nmbs tools.
Suitable for use as executable return values or library error indicators.
| void nmbs::cleanup | ( | ) |
Releases globally allocated memory and resets library state.
Safe to call at any time to assist memory profilers (e.g., Valgrind). Subsequent library calls may incur performance penalties as caches are rebuilt.
|
nodiscard |
Reads and deserializes the ADatP-4778 binding from the specified file.
If multiple bindings exist, precedence is undefined and only one is returned.
| path | Path to the target file. |
| binding_support | Optional pre-calculated binding profile capabilities. |
|
nodiscard |
Reads the raw XML of the ADatP-4778 binding from the specified file.
| path | Path to the target file. |
| binding_support | Optional pre-calculated binding profile capabilities. |
| Expected< void > nmbs::remove_binding | ( | const std::filesystem::path & | path, |
| std::optional< binding::ProfileSupport > | binding_support = std::nullopt ) |
Removes the ADatP-4778 binding from the specified file.
| path | Path to the target file. |
| binding_support | Optional pre-calculated binding profile capabilities. |
|
nodiscardnoexcept |
Retrieves the semantic version of the library.
Returns the version in MAJOR.MINOR.PATCH format, matching the build configuration. Pre-release suffixes are not appended.
|
nodiscard |
Writes ADatP-4778 binding information using the optimal binding profile.
Embedded profiles take precedence over sidecar profiles. Existing binding data will be overwritten.
| path | Path to the target file. |
| confidentiality_labels | Collection of labels to apply. |
| binding_support | Optional pre-calculated binding profile capabilities. |