libnmbs 1.0.0
Loading...
Searching...
No Matches
nmbs::binding Namespace Reference

Functionality for the numerous binding profiles of ADatP-4778. More...

Classes

struct  BindingInformation
 Holds information about both the labels, and the file the labels are bound to. More...

Typedefs

typedef std::uint32_t AccessMode
 Bitmask type for evaluating file access modes.
typedef std::uint32_t ProfileSupport
 Bitmask type for indicating supported ADatP-4778 binding profiles.

Enumerations

enum  AccessModeFlags : AccessMode { am_none = 0 , am_read = 1 << 0 , am_write = 1 << 1 }
 Flags representing read/write access capabilities. More...
enum  ProfileSupportFlags : ProfileSupport {
  ps_none = 0 , ps_xmp = 1 << 0 , ps_sidecar = 1 << 1 , ps_xml = 1 << 2 ,
  ps_ext4 = 1 << 3
}
 Flags representing supported binding profiles for a specific file. More...

Functions

ProfileSupport support (const std::filesystem::path &path)
 File analysis to check the binding capabilities of the path.

Detailed Description

Functionality for the numerous binding profiles of ADatP-4778.

This namespace holds a number of sub-namespaces relevant to each binding profile. The sub-namespaces each contain a similar set of functions, such as for reading and writing labels using specifically that binding profile.

Since
1.0.0

Typedef Documentation

◆ AccessMode

typedef std::uint32_t nmbs::binding::AccessMode

Bitmask type for evaluating file access modes.

Since
1.0.0

◆ ProfileSupport

typedef std::uint32_t nmbs::binding::ProfileSupport

Bitmask type for indicating supported ADatP-4778 binding profiles.

Since
1.0.0

Enumeration Type Documentation

◆ AccessModeFlags

Flags representing read/write access capabilities.

Since
1.0.0
Enumerator
am_none 

No access.

Since
1.0.0
am_read 

Read access.

Since
1.0.0
am_write 

Write access.

Since
1.0.0

◆ ProfileSupportFlags

Flags representing supported binding profiles for a specific file.

Since
1.0.0
Enumerator
ps_none 

The file does not support ADatP-4774 labels.

Since
1.0.0
ps_xmp 

The file supports the XMP binding profile.

Since
1.0.0
ps_sidecar 

The file supports the Sidecar binding profile.

Since
1.0.0
ps_xml 

The file supports the XML binding profile.

Since
1.0.0
ps_ext4 

The file supports the EXT4 binding profile.

Since
1.0.0

Function Documentation

◆ support()

ProfileSupport nmbs::binding::support ( const std::filesystem::path & path)
nodiscard

File analysis to check the binding capabilities of the path.

Using nmbs::binding::ProfileSupportFlags you can use classic binary logic to see which binding profiles could potentially be supported by this file. Note that this ignores rights! For example, sidecar will be reported as supported for files in /etc/... as it is entirely possible that a readonly file can have a sidecar. Users should use the relevant access mode checks to verify if a binding profile has read or write access.

This function is written for speed, but it does perform several IO operations. Care should be taken to cache the result if possible.

Parameters
pathThe filesystem path to analyse.
Returns
nmbs::binding::ProfileSupport bitmask containing all supported binding profiles.
Since
1.0.0