#include <Permissions.h>
Public Member Functions | |
Permissions (uint32 mask=0) throw () | |
Permissions (const Permissions &other) throw () | |
~Permissions () throw () | |
bool | CanUserRead () const throw () |
void | SetUserRead () throw () |
void | ClearUserRead () throw () |
bool | CanUserWrite () const throw () |
void | SetUserWrite () throw () |
void | ClearUserWrite () throw () |
bool | CanUserExecute () const throw () |
void | SetUserExecute () throw () |
void | ClearUserExecute () throw () |
bool | CanGroupRead () const throw () |
void | SetGroupRead () throw () |
void | ClearGroupRead () throw () |
bool | CanGroupWrite () const throw () |
void | SetGroupWrite () throw () |
void | ClearGroupWrite () throw () |
bool | CanGroupExecute () const throw () |
void | SetGroupExecute () throw () |
void | ClearGroupExecute () throw () |
bool | CanOthersRead () const throw () |
void | SetOthersRead () throw () |
void | ClearOthersRead () throw () |
bool | CanOthersWrite () const throw () |
void | SetOthersWrite () throw () |
void | ClearOthersWrite () throw () |
bool | CanOthersExecute () const throw () |
void | SetOthersExecute () throw () |
void | ClearOthersExecute () throw () |
void | ClearAll () throw () |
Permissions & | operator= (const Permissions &other) throw () |
uint32 | GetMask () const throw () |
operator uint32 () throw () | |
StringPtr | ToString () const |
uint32 | operator= (uint32 rhs) throw () |
uint32 | operator|= (uint32 rhs) throw () |
uint32 | operator&= (uint32 rhs) throw () |
Static Public Attributes | |
static const int | USER_READ = S_IRUSR |
static const int | USER_WRITE = S_IWUSR |
static const int | USER_READ_WRITE = (S_IRUSR | S_IWUSR) |
static const int | USER_EXECUTE = S_IXUSR |
static const int | USER_ALL = (S_IRUSR | S_IWUSR | S_IXUSR) |
static const int | GROUP_READ = S_IRGRP |
static const int | GROUP_WRITE = S_IWGRP |
static const int | GROUP_READ_WRITE = (S_IRGRP | S_IWGRP) |
static const int | GROUP_EXECUTE = S_IXGRP |
static const int | GROUP_ALL = (S_IRGRP | S_IWGRP | S_IXGRP) |
static const int | OTHERS_READ = S_IROTH |
static const int | OTHERS_WRITE = S_IWOTH |
static const int | OTHERS_READ_WRITE = (S_IROTH | S_IWOTH) |
static const int | OTHERS_EXECUTE = S_IXOTH |
static const int | OTHERS_ALL = (S_IROTH | S_IWOTH | S_IXOTH) |
static const int | ALL_READ_WRITE |
static const int | ALLBITS = (USER_ALL | GROUP_ALL | OTHERS_ALL) |
static const Permissions | DefaultFilePerms |
static const Permissions | DefaultDirPerms |
File permissions. Permissions consist of read, write, and execute access for each of user (owner), group, and others (everyone), and are represented efficiently as a mask.
Definition at line 52 of file Permissions.h.
Permissions::Permissions | ( | uint32 | mask = 0 |
) | throw () |
Construct a new Permissions object with the given mask.
mask | The permissions mask. |
Definition at line 87 of file Permissions.cpp.
Permissions::Permissions | ( | const Permissions & | other | ) | throw () |
Copy constructor.
Definition at line 95 of file Permissions.cpp.
Permissions::~Permissions | ( | ) | throw () |
Destructor.
Definition at line 103 of file Permissions.cpp.
bool Permissions::CanGroupExecute | ( | ) | const throw () [inline] |
Test for group execute access.
Definition at line 190 of file Permissions.h.
References GROUP_EXECUTE.
bool Permissions::CanGroupRead | ( | ) | const throw () [inline] |
bool Permissions::CanGroupWrite | ( | ) | const throw () [inline] |
bool Permissions::CanOthersExecute | ( | ) | const throw () [inline] |
Test for others execute access.
Definition at line 228 of file Permissions.h.
References OTHERS_EXECUTE.
bool Permissions::CanOthersRead | ( | ) | const throw () [inline] |
bool Permissions::CanOthersWrite | ( | ) | const throw () [inline] |
Test for others write access.
Definition at line 216 of file Permissions.h.
References OTHERS_WRITE.
bool Permissions::CanUserExecute | ( | ) | const throw () [inline] |
Test for user execute access.
Definition at line 152 of file Permissions.h.
References USER_EXECUTE.
bool Permissions::CanUserRead | ( | ) | const throw () [inline] |
bool Permissions::CanUserWrite | ( | ) | const throw () [inline] |
void Permissions::ClearAll | ( | ) | throw () [inline] |
Disable all access.
Definition at line 240 of file Permissions.h.
void Permissions::ClearGroupExecute | ( | ) | throw () [inline] |
Disable group execute access.
Definition at line 198 of file Permissions.h.
References GROUP_EXECUTE.
void Permissions::ClearGroupRead | ( | ) | throw () [inline] |
void Permissions::ClearGroupWrite | ( | ) | throw () [inline] |
void Permissions::ClearOthersExecute | ( | ) | throw () [inline] |
Disable others execute access.
Definition at line 236 of file Permissions.h.
References OTHERS_EXECUTE.
void Permissions::ClearOthersRead | ( | ) | throw () [inline] |
void Permissions::ClearOthersWrite | ( | ) | throw () [inline] |
void Permissions::ClearUserExecute | ( | ) | throw () [inline] |
void Permissions::ClearUserRead | ( | ) | throw () [inline] |
void Permissions::ClearUserWrite | ( | ) | throw () [inline] |
uint32 Permissions::GetMask | ( | ) | const throw () [inline] |
Get the permissions mask.
Definition at line 249 of file Permissions.h.
Permissions::operator uint32 | ( | ) | throw () [inline] |
Cast operator. Returns the permissions mask.
Definition at line 254 of file Permissions.h.
void Permissions::SetGroupExecute | ( | ) | throw () [inline] |
Enable group execute access.
Definition at line 194 of file Permissions.h.
References GROUP_EXECUTE.
void Permissions::SetGroupRead | ( | ) | throw () [inline] |
void Permissions::SetGroupWrite | ( | ) | throw () [inline] |
void Permissions::SetOthersExecute | ( | ) | throw () [inline] |
Enable others execute access.
Definition at line 232 of file Permissions.h.
References OTHERS_EXECUTE.
void Permissions::SetOthersRead | ( | ) | throw () [inline] |
void Permissions::SetOthersWrite | ( | ) | throw () [inline] |
void Permissions::SetUserExecute | ( | ) | throw () [inline] |
void Permissions::SetUserRead | ( | ) | throw () [inline] |
void Permissions::SetUserWrite | ( | ) | throw () [inline] |
StringPtr Permissions::ToString | ( | ) | const |
Get a String representation of the permissions mask.
Definition at line 119 of file Permissions.cpp.
const int Permissions::ALL_READ_WRITE [static] |
(S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
All read and write mask.
Definition at line 120 of file Permissions.h.
const int Permissions::ALLBITS = (USER_ALL | GROUP_ALL | OTHERS_ALL) [static] |
Complete permissions mask.
Definition at line 123 of file Permissions.h.
const Permissions Permissions::DefaultDirPerms [static] |
Default permissions for directories: read, write & execute for user, read & execute for group.
Definition at line 281 of file Permissions.h.
const Permissions Permissions::DefaultFilePerms [static] |
Default permissions for files: read & write for user, read for group.
Definition at line 275 of file Permissions.h.
const int Permissions::GROUP_ALL = (S_IRGRP | S_IWGRP | S_IXGRP) [static] |
Group (all permissions) mask.
Definition at line 102 of file Permissions.h.
const int Permissions::GROUP_EXECUTE = S_IXGRP [static] |
Group execute mask.
Definition at line 99 of file Permissions.h.
Referenced by CanGroupExecute(), ClearGroupExecute(), and SetGroupExecute().
const int Permissions::GROUP_READ = S_IRGRP [static] |
Group read mask.
Definition at line 90 of file Permissions.h.
Referenced by CanGroupRead(), ClearGroupRead(), and SetGroupRead().
const int Permissions::GROUP_READ_WRITE = (S_IRGRP | S_IWGRP) [static] |
Group read and write mask.
Definition at line 96 of file Permissions.h.
const int Permissions::GROUP_WRITE = S_IWGRP [static] |
Group write mask.
Definition at line 93 of file Permissions.h.
Referenced by CanGroupWrite(), ClearGroupWrite(), and SetGroupWrite().
const int Permissions::OTHERS_ALL = (S_IROTH | S_IWOTH | S_IXOTH) [static] |
Others (all permissions) mask.
Definition at line 117 of file Permissions.h.
const int Permissions::OTHERS_EXECUTE = S_IXOTH [static] |
Others execute mask.
Definition at line 114 of file Permissions.h.
Referenced by CanOthersExecute(), ClearOthersExecute(), and SetOthersExecute().
const int Permissions::OTHERS_READ = S_IROTH [static] |
Others read mask.
Definition at line 105 of file Permissions.h.
Referenced by CanOthersRead(), ClearOthersRead(), and SetOthersRead().
const int Permissions::OTHERS_READ_WRITE = (S_IROTH | S_IWOTH) [static] |
Others read and write mask.
Definition at line 111 of file Permissions.h.
const int Permissions::OTHERS_WRITE = S_IWOTH [static] |
Others write mask.
Definition at line 108 of file Permissions.h.
Referenced by CanOthersWrite(), ClearOthersWrite(), and SetOthersWrite().
const int Permissions::USER_ALL = (S_IRUSR | S_IWUSR | S_IXUSR) [static] |
User (all permissions) mask.
Definition at line 87 of file Permissions.h.
const int Permissions::USER_EXECUTE = S_IXUSR [static] |
User execute mask.
Definition at line 84 of file Permissions.h.
Referenced by CanUserExecute(), ClearUserExecute(), and SetUserExecute().
const int Permissions::USER_READ = S_IRUSR [static] |
User read mask.
Definition at line 75 of file Permissions.h.
Referenced by CanUserRead(), ClearUserRead(), and SetUserRead().
const int Permissions::USER_READ_WRITE = (S_IRUSR | S_IWUSR) [static] |
User read and write mask.
Definition at line 81 of file Permissions.h.
const int Permissions::USER_WRITE = S_IWUSR [static] |
User write mask.
Definition at line 78 of file Permissions.h.
Referenced by CanUserWrite(), ClearUserWrite(), and SetUserWrite().