// SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later #ifndef PROCESS_H #define PROCESS_H #include #include #include typedef std::map Status; class Process { public: explicit Process(); explicit Process(int _pid); bool isExist(); std::vector getCmdLine(); std::string getCwd(); std::string getExe(); std::vector getEnviron(); std::string getEnv(const std::string &key); Status getStatus(); std::vector getUids(); int getPid(); int getPpid(); private: std::string getFile(const std::string &name); std::vector readFile(std::string fileName); int m_pid; std::vector m_cmdLine; std::string m_cwd; std::string m_exe; std::vector m_environ; Status m_status; std::vector m_uids; int m_ppid; }; #endif // PROCESS_H