group


An os_group represents a group. In addition to an owner (user), most entities such as processes and files have an associated group. An os_group object can be constructed from either a numeric group ID or a symbolic group name. Once constructed, an os_group accesses information about a group, such as the group name and associated users. Conversions permit interchangeable use of os_group and os_gid_t .

Library

Security<ToolKit>

Declaration

#include <ospace/security/group.h>

class os_group

Interface

Constructor
os_group( const char* name , enum Encoding enc = Ascii )
Constructs a group with name name . Default enc is Ascii. Valid value for enc can be Ascii or Utf8.

Throws: os_security_toolkit_error

Constructor
os_group( const string& name , enum Encoding enc = Ascii )
Constructs a group with name name . Default enc is Ascii. Valid value for enc can be Ascii or Utf8.

Throws: os_security_toolkit_error

Constructor
os_group( const os_gid_t& gid )
Constructs a group with group ID gid (default OS_UNDEFINED_GROUP ).

Throws: os_security_toolkit_error

Constructor
os_group( const os_group& group )
Constructs a group that is a copy of group .
<
bool operator<( const os_group& group ) const
Returns true if this group's ID is less than group 's.
=
os_group& operator=( os_gid_t gid )
Assigns group from gid .
=
os_group& operator=( const os_group& group )
Assigns group from group .
==
bool operator==( const os_group& group ) const
Returns true if this group's ID is the same as group 's.
(os_gid_t)
operator os_gid_t() const
Returns this group's ID.
defined
bool defined() const
Returns true if this group's ID is not OS_UNDEFINED .
domain
string domain( enum Encoding enc = Ascii ) const
Returns group's domain name. Default enc is Ascii. Valid value for enc can be Ascii or Utf8.
gid
os_gid_t gid() const
Returns group's ID.
gid
void gid( const os_gid_t& gid )
Sets this group's identifier to gid .
name
string name( enum Encoding enc = Ascii ) const
Returns this group's name. Default enc is Ascii. Valid value for enc can be Ascii or Utf8.
print
void print( ostream& stream ) const
Prints the group name and ID to stream .

UNIX-Specific Interface

Constructor
os_group( const struct group& group )
Constructs this group from group .
groups
/* static */ vector< os_gid_t > groups()
Returns a vector of all group IDs.
password
string password() const
Returns my encrypted password.
users
vector< os_uid_t > users() const
Returns a vector of the group's users' IDs.

Non-Member Functions

<<
ostream& operator<<( ostream& stream , const os_group& group )
Prints group to stream .

Universal Streaming Service

#include <ospace/uss/security.h>

<<
os_bstream& operator<<( os_bstream& stream , const os_group& group )
Writes group to stream .
>>
os_bstream& operator>>( os_bstream& stream , os_group& group )
Reads group from stream .

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.