Debian Codegraph @

src/platform/linux.h

raw
1 /*
2 * Copyright (C) 2020 UBports foundation.
3 * Author(s): Marius Gripsgard <[email protected]>
4 *
5 * This program is free software: you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 3, as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
11 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 */
18
19 #pragma once
20
21 #include "platform.h"
22
23 #include <memory>
24
25 namespace platform {
26 class Linux : public Platform {
27 public:
28 Linux() = default;
29
30 std::string name() override;
31 std::string prettyName() override;
32 std::string buildId() override;
33 std::string deviceIdentifier() override;
34 DeviceInfo::DeviceType deviceType() override;
35 DeviceInfo::DriverType driverType() override;
36
37 bool hasValidName() override;
38
39 static bool usable() { return true; };
40 private:
41 std::string readFile(std::string file);
42 };
43 }