BloombergLP::bdls::FilePermissions

This struct provides a namespace for a std::filesystem::perms-style enumeration of file-system permission bits, and a pair of predicates for validating an int bit mask against that enumeration.

Synopsis

Declared in <bdls_filepermissions.h>

struct FilePermissions;

Enums

NameDescription
Enum File-system permission bits, in the conventional Unix octal layout. Values may be combined with the bitwise-OR operator. See the component-level documentation for the meaning of each enumerator.

Static Member Functions

NameDescription
isValid Return true if the specified permissions bit mask consists only of bits defined in Enum (i.e., bits in k_MASK), and false otherwise. A negative value always returns false.
isValidBaseBits Return true if the specified permissions bit mask consists only of the "base" nine rwx bits (owner/group/others read/write/execute, i.e., bits in k_ALL), and false otherwise. Note that this predicate is stricter than isValid: k_SET_UID, k_SET_GID, and k_STICKY_BIT are rejected.
print Write the octal numeric representation of the specified permission bit mask value to the specified output stream, and return a reference to stream. Optionally specify an initial indentation level, whose absolute value is incremented recursively for nested objects. If level is specified, optionally specify spacesPerLevel, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). The value is written in octal notation without the customary leading 0 prefix (for example, the mask 0640 is written as 640).