Open CASCADE Technology  7.5.0
Public Member Functions
OSD_Protection Class Reference

This class provides data to manage file protection Example:These rights are treated in a system dependent manner : On UNIX you have User,Group and Other rights On VMS you have Owner,Group,World and System rights An automatic conversion is done between OSD and UNIX/VMS. More...

#include <OSD_Protection.hxx>

Public Member Functions

 OSD_Protection ()
 Initializes global access rights as follows. More...
 
 OSD_Protection (const OSD_SingleProtection System, const OSD_SingleProtection User, const OSD_SingleProtection Group, const OSD_SingleProtection World)
 Sets values of fields. More...
 
void Values (OSD_SingleProtection &System, OSD_SingleProtection &User, OSD_SingleProtection &Group, OSD_SingleProtection &World)
 Retrieves values of fields. More...
 
void SetValues (const OSD_SingleProtection System, const OSD_SingleProtection User, const OSD_SingleProtection Group, const OSD_SingleProtection World)
 Sets values of fields. More...
 
void SetSystem (const OSD_SingleProtection priv)
 Sets protection of 'System'. More...
 
void SetUser (const OSD_SingleProtection priv)
 Sets protection of 'User'. More...
 
void SetGroup (const OSD_SingleProtection priv)
 Sets protection of 'Group'. More...
 
void SetWorld (const OSD_SingleProtection priv)
 Sets protection of 'World'. More...
 
OSD_SingleProtection System () const
 Gets protection of 'System'. More...
 
OSD_SingleProtection User () const
 Gets protection of 'User'. More...
 
OSD_SingleProtection Group () const
 Gets protection of 'Group'. More...
 
OSD_SingleProtection World () const
 Gets protection of 'World'. More...
 
void Add (OSD_SingleProtection &aProt, const OSD_SingleProtection aRight)
 Add a right to a single protection. ex: aProt = RWD me.Add(aProt,X) -> aProt = RWXD. More...
 
void Sub (OSD_SingleProtection &aProt, const OSD_SingleProtection aRight)
 Subtract a right to a single protection. ex: aProt = RWD me.Sub(aProt,RW) -> aProt = D But me.Sub(aProt,RWX) is also valid and gives same result. More...
 

Detailed Description

This class provides data to manage file protection Example:These rights are treated in a system dependent manner : On UNIX you have User,Group and Other rights On VMS you have Owner,Group,World and System rights An automatic conversion is done between OSD and UNIX/VMS.

OSD VMS UNIX User Owner User Group Group Group World World Other System System (combined with Other)

When you use System protection on UNIX you must know that Other rights and System rights are inclusively "ORed". So Other with only READ access and System with WRITE access will produce on UNIX Other with READ and WRITE access.

This choice comes from the fact that ROOT can't be considered as member of the group nor as user. So it is considered as Other.

Constructor & Destructor Documentation

◆ OSD_Protection() [1/2]

OSD_Protection::OSD_Protection ( )

Initializes global access rights as follows.

User : Read Write System : Read Write Group : Read World : Read

◆ OSD_Protection() [2/2]

OSD_Protection::OSD_Protection ( const OSD_SingleProtection  System,
const OSD_SingleProtection  User,
const OSD_SingleProtection  Group,
const OSD_SingleProtection  World 
)

Sets values of fields.

Member Function Documentation

◆ Add()

void OSD_Protection::Add ( OSD_SingleProtection aProt,
const OSD_SingleProtection  aRight 
)

Add a right to a single protection. ex: aProt = RWD me.Add(aProt,X) -> aProt = RWXD.

◆ Group()

OSD_SingleProtection OSD_Protection::Group ( ) const

Gets protection of 'Group'.

◆ SetGroup()

void OSD_Protection::SetGroup ( const OSD_SingleProtection  priv)

Sets protection of 'Group'.

◆ SetSystem()

void OSD_Protection::SetSystem ( const OSD_SingleProtection  priv)

Sets protection of 'System'.

◆ SetUser()

void OSD_Protection::SetUser ( const OSD_SingleProtection  priv)

Sets protection of 'User'.

◆ SetValues()

void OSD_Protection::SetValues ( const OSD_SingleProtection  System,
const OSD_SingleProtection  User,
const OSD_SingleProtection  Group,
const OSD_SingleProtection  World 
)

Sets values of fields.

◆ SetWorld()

void OSD_Protection::SetWorld ( const OSD_SingleProtection  priv)

Sets protection of 'World'.

◆ Sub()

void OSD_Protection::Sub ( OSD_SingleProtection aProt,
const OSD_SingleProtection  aRight 
)

Subtract a right to a single protection. ex: aProt = RWD me.Sub(aProt,RW) -> aProt = D But me.Sub(aProt,RWX) is also valid and gives same result.

◆ System()

OSD_SingleProtection OSD_Protection::System ( ) const

Gets protection of 'System'.

◆ User()

OSD_SingleProtection OSD_Protection::User ( ) const

Gets protection of 'User'.

◆ Values()

void OSD_Protection::Values ( OSD_SingleProtection System,
OSD_SingleProtection User,
OSD_SingleProtection Group,
OSD_SingleProtection World 
)

Retrieves values of fields.

◆ World()

OSD_SingleProtection OSD_Protection::World ( ) const

Gets protection of 'World'.


The documentation for this class was generated from the following file: