KIO
kacl.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KACL_H
00021 #define KACL_H
00022
00023
00024 #include <sys/types.h>
00025 #include <kio/global.h>
00026
00027 #include <QtCore/QPair>
00028 #include <QtCore/QList>
00029
00030
00031 typedef QPair<QString, unsigned short> ACLUserPermissions;
00032 typedef QList<ACLUserPermissions> ACLUserPermissionsList;
00033 typedef QList<ACLUserPermissions>::iterator ACLUserPermissionsIterator;
00034 typedef QList<ACLUserPermissions>::const_iterator ACLUserPermissionsConstIterator;
00035
00036 typedef QPair<QString, unsigned short> ACLGroupPermissions;
00037 typedef QList<ACLGroupPermissions> ACLGroupPermissionsList;
00038 typedef QList<ACLGroupPermissions>::iterator ACLGroupPermissionsIterator;
00039 typedef QList<ACLGroupPermissions>::const_iterator ACLGroupPermissionsConstIterator;
00040
00047 class KIO_EXPORT KACL
00048 {
00049 public:
00054 KACL( const QString & aclString );
00055
00057 KACL( const KACL& rhs );
00058
00063 KACL( mode_t basicPermissions );
00064
00069 KACL();
00070
00071 virtual ~KACL();
00072
00073 KACL& operator=( const KACL& rhs );
00074
00075 bool operator==( const KACL& rhs ) const;
00076
00077 bool operator!=( const KACL& rhs ) const;
00078
00083 bool isValid() const;
00084
00090 unsigned short ownerPermissions() const;
00091
00094 bool setOwnerPermissions( unsigned short );
00095
00097 unsigned short owningGroupPermissions() const;
00098
00101 bool setOwningGroupPermissions( unsigned short );
00102
00104 unsigned short othersPermissions() const;
00105
00108 bool setOthersPermissions( unsigned short );
00109
00111 mode_t basePermissions() const;
00112
00120 bool isExtended() const;
00121
00126 unsigned short maskPermissions( bool &exists ) const;
00127
00132 bool setMaskPermissions( unsigned short );
00133
00139 unsigned short namedUserPermissions( const QString& name, bool *exists ) const;
00140
00144 bool setNamedUserPermissions( const QString& name, unsigned short );
00145
00150 ACLUserPermissionsList allUserPermissions() const;
00151
00156 bool setAllUserPermissions( const ACLUserPermissionsList &list );
00157
00163 unsigned short namedGroupPermissions( const QString& name, bool *exists ) const;
00164
00168 bool setNamedGroupPermissions( const QString& name, unsigned short );
00169
00175 ACLGroupPermissionsList allGroupPermissions() const;
00180 bool setAllGroupPermissions( const ACLGroupPermissionsList & );
00181
00185 bool setACL( const QString &aclStr );
00186
00191 QString asString() const;
00192
00193 protected:
00194 virtual void virtual_hook( int id, void* data );
00195 private:
00196 class KACLPrivate;
00197 KACLPrivate* const d;
00198 KIO_EXPORT friend QDataStream & operator<< ( QDataStream & s, const KACL & a );
00199 KIO_EXPORT friend QDataStream & operator>> ( QDataStream & s, KACL & a );
00200 };
00201
00202 KIO_EXPORT QDataStream & operator<< ( QDataStream & s, const KACL & a );
00203 KIO_EXPORT QDataStream & operator>> ( QDataStream & s, KACL & a );
00204
00205 #endif