~ubuntu-branches/ubuntu/trusty/eiciel/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gestor_xattr.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2010-06-04 02:38:02 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100604023802-jp2v6c9uviiioc5z
* New upstream release.
* debian/patches/02-gio.patch
  - Removed, merged upstream.
* debian/patches/03-no-libgnomeui.patch
  - Removed, merged upstream.
* debian/patches/01-fix-gettext-translations.patch
  - Fix gettext translations by using dgettext and specifying the correct
    domainname.
* debian/patches/02-de-po.patch
  - Update and complete German translation.
* debian/rules
  - Remove de.gmo on clean and rebuild it on build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    Eiciel - GNOME editor of ACL file permissions.
3
 
    Copyright (C) 2004-2005 Roger Ferrer Ib��ez
4
 
 
5
 
    This program is free software; you can redistribute it and/or modify
6
 
    it under the terms of the GNU General Public License as published by
7
 
    the Free Software Foundation; either version 2 of the License, or
8
 
    (at your option) any later version.
9
 
 
10
 
    This program is distributed in the hope that it will be useful,
11
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
    GNU General Public License for more details.
14
 
 
15
 
    You should have received a copy of the GNU General Public License
16
 
    along with this program; if not, write to the Free Software
17
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
*/
19
 
 
20
 
#ifndef GESTOR_XATTR_HPP
21
 
#define GESTOR_XATTR_HPP
22
 
 
23
 
#include <config.hpp>
24
 
 
25
 
#include <sys/types.h>
26
 
#include <sys/stat.h>
27
 
#include <unistd.h>
28
 
 
29
 
#include <attr/xattr.h>
30
 
 
31
 
#include <string>
32
 
#include <cstring>
33
 
#include <vector>
34
 
#include <map>
35
 
#include <glibmm.h>
36
 
#include <iostream>
37
 
 
38
 
#include <gettext.h>
39
 
 
40
 
 
41
 
class GestorXAttrException
42
 
{
43
 
        public:
44
 
                GestorXAttrException(Glib::ustring missatge) : missatge(missatge) 
45
 
                {
46
 
                }
47
 
 
48
 
                Glib::ustring getMessage() const
49
 
                { 
50
 
                        return missatge; 
51
 
                }
52
 
        private:
53
 
                Glib::ustring missatge;
54
 
};
55
 
 
56
 
class GestorXAttr {
57
 
 
58
 
        public:
59
 
                typedef std::map<std::string, std::string> atributs_t;
60
 
 
61
 
                GestorXAttr(const Glib::ustring& nomFitxer) throw (GestorXAttrException);
62
 
 
63
 
                atributs_t donarLlistaAtributs();
64
 
                void eliminarAtribut(std::string nomAtr);
65
 
                void establirAtributs(atributs_t atributs);
66
 
                void afegirAtribut(std::string nomAtr, std::string valor);
67
 
                void canviarNomAtribut(std::string anticNomAttr, std::string nouNomAttr);
68
 
 
69
 
                uid_t donarUidPropietari()
70
 
                {
71
 
                        return this->propietari;
72
 
                }
73
 
 
74
 
        private:
75
 
                std::vector<std::string> obtenirLlistaXAttr() throw (GestorXAttrException);
76
 
        std::string recuperarValorAtribut(const std::string& nomAtr) throw (GestorXAttrException);
77
 
 
78
 
                void testLectura() throw (GestorXAttrException);
79
 
 
80
 
                Glib::ustring nomFitxer;
81
 
 
82
 
                uid_t propietari;
83
 
}
84
 
;
85
 
 
86
 
#endif