~unity-team/qtmir/qtmir-gles

« back to all changes in this revision

Viewing changes to src/modules/Unity/Application/proc_info.h

  • Committer: Gerry Boland
  • Date: 2014-07-10 14:12:59 UTC
  • Revision ID: gerry.boland@canonical.com-20140710141259-8kt847ji6g6funki
Import lp:qtmir version 0.4.0 and modify for GLES-only mirserver plugin build

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2014 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it under
 
5
 * the terms of the GNU Lesser General Public License version 3, as published by
 
6
 * the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
 
9
 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
 
10
 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
 * Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
// Process Information
 
18
 
 
19
#ifndef PROC_INFO_H
 
20
#define PROC_INFO_H
 
21
 
 
22
// std
 
23
#include <memory>
 
24
 
 
25
// boost
 
26
#include <boost/optional.hpp>
 
27
 
 
28
// Qt
 
29
#include <QByteArray>
 
30
#include <QStringList>
 
31
 
 
32
class QString;
 
33
 
 
34
namespace qtmir
 
35
{
 
36
 
 
37
class ProcInfo
 
38
{
 
39
public:
 
40
    class CommandLine
 
41
    {
 
42
    public:
 
43
        QByteArray m_command;
 
44
 
 
45
        bool startsWith(const char* prefix) const;
 
46
        bool contains(const char* prefix) const;
 
47
        boost::optional<QString> getParameter(const char* name) const;
 
48
        QStringList asStringList() const;
 
49
    };
 
50
    virtual std::unique_ptr<CommandLine> commandLine(quint64 pid);
 
51
    virtual ~ProcInfo();
 
52
};
 
53
 
 
54
} // namespace qtmir
 
55
 
 
56
#endif