Music Hub  ..
A session-wide music playback service
context.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  * Copyright © 2022 UBports Foundation.
4  *
5  * Contact: Alberto Mardegan <mardy@users.sourceforge.net>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License version 3,
9  * as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Authored by: Thomas Voß <thomas.voss@canonical.com>
20  */
21 #ifndef LOMIRI_MEDIAHUBSERVICE_APPARMOR_AUTHENTICATOR_H
22 #define LOMIRI_MEDIAHUBSERVICE_APPARMOR_AUTHENTICATOR_H
23 
24 #include <QString>
25 
26 namespace lomiri
27 {
28 namespace MediaHubService
29 {
30 namespace apparmor
31 {
32 // Models an apparmor context name, and provides convenience functionality
33 // on top of it.
34 class Context
35 {
36 public:
37  // Constructs a new Context instance for the given raw name.
38  // Throws std::logic_error for empty names.
39  explicit Context(const QString &name);
40  virtual ~Context() = default;
41  // Returns the raw string describing the context.
42  const QString &str() const;
43 
44 private:
45  const QString name;
46 };
47 }
48 }
49 }
50 #endif // LOMIRI_MEDIAHUBSERVICE_APPARMOR_AUTHENTICATOR_H
lomiri::MediaHubService::apparmor::Context::str
const QString & str() const
Definition: context.cpp:34
lomiri::MediaHubService::apparmor::Context
Definition: context.h:34
lomiri::MediaHubService::apparmor::Context::~Context
virtual ~Context()=default
lomiri::MediaHubService::apparmor
Definition: context.h:30
lomiri
Definition: dbus_utils.h:24
lomiri::MediaHubService::apparmor::Context::Context
Context(const QString &name)
Definition: context.cpp:26